给你个soap,xml格式的,该怎么调用啊?POST /WebSite1/WebService.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/HelloWorld"<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<HelloWorld xmlns="http://tempuri.org/">
<name>string</name>
<pwd>string</pwd>
</HelloWorld>
</soap:Body>
</soap:Envelope>
大哥帮下忙,很急!
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/HelloWorld"<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<HelloWorld xmlns="http://tempuri.org/">
<name>string</name>
<pwd>string</pwd>
</HelloWorld>
</soap:Body>
</soap:Envelope>
大哥帮下忙,很急!
解决方案 »
- 如果实现网站的多国语言快速切换?
- 一个表,求统计sql语句写法
- 求助:GridView,想通过a页面的GridView中的按钮将该行该列的值传递到b页中,并触发b页的新增事件,请问大概思路
- vs2.0 与 firefox的问题..
- 如何在后台代码中对datalist中button编程?
- 我想学习ASP.net,听说界面不好做,但功能强大,能不能给几个做好的且漂亮的网站例子,看看!
- 高分求助!请问怎样在一个web页面切换至另一个页面之间执行某些服务器端操作
- 请教一个httpd.ini的写法问题
- WEB打印,框架页
- 怎样在一个页面里控制其他页面的控件???
- 网站整合支付宝并支付成功后,如何获取支付宝的返回值
- fck在vs2005上运行没有问题 但是发布到iis上就报错
Host: localhost
----------------------------------------------
从这个位置可以看出是个webservice<soap:Body>
<HelloWorld xmlns="http://tempuri.org/">
<name>string </name>
<pwd>string </pwd>
</HelloWorld>
</soap:Body>
-----------------------------
上面是方法参数
原形应该是HelloWorld(string name,string pwd);
具体代码看怎么调用websercie
function PostRequestData(URL,data){
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("POST",URL, false);
xmlhttp.SetRequestHeader ("Content-Type","text/xml; charset=utf-8");
xmlhttp.SetRequestHeader ("SOAPAction","http://tempuri.org/myService/test/isNumner");
try {
xmlhttp.Send(data);
var result = xmlhttp.status;
}
catch(ex) {
return( ex.description + "|" + ex.number);
}
if(result==200) {
return( xmlhttp.responseText);
}
xmlhttp = null;
}
function loadit(value){
var url = 'http://localhost/myService/test.asmx';
var data ;
var r;
data = '<?xml version="1.0" encoding="utf-8"?>';
data = data + '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">';
data = data + '<soap:Body>';
data = data + '<isNumner xmlns="http://tempuri.org/myService/test">';
data = data + '<str>'+value+'</str>';
data = data + '</isNumner>';
data = data + '</soap:Body>';
data = data + '</soap:Envelope>';
r=PostRequestData(url,data);
document.write(r);
}
loadit('5');
</script> 参考