开发者

Using a web service (WSDL) in Javascript

开发者 https://www.devze.com 2023-03-02 11:48 出处:网络
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

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消