Using a web service (WSDL) in Javascript
I have designed a web based calculator. But I want to have this calculator run on a web service(WSDL). I'm using C# and Javascript behind the back of my website. So could you help me where to add the WSDL descriptions in code and where? If required I can put my code here. Bes开发者_如何学JAVAt regards.
You need to make a request to the webservice, you don't need to put WSDL into javascript.
Calling a webservice is a request like any other request, you can use AJAX with JQuery for example:
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebService.asmx/WebMethodName",
data: "{}",
dataType: "json"
});
Example from: http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/
精彩评论