cancel
Showing results for 
Search instead for 
Did you mean: 

Soap Receiver adapter - 401 error

krishg
Active Participant
0 Kudos

I am getting following error with soap receiver,

com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 401 Unauthorized

I am able to consume the webservice with SOAP UI without any difficulty. I have tried with both the endpoint URL and WSDL url without success. I have tried with/without 'Do not use SOAP envelope'. I am not sure what is wrong. When the message is sent via PI, he is not able to look at the payload (while performing the trace) , while he is able to view the actual soap message with SOAP UI.

When i type the ENDPOINT url in my http address, i get a 'page not found' error.

Any ideas as to what i could be missing?

Accepted Solutions (1)

Accepted Solutions (1)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

plase, thake a look to this thread with the same error.

http://forums.sdn.sap.com/thread.jspa?threadID=1514557

Rgds

RP

krishg
Active Participant
0 Kudos

When I configured TCPGateway to trace the messages going out, this is what I observed

For messages from PI, the response message was

====Response ====

HTTP/1.1 401 Unauthorized

Server: Apache-Coyote/1.1

WWW-Authenticate: Basic realm="CASM"

Content-Type: text/html;charset=utf-8

Content-Length: 40

Connection: close

<HTML><BODY>Not Authorized</BODY></HTML>

==============

For messages from SOAP UI;

==== Response ====

HTTP/1.1 401 Unauthorized

Server: Apache-Coyote/1.1

WWW-Authenticate: Basic realm="CASM"

Content-Type: text/html;charset=utf-8

Content-Length: 40

Date: Wed, 09 Nov 2011 20:15:39 GMT

<HTML><BODY>Not Authorized</BODY></HTML>HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

Set-Cookie: JSESSIONID=00582206B88900BD76431C1EFBE12EA8; Path=/xx

Keep-Alive: timeout=1200000, max=1000

Connection: Keep-Alive

Content-Encoding: gzip

Content-Type: text/xml;charset=utf-8

Content-Length: 2359

I noticed that initial response was Unauthorized and than the server turned around and gave a 200 OK message.

Also noticed that SOAP UI client did a HTTP 1.1 post while PI was a HTTP 1.0 post... not sure if that made any difference.

0 Kudos

Hi,

Ensure you have maintained the correct password, which MUST be the same, for all the service users

on XI. You may check all the places it should be maintained, such as Exchange Profile, SU01, SLDAPICUST, etc..

Check the note below, according to your release:

PI 7.1:

#999962 - PI 7.10: Change passwords of PI service users

XI 7.0

#936093 - XI 7.0: Changing the passwords of XI service users

XI 3.0

#721548 - XI 3.0: Changing the passwords of the XI service users

Also ensure that the user has the correct role as per link below:

http://help.sap.com/saphelp_nwpi71/helpdata/en/9f/d12940cbf2195de10000000a1550b0/frameset.htm

And, according to SAP Note 821026, increase below parameters:

ume.ldap.connection_pool.max_size to 50

ume.ldap.connection_pool.max_wait_time to 100.000

and retest.

Regards,

Caio Cagnani

Former Member
0 Kudos

Hi,

401 is Autharization error means credentials.

When you are sending request from UI tool, mention credentials (user name and password) in UI tool.

For more informaion

http://pcsupport.about.com/od/findbyerrormessage/a/401error.htm (OR) check SAP OSS Note 856897

Regards,

Venkata Ramesh

krishg
Active Participant
0 Kudos

One more interesting behaviour when I was sending from SOAP UI, The request was posted twice, meaning there were two POST actions in my TCPGATEWAY listening port, while there was only one request via PI.

Wnen my partner put a trace, the SOAP envelop was missing in their TRACE for PI file while the SOAP envelop was available for SOAP ui message (in the second request). Could it have something to do with a fact that we are doing HTTP 1.1with soap uI While PI is HTTP 1.0 (HTTP 1.1 being a persistent connection resulting in second request)

Trace on the partner side,

PI Message

POST /Services/Calculator/Version1/Calculator.asmx HTTP/1.0

accept: * / *

host: www.html2xml.nl

user-agent: SAP-Messaging-com.sap.aii.af.sdk.xi/1.0505

callingtype: SJM

content-id: <soap-4EB90CC8537E011DE1008000CDEB6913>

content-type: text/xml; charset=utf-8

content-length: 888

SOAPAction: "http://tempuri.org/Add"

HTTP/1.0 401

WWW-Authenticate: Basic realm="CASM"

Content-Type: text/html;charset=utf-8

Content-Length: 40

Date: Thu, 10 Nov 2011 11:50:13 GMT

Connection: close

SOAP UI log

POST /Services/Calculator/Version1/Calculator.asmx HTTP/1.1

accept-encoding: gzip,deflate

content-type: text/xml;charset=UTF-8

soapaction: "Create"

user-agent: Jakarta Commons-HttpClient/3.1

host: www.html2xml.nl

content-length: 2496

HTTP/1.1 401

WWW-Authenticate: Basic realm="CASM"

Content-Type: text/html;charset=utf-8

Content-Length: 40

Date: Thu, 10 Nov 2011 12:04:40 GMT

POST /Services/Calculator/Version1/Calculator.asmx HTTP/1.1

accept-encoding: gzip,deflate

content-type: text/xml;charset=UTF-8

soapaction: "Create"

user-agent: Jakarta Commons-HttpClient/3.1

content-length: 2496

authorization: Basic U1lTX1dFQl9TQVBQSTo=

host: www.html2xml.nl

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";

</soapenv:Envelope>

HTTP/1.1 200

Set-Cookie: JSESSIONID=A48C8808315935EFD7AFBA8B4B96FC62; Path=/xx

Keep-Alive: timeout=1200000, max=1000

Connection: Keep-Alive

Content-Encoding: gzip

Content-Type: text/xml;charset=utf-8

Content-Length: 2882

krishg
Active Participant
0 Kudos

We got a documentation from our partner,

"If you use HTTP 1.0 you have to manually set the HTTP header ―connection‖ to keep-alive."...

So is there a way for us to change the HTTP post to 1.1 or set the HTTP header connection to keep-alive with SOAP http receiver or we have to change to Axis protocol?

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

So is there a way for us to change the HTTP post to 1.1 or set the HTTP header connection to keep-alive with SOAP http receiver or we have to change to Axis protocol?

You could try:

1. Use the Plain HTTP Adapter and use HTTP Destination. Create an HTTP Destination using SM59 of type G, once you have filled out the details (e.g server, port) go to the Special Options tab, under the HTTP Setting, set it to HTTP 1.1. I have not tried using it though, so please get back to us if this works.

2. Use the SOAP Axis Adapter, HTTP 1.1 is natively supported.

Hope this helps,

Mark

krishg
Active Participant
0 Kudos

I was able to resolve this issue. Eventhough the webservice does not require that password be populated, Password is mandatory for the SOAP UI adapter (changes the authentication mode). Once the partner set up the id with password it worked.

Former Member
0 Kudos

YES, Finally, I made SOAPUI work by input the user name/password

Answers (2)

Answers (2)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

I am able to consume the webservice with SOAP UI without any difficulty. I have tried with both the endpoint URL and WSDL url without success.

But in your SOAP UI are there any credentials that are being passed? Are you using dynamic configuration? Whenever a WS request is executed in SOAP UI, always go to the Raw tab to see what the HTTP Header should look like e.g


POST http://www.html2xml.nl/Services/Calculator/Version1/Calculator.asmx HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://tempuri.org/Add"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: www.html2xml.nl
Content-Length: 272

Means the WS URL in SOAP Receiver should be: http://www.html2xml.nl/Services/Calculator/Version1/Calculator.asmx

ContentType: text/xml;charset=UTF-8

SOAPAction: http://tempuri.org/Add

Hope this helps,

Mark

krishg
Active Participant
0 Kudos

Hi Mark

Thank you. My end point URL is same as the URL in the post action of the SOAP UI.

I am passing credentials in the comm. channel (only the user id is required, password not required)

I had my partner put a trace and he sent this,

POST /Services/Calculator/Version1/Calculator.asmx HTTP/1.0

accept: * / *

host: www.html2xml.nl

user-agent: SAP-Messaging-com.sap.aii.af.sdk.xi/1.0505

callingtype: SJM

content-id: <soap-4EB90CC8537E011DE1008000CDEB6913>

content-type: text/xml; charset=utf-8

content-length: 888

SOAPAction: "http://tempuri.org/Add"

and with response,

HTTP/1.0 401

WWW-Authenticate: Basic realm="CASM"

Content-Type: text/html;charset=utf-8

Content-Length: 40

Former Member
0 Kudos

Krish ,

try putting ?wsdl at the end of the url and also configure the user authentication - username and password in the soap receiver adapter .

You will see the request response in SXMB_MONI if you have the synchronous loggin enabled in the integration engine configuration .