从.NET调用SAP PI Webservices

问题描述

| 尝试使用C#.net控制台调用SAP PI Web Services时,出现以下错误消息:
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凭据后,一切工作正常。     

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...