Wcf 在.NET的SAP PI调用中使用基本身份验证

Wcf 在.NET的SAP PI调用中使用基本身份验证,wcf,basic-authentication,sap-pi,sap-xi,Wcf,Basic Authentication,Sap Pi,Sap Xi,尝试使用C#.net控制台应用程序调用SAP PI Web服务时,我收到以下错误消息: The HTTP request is unauthorized with client authentication scheme 'Basic'. The authentication header received from the server was 'Basic realm="XISOAPApps"'.m="XISOAPApps"'. 我的自定义绑定如下所示: <customBinding

尝试使用C#.net控制台应用程序调用SAP PI Web服务时,我收到以下错误消息:

The HTTP request is unauthorized with client authentication scheme 'Basic'. The authentication header received from the server was 'Basic realm="XISOAPApps"'.m="XISOAPApps"'.
我的自定义绑定如下所示:

<customBinding>  
        <binding name="CustomHttpTransportBinding">  
          <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"  
              messageVersion="Soap11" writeEncoding="utf-8">  
            <readerQuotas maxDepth="10000000" maxStringContentLength="10000000"  
                maxArrayLength="67108864" maxBytesPerRead="65536" maxNameTableCharCount="100000" />  
          </textMessageEncoding>  
          <httpTransport authenticationScheme="Basic" bypassProxyOnLocal="false"  
              hostNameComparisonMode="StrongWildcard" keepAliveEnabled="false"  
              proxyAuthenticationScheme="Basic" realm="XISOAPApps" useDefaultWebProxy="true" />  
        </binding>  
      </customBinding>  

如果我在上面做错了什么,有人能纠正我吗?
谢谢。

具有基本身份验证的SAP PI Web服务:

      <basicHttpBinding>
        <binding ...>
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Basic" />
          </security>
        </binding>
      </basicHttpBinding>


验证您的SAP web服务凭据是否正确且未锁定。我刚刚遇到了这个错误,我要求我的SAP P.I.管理员验证SAP服务凭据,结果发现它们已被锁定。在她为我解锁SAP凭据后,一切正常

是否在代理上添加了系统的用户名和密码?是的,proxy.Credentials.Username=“anyuser”;proxy.Credentials.Password=“good”。我建议在客户机或fiddler上使用消息日志记录,查看您的请求在线路上的样子,并查看是否有任何内容看起来不合适感谢John,不幸的是,svcutil即使在更新名称空间的情况下仍会输出相同的警告。