I am developing one mobile web application.
In this, i want to call a Web Service and fetch data from their using Java Script only.
I searched a lot and try to implement some code also but it didn't help me out.
One thing is that the Web Service was made in .NET using SOAP.
So, please help me to solve it immediately.
One easy would be to create an ASP.NET Web API Http service wrapper around your current webservice and use jQuery to access it. This will be much simpler than using JS to access a SOAP service.
More on ASP.NET Web API: http://www.asp.net/web-api
Related
I have an AngularJS application which currently uses http.get to get JSON data from an API. This works great.
I'm wondering if I can pass a static webpage URL, and scrape the results using the response from http.get?
I've seen tutorials on web scraping with Node and JavaScript libraries like ScraperJS, but I haven't been able to successfully use these in an Angular (client-side) application. Is there anyway to use a JavaScript web scraping library in Angular?
There is no direct way to do so because this has nothing to do with Angular at all. Client-side JavaScript is just that. It runs on the client. What you need to do involves making an HTTP call for request URL and retrieving the HTML from a site, then parsing that HTML for various meta-data. That needs to be done via a server-side call to the site to load the data from the remote site.
Is there any method of calling a SOAP Service with the URL :
http://localhost:8088/...TestService?wsdl
How can I invoke and get the values from the client using javascript?
Cheers!!
Thanks
You shouldnt call soap service directly from js because soap is not limited to http communication and there is no good support for soap in JavaScript.
It is better to use intermediate layer which is more capable in terms of soap communication. For example you can call from JavaScript your asp.net mvc application using ajax and then call soap service from asp.net mvc app using wcf. Instead of asp.net mvc you can use any other server side technology and soap communication library. JavaScript is good for ajax/json communication but not for soap.
JavaScript doesn't have a SOAP library out of the box, though you can google around and find them, The web services still need to be on the origin server.
Similar Question found
here
i have been working on a online game of TicTacToe and to achive it i am using WCF polling duplex service.
But after thorough searching for the whole week, i think it is possible for only silverlight clients.
If anyone knows that polling duplex service can be used with non Silverlight client like mvc3,asp.net or likewise javascript and so ,,,, then please give me idea, link or sample code snipet.
Thanks in Advance...
you should build your wcf with a REST endpoint. That could be the way to go to consume with javascript.
You can start learning how to do that here: http://msdn.microsoft.com/en-us/magazine/dd315413.aspx
Don't forget about very cool and useful (auto json serialization/deserialization, easy debugging) WebMethods/PageMethods
To use server WebMethods from some external (outside page) wcf service you can add script reference to asmx "JS" endpoint. For ex. "/_vti_bin/PageService.asmx/JS" and you are good to go:
{WCFNamespace}.{WebMethodName}({arguments}) in javascript. Very handy.
By the way Ascx controls for ex. doesn't allow to use PageMethods! And Sharepoint visual webparts based on ascx.
I have a web site showing some data. It is constructed of:
- A web app, showing data.(ASP.Net app, but I don't use server side features in showing data; It's pure HTML and JavaScript)
- A Service providing data in Json format.(WCF)
the client requests data and receives and shows them.
Now I want to change the process in order to works in push base strategy.
I googled and I found out that that Comet is a good choice, but I don't found practical samples in my case.
Some samples had client with php (server-side) and so on.
Now I want some hints on using comet in a way that client is pure JavaScript and HTML and server is WCF (server pushes Json to JavaScript )
look at nComet it is an asp.net implementation of comet, not sure if it is wcf yet, but i would have thought much of the code would be reusable.
Or better pokein
I have a wsdl service and as I generate it with svcutil.exe, it gave me a .cs file. Now my question is how can I call the service with javascript for android. Where do I go from here? Any suggestions or any reference/step-by-step tutorial or a sample demo would be a great help for me. I am developing an application for android with phonegap 1.4.1, Many thanks.
The .cs file you have is just a DTO. You would need to code you Operations and Data contracts in the WCF service to make anything happen.
With javascript in mind, I would just use JQuery and the .Ajax() method for making the calls from the client side. There are tons of articles on how to accomplish that.
http://www.codeproject.com/Articles/128478/Consuming-WCF-REST-Services-Using-jQuery-AJAX-Call
http://forums.asp.net/t/1513059.aspx/1
JQuery/WCF without ASP.NET AJAX: