• WebService 错误解决记录


    1.集成Windows认证

    MI_ILO062_PORDCR1_PORDCR103Client client = new MI_ILO062_PORDCR1_PORDCR103Client();
    
    client.ClientCredentials.UserName.UserName = "PI000007";
    client.ClientCredentials.UserName.Password = "123qwe";
    
    client.MI_ILO062_PORDCR1_PORDCR103(PORDCR103);
    

    配置文件:

    <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                  <binding name="MI_ILO062_PORDCR1_PORDCR103Binding">
                      <security mode="TransportCredentialOnly">
                        <transport clientCredentialType="Windows" proxyCredentialType="Windows" realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                  </binding>
                </basicHttpBinding>
                <customBinding>
                    <binding name="SapServiceSoap12">
                        <textMessageEncoding messageVersion="Soap12" />
                        <httpTransport />
                    </binding>
                </customBinding>
            </bindings>
            <client>
                <endpoint address="http://antad20pd1.anta.com:8000/XISOAPAdapter/MessageServlet?channel=:BS_EPOS:CC_SOAP_ILO062_SENDER&amp;version=3.0&amp;Sender.Service=BS_EPOS&amp;Interface=http%3A%2F%2Fpi.anta.com%2Fepos%2Fgeneral%5EMI_ILO062_PORDCR1_PORDCR103"
                    binding="basicHttpBinding" bindingConfiguration="MI_ILO062_PORDCR1_PORDCR103Binding" 
                    contract="ServiceReference2.MI_ILO062_PORDCR1_PORDCR103" name="MI_ILO062_PORDCR1_PORDCR103Port"
                          behaviorConfiguration="ImpersonationBehavior"/>
            </client>
    
          <behaviors>
            <endpointBehaviors>
              <behavior name="ImpersonationBehavior">
                <clientCredentials>
                  <windows allowedImpersonationLevel="Impersonation"/>
                </clientCredentials>
              </behavior>
            </endpointBehaviors>
          </behaviors>
        </system.serviceModel>

    2.The one-way operation returned a non-null message with Action=''.

    由WSDL生成的代理类,默认IsOneWay=ture,需改为false,否则调用会报错。

    3.HTTP 415 Unsupported Media Type.

    When you check "Do Not use SOAP Envelop", the SOAP adapter chooses application/xml instead of text/xml.

    You can change the content type with help of the MessageTransformBean. You put the bean in the module chain of the receiver channel and add the parameter Transform.ContentType = text/xml

  • 相关阅读:
    uniapp微信小程序主包vendor.js过大
    uniapp 微信小程序实现微信分享
    uniapp 解决H5跨域问题
    AT2339[AGC011C]Squared Graph【黑白染色】
    6. Z 字形变换
    PCl1.12.0安装
    C#中两个冒号(::)的作用 转
    只代理中国大陆
    C语言在Linux上的基本开发环境
    在linux上使用命令操作阿里云盘下载上传分享文件
  • 原文地址:https://www.cnblogs.com/KevinG/p/4092529.html
Copyright © 2020-2023  润新知