How to call .NET WSDL call in jQuery Javascript?

时光毁灭记忆、已成空白 提交于 2019-12-14 03:14:39

问题


I have one web service built in .NET SOAP. URLlike http://.../abc.asmx?WSDL

In that i have one function called abc.

So how can i call that webservice because it not directly return me XML.

In WSDL i have to call function then it return me XML file.

Tried using

$.ajax({
    type: "GET",
    url: 'http://...asmx?WSDL',
    dataType: "xml",
    success: function(xml) {
           alert(xml);

   },
    error: function(xhr, xml) { alert('else'+xml + '\n' + xhr.responseText); }
  }); 

but it send me to error not success


回答1:


use $.ajax(), specify the URL, and the data type

$.ajax({
  url: "yourPage.aspx/yourWebSerivice/YourMethod",
  type: "POST",
  data: "{}",
  dataType: "xml"
});


来源:https://stackoverflow.com/questions/10444579/how-to-call-net-wsdl-call-in-jquery-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!