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";

  • 相关阅读:
    JQuery操作DOM
    JQuery事件和动画
    Jquery选择器
    初学JQuery
    JavaScript对象及面向对象
    JavaScript操作DOM
    JavaScript操作BOM
    JavaScript基础
    网络流之最大流Dinic算法模版
    杭电1532----Drainage Ditches『最大流』
  • 原文地址:https://www.cnblogs.com/Johar/p/8797510.html
Copyright © 2011-2022 走看看