zoukankan      html  css  js  c++  java
  • WebService 常用的设置

    1.修改WebService接收长度

    <binding name="IAuthServiceSoap11Binding" maxBufferSize="2147483647"
    maxReceivedMessageSize="2147483647"/>
    <binding name="ICuServiceSoap11Binding" maxBufferSize="2147483647"
    maxReceivedMessageSize="2147483647"/>


    或者

    <binding name="IAuthServiceSoap12Binding">
    <textMessageEncoding messageVersion="Soap12" />
    <httpTransport maxBufferSize="2147483647"
    maxReceivedMessageSize="2147483647"/>
    </binding>
    <binding name="ICuServiceSoap12Binding">
    <textMessageEncoding messageVersion="Soap12" />
    <httpTransport maxBufferSize="2147483647"
    maxReceivedMessageSize="2147483647"/>
    </binding>

    2. 设置WebService认证的用户名和密码

    <basicHttpBinding>
    <binding name="IWsOpsServiceSoap11Binding" maxBufferSize="2147483647"
    maxReceivedMessageSize="2147483647" >
    <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Basic"/>
    <message clientCredentialType="UserName"/>
    </security>
    </binding>
    </basicHttpBinding>

    string address = string.Format("http://{0}:{1}/ops/services/IWsOpsService.IWsOpsServiceHttpSoap11Endpoint/", ip, port);
    var client = new WsOpsService.WsOpsServicePortTypeClient("IWsOpsServiceHttpSoap11Endpoint", address);
    client.ClientCredentials.UserName.UserName = "admin";
    client.ClientCredentials.UserName.Password = "123456";

  • 相关阅读:
    快速幂和矩阵快速幂-模板
    gcd-模板+最小公倍数
    manacher-模板-hd-3068
    kmp-模板-hd-1711
    链式前向星-邻接表--模板
    poj-3096-Suprising Strings
    hihocoder-1615-矩阵游戏II
    hihocoder-Week174-Dice Possibility
    论文-Swish: A self-gated Active Function
    hihocoder-1595-Numbers
  • 原文地址:https://www.cnblogs.com/Johar/p/8797510.html
Copyright © 2011-2022 走看看