Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using basic authentication in SAP PI calls from .NET

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.

like image 618
Nil Pun Avatar asked Jun 25 '11 10:06

Nil Pun


1 Answers

SAP PI webservice with Basic Authentication:

      <basicHttpBinding>
        <binding ...>
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Basic" />
          </security>
        </binding>
      </basicHttpBinding>
like image 125
Brian Low Avatar answered Oct 01 '22 23:10

Brian Low