调用方法如下
Hashtable ht = new Hashtable();
ht.Add("LoginName", "Admin");
ht.Add("Password", "Password");
ht.Add("Aey", "123");
var data = HttpHelper.SoapV1_1WebService("http://localhost/OpenApi/MobileService.asmx", "Login", ht, "http://tempuri.org/");
我是用SOAP1.1这个方法成功调用的;
此方法可以多加使用,当然有更好的方法时可以考虑使用更好的方法。
以下是 SOAP 1.2 请求和响应示例。所显示的占位符需替换为实际值。
POST /OpenApi/MobileService.asmx HTTP/1.1
Host: gps.szwearable.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<Login xmlns="http://tempuri.org/">
<LoginName>string</LoginName>
<Password>string</Password>
<Aey>string</Aey>
</Login>
</soap12:Body>
</soap12:Envelope>HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<LoginResponse xmlns="http://tempuri.org/">
<LoginResult>boolean</LoginResult>
</LoginResponse>
</soap12:Body>
</soap12:Envelope>
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-65451-3.html
刚开战没多久
一会儿说伊拉克“可能”有杀伤性武器要入侵伊拉克
还真想下去吗