on 09-09-2009 10:07 PM
Gurus,
I use VS 2008 and my proxy for a SAP web service is using anonymous as security.
However, the actual SAP web service is using 'basic' security.
How to change the authentication on the client (without re-creating by removing and adding services in VS studio)
from anonymous to basic security?
Thanks,
Hi,
you must configure a BasicHttpBinding in your client-side .NET config file (app.config or web.config; depending on your .NET client-type); and associate the client-endpoint with that.
Example:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="SAP_SoapBinding" 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="TransportCredentialOnly">
<transport clientCredentialType="Basic" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint
address="http://ams-dis-1.topforce.local:51080/sap/bc/srt/rfc/sap/Z_EE_CREATE_EMPLOYEE_EXPENSE?sap-client=200"
binding="basicHttpBinding" bindingConfiguration="SAP_SoapBinding"
contract="Z_EE_CREATE_EMPLOYEE_EXPENSE"
name="Z_EE_CREATE_EMPLOYEE_EXPENSESoapBinding" />
</client>
</system.serviceModel>
The actual credentials transferred when invoking the SAP webservice are runtime set from code:
using (Z_EE_GET_EMPLOYEE_EXPENSEClient sapClient = new Z_EE_GET_EMPLOYEE_EXPENSEClient(endPoint))
{
sapClient.ClientCredentials.UserName.UserName = sapSvcUserName;
sapClient.ClientCredentials.UserName.Password = sapSvcPwd;
Best regards, William.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.