cancel
Showing results for 
Search instead for 
Did you mean: 

How to change authentical in .net proxy?

Former Member
0 Kudos

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,

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.