zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    NullPointerException
    面试oracle 经常问的一个问题- 事务
    python 之 import、from、as 关键字的 白话 解释与例子
    python 学习 之 第二章(条件、循环和其他语句)
    python学习 之 第一章 (简单例子与常用数据类型)
    python中常用函数含义记录
    python 2 版本中的input() 和 raw_input() 函数的比较
    字符串处理关键字str 和 repr
    文件操作-一个可以直接复制文件数据的小程序
    C语言 32个关键字
  • 原文地址:https://www.cnblogs.com/KevinG/p/4092529.html
Copyright © 2011-2022 走看看