如何在jQuery Javascript中调用.NET WSDL调用? [英] How to call .NET WSDL call in jQuery Javascript?
本文介绍了如何在jQuery Javascript中调用.NET WSDL调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个用.NET SOAP内置的Web服务.类似于URL的 http://.../abc.asmx?WSDL
I have one web service built in .NET SOAP. URLlike http://.../abc.asmx?WSDL
因为我有一个叫做abc的函数.
In that i have one function called abc.
所以我该如何调用该Web服务,因为它不会直接返回XML.
So how can i call that webservice because it not directly return me XML.
在WSDL中,我必须调用函数,然后它才能返回XML文件.
In WSDL i have to call function then it return me XML file.
尝试使用
$.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
推荐答案
使用 $ .ajax(),指定URL和数据类型
use $.ajax(), specify the URL, and the data type
$.ajax({
url: "yourPage.aspx/yourWebSerivice/YourMethod",
type: "POST",
data: "{}",
dataType: "xml"
});
这篇关于如何在jQuery Javascript中调用.NET WSDL调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文