cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP Adapter .Net 401 Security Credentials

Former Member
0 Kudos

Folks....

I need to send a SOAP request to a Sender Soap Adapter I have published on XI.

I am accomplishing this through a .NET Client.

My service returns an HTTP 401.

I am calling via the URL http://<host>:<port>/XISOAPAdapter/MessageServlet?channel=:<service>:<channel>;

I have tried to add a User Token containing a userid and a password to the SOAP Header via Microsoft's direction using their WebServices2 API to no avail. I don't believe that the token placed on the SOAP Header matches the signature needed by XI.

Can someone either direct me toward a spec on how to form the SOAP header in .Net or provide a working example of what elements to add?

I also may be completely mis-diagnosing the problem in which I apologize and am open to other suggestions....

Many Thanks,

Jonathan

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Folks...

Resolution was this.

It appears that Microsoft's WebServices2 library defaults a Security Header with a Timestamp element included.

XI does not seem to be able to parse this Header element and fails.

The solution was to inherit from the original SOAP API which was

System.Web.Services.Protocols.SoapHttpClientProtocol

This left out the Security header and messages were able to flow through to the pipeline.

This combined with adding "Basic" credentials to the Credentials Cache allowed us to post messages.

J-

Former Member
0 Kudos

Hi jonathan, I am trying to consume an XI webservice using VB.Net, I am unable to create a reference using provided WSDL, therefore I had to create manually the proxy dll for the webservice. I am trying make invoke call but get the 401 unauthorised error.

I would appreciate if you could provide me your code to see how you referenced, initialise, passed credential and varible values and invoke the webservice method

Thanks in advance Waseem Ishaq

Former Member
0 Kudos

It appears that Microsoft offers a property to each Web Service called "Credentials" which allows you to send some type of Authentication.

This got me past the 401 error immediately returned, code is listed below

CredentialCache cache = new CredentialCache();

cache.Add(new Uri(<serviceProxy>.Url),"Basic",new NetworkCredential(<userid>,<password>));

<service>.Credentials = cache;

Now I am actually getting entries in the XI\DVEBMGS00\j2ee\cluster\server0\log\applications.log file

I am assuming this to mean that some part of the credentials are being met, however I am now getting the following error which looks to be related to some type of certificate security???

Error during parsing header item http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsdSecurity using class com.sap.aii.messaging.mo.wss.Security at http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsdTimestamp/ caused by --- expecting end tag: Security, but found Timestamp at state 1

I am going to grab my SOAP request to paste out here later if that will help....

-J