2

I am trying to connect to a web service served by SAP and I have authentication problem.

I simply added the service by right clicking project, selecting add service reference, giving WSDL URL for the service and clicking OK.(After clicking ok asked for credentials and I provided them)

Then when I tried to call a method from the serviceclien object, I got the error message below:

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="SAP Web Application Server "'.

Web Config Related Part:

<basicHttpBinding>
<binding name="binding" closeTimeout="00:01:00"
 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
 allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
 maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
 messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
 useDefaultWebProxy="true">
 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
  maxBytesPerRead="4096" maxNameTableCharCount="16384" />      
 <security mode="None">       
  <transport clientCredentialType="None" proxyCredentialType="None"
   realm="">
   <extendedProtectionPolicy policyEnforcement="Never" />
  </transport>       
  <message clientCredentialType="UserName" algorithmSuite="Default" />
 </security>
</binding>

Also, What problems will i face with? I do not want to use SAP .NET Connector. Thanks...

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
mehmet6parmak
  • 4,777
  • 16
  • 50
  • 71

1 Answers1

0

Go to the Web Services Navigator on SAP. Download the WSDL, it will come in three parts. Splice them together and build a .NET proxy against the new WSDL. The service appears to require you to do basic auth. You need a user on SAP, that is authorized to call the service and invoke it's backend. Add a basic authentication HTTP header to your service.

Marinus
  • 2,210
  • 2
  • 15
  • 15