Using basic authentication in SAP PI calls from .NET

Nil Pun picture Nil Pun · Jun 25, 2011 · Viewed 8k times · Source

I'm getting the error message below when trying to call the SAP PI Web Services using C#.net console app:

The HTTP request is unauthorized with client authentication scheme 'Basic'. The authentication header received from the server was 'Basic realm="XISOAPApps"'.m="XISOAPApps"'.

My custombinding looks like this:

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

Could anyone please correct me if I'm doing something wrong above? Thank you.

Answer

Brian Low picture Brian Low · Feb 14, 2013

SAP PI webservice with Basic Authentication:

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