b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

动态方法调用 为什么不安全 关于C#调用WebServices的方法(3)

电脑杂谈  发布时间:2018-02-06 22:03:04  来源:网络整理

调用方法如下

  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

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 包航
      包航

      还真想下去吗

    • 明景帝朱祁钰
      明景帝朱祁钰

      刚开战没多久

      • 原晴晴
        原晴晴

        一会儿说伊拉克“可能”有杀伤性武器要入侵伊拉克

    热点图片
    拼命载入中...