cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP CLIENT facing authorization problem

Former Member
0 Kudos

I have a scenario where SOAP client makes a call to XI where XI is exposed as webservice in the outbound side using SOAP adapter.

In the inbound side there is an RFC adapter which makes a RFC call and returns somes value.

The problem is that I am facing uauthorization problem.

Can anyone tell me where to set the user name and password to avoid this authorization problem.

Thanks in advance

Mukesh

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks Suraj and Sudhir.

It helped me to solve the authuntication problem.

In the SOAP client tool request is :

<?xml version="1.0" encoding="ISO-8859-1"?>

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:p2="http://infosys.com/xi/OneNGL/training/webservice/rfc-soap" xmlns:p1="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc" name="soap_MI" targetNamespace="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc">

<wsdl:types>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc" targetNamespace="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc">

<xsd:complexType name="soapResponse_DT">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

047164b00fad11daa84d000e0c602248

</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="Status" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

7ad6cce00fac11da87a9dfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

<xsd:complexType name="soapRequest_DT">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

173ca4600fad11daaa28000e0c602248

</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="Name" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4000fac11dacb52dfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>Mukesh

</xsd:element>

<xsd:element name="EmpID" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4010fac11da9ce1dfd3ac191c0c

</xsd:appinfo>30149

</xsd:annotation>

</xsd:element>

<xsd:element name="EmpLocation" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4020fac11daa1bddfd3ac191c0c

</xsd:appinfo>Hyderabad

</xsd:annotation>

</xsd:element>

<xsd:element name="EmpPractice" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4030fac11daa8b0dfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>ES

</xsd:element>

<xsd:element name="EmpProject" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4040fac11dab5eadfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>BP

</xsd:element>

<xsd:element name="Technlogy" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4050fac11da8606dfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>SAPXI

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://infosys.com/xi/OneNGL/training/webservice/rfc-soap" targetNamespace="http://infosys.com/xi/OneNGL/training/webservice/rfc-soap">

<xsd:import namespace="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc" />

<xsd:element xmlns:p0="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc" name="soapResponse_MT" type="p0:soapResponse_DT" />

<xsd:element xmlns:p0="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc" name="soapRequest_MT" type="p0:soapRequest_DT" />

</xsd:schema>

</wsdl:types>

<wsdl:message name="soapRequest_MT">

<wsdl:part name="soapRequest_MT" element="p2:soapRequest_MT" />

</wsdl:message>

<wsdl:message name="soapResponse_MT">

<wsdl:part name="soapResponse_MT" element="p2:soapResponse_MT" />

</wsdl:message>

<wsdl:portType name="soap_MI">

<wsdl:operation name="soap_MI">

<wsdl:input message="p1:soapRequest_MT" />

<wsdl:output message="p1:soapResponse_MT" />

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="soap_MIBinding" type="p1:soap_MI">

<soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document" transport="http://schemas.xmlsoap.org/soap/http" />

<wsdl:operation name="soap_MI">

<soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="http://sap.com/xi/WebService/soap1.1" />

<wsdl:input>

<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />

</wsdl:input>

<wsdl:output>

<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name="soap_MIService">

<wsdl:port name="soap_MIPort" binding="p1:soap_MIBinding">

<soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://blrkecsaptst2:50000/XISOAPAdapter/MessageServlet?channel=:SOAPclient_forRFC:soapSender_30149&amp;version=3.0&amp;Sender.Service=SOAPclient_forRFC&amp;Interface=http%3A%2F%2Finfosys.com%2Fxi%2FOneNGL%2Ftraining%2Fwebservice%2Fsoap-rfc%5Esoap_MI" />

</wsdl:port>

</wsdl:service>

</wsdl:definitions>

and now I am geeting THE FOLLOWING IN MY RESPONSE,

<?xml version='1.0'?>

<!-- see the documentation -->

<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>

<SOAP:Body>

<SOAP:Fault>

<faultcode>SOAP:Server</faultcode>

<faultstring>Server Error</faultstring>

<detail>

<s:SystemError xmlns:s='http://sap.com/xi/WebService/xi2.0'>

<context>XIAdapter</context>

<code>MalformedMessageException</code>

<text><![CDATA[

com.sap.aii.messaging.mo.MalformedMessageException: No SOAP Envelope

at com.sap.aii.messaging.mo.Message.reparseRootDocument(Message.java:1018)

at com.sap.aii.messaging.net.MIMEInputSource.readSOAPPart(MIMEInputSource.java:598)

at com.sap.aii.messaging.net.MIMEInputSource.decodePart(MIMEInputSource.java:590)

at com.sap.aii.messaging.net.MIMEInputSource.readBody(MIMEInputSource.java:358)

at com.sap.aii.messaging.net.MIMEServletInputSource.parse(MIMEServletInputSource.java:58)

at com.sap.aii.af.mp.soap.web.MessageServlet.doPost(MessageServlet.java:365)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:392)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:159)

]]></text>

</s:SystemError>

</detail>

</SOAP:Fault>

</SOAP:Body>

</SOAP:Envelope>

but i am expecting to get the "Status" in my response which is my output field.

can you please let me know what i have to do now.

Thanks

Mukesh

Former Member
0 Kudos

Thank you very much Suraj.

I have followed the steps that you have mentioned.

In the wsdl I have replaced

<soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://blrkecsaptst2:8000/XISOAPAdapter/MessageServlet?channel=:SOAPclient_forRFC:soapSender_30149&amp;version=3.0&amp;Sender.Service=SOAPclient_forRFC&amp;Interface=http%3A%2F%2Finfosys.com%2Fxi%2FOneNGL%2Ftraining%2Fwebservice%2Fsoap-rfc%5Esoap_MI" />

with

<soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://blrkecsaptst2:8000/XISOAPAdapter/MessageServlet?channel=:SOAPclient_forRFC:soapSender_30149"/>

and while sending the request I am using targer url as

http://blrkecsaptst2:8000/XISOAPAdapter/MessageServlet?channel=:SOAPclient_forRFC:soapSender_30149.

Let me know whether all my settings are correct?

But still it is giving error,

com.sap.uddi.generic.impl.soap.NativeSOAPException : Server returned: 401 Unauthorized

=== START OF RESPONSE DUMP ===

HTTP/1.1 401 Unauthorized

connection: close

www-authenticate: Basic realm="XISOAPApps"

pragma: no-cache

cache-control: no-cache

expires: 0

content-type: text/html

content-length: 1469

server: SAP J2EE Engine/6.40

date: Fri, 19 Aug 2005 06:50:17 GMT

Basically it is authorization error.

can you plz let me know where I have to put the username and password.

former_member187339
Active Contributor
0 Kudos

Hi Mukeshlal,

First Sorry bcause the url should be

http://blrkecsaptst2:<b>50000</b>/XISOAPAdapter/MessageServlet?channel=:SOAPclient_forRFC:soapSender....

Make the change. And for Authentication Just give your XISUPER username and Password in View->Settings->Http Header.

Give TargetURL = http://blrkecsaptst2:<b>50000</b>/XISOAPAdapter/MessageServlet?channel=:SOAPclient_forRFC:soapSender...

and the corresponding request in the request pane. Click Send, if everyting is fine then you will get the output.

I have tested my scenario and its working.

Hope it will be helpful.

Regards

Suraj

Former Member
0 Kudos

Hi,

Thanks all for your quick reply.

Let me explain in detail what I have done till now.

STEP-1. While creating the WSDL using XI webservice wizard I have used "http://hostname:port/sap/xi/engine?type=entry" as my URL.

can you confirm me whether it is correct?

STEP-2. I uploaded this WSDL in the SOAP client that I have down loaded from SDN.

The generated WSDL looks like:

<?xml version="1.0" encoding="ISO-8859-1"?>

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:p2="http://infosys.com/xi/OneNGL/training/webservice/rfc-soap" xmlns:p1="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc" name="soap_MI" targetNamespace="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc">

<wsdl:types>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc" targetNamespace="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc">

<xsd:complexType name="soapResponse_DT">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

047164b00fad11daa84d000e0c602248

</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="Status" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

7ad6cce00fac11da87a9dfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

<xsd:complexType name="soapRequest_DT">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

173ca4600fad11daaa28000e0c602248

</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="Name" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4000fac11dacb52dfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="EmpID" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4010fac11da9ce1dfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="EmpLocation" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4020fac11daa1bddfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="EmpPractice" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4030fac11daa8b0dfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="EmpProject" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4040fac11dab5eadfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Technlogy" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

5849e4050fac11da8606dfd3ac191c0c

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://infosys.com/xi/OneNGL/training/webservice/rfc-soap" targetNamespace="http://infosys.com/xi/OneNGL/training/webservice/rfc-soap">

<xsd:import namespace="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc" />

<xsd:element xmlns:p0="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc" name="soapResponse_MT" type="p0:soapResponse_DT" />

<xsd:element xmlns:p0="http://infosys.com/xi/OneNGL/training/webservice/soap-rfc" name="soapRequest_MT" type="p0:soapRequest_DT" />

</xsd:schema>

</wsdl:types>

<wsdl:message name="soapRequest_MT">

<wsdl:part name="soapRequest_MT" element="p2:soapRequest_MT" />

</wsdl:message>

<wsdl:message name="soapResponse_MT">

<wsdl:part name="soapResponse_MT" element="p2:soapResponse_MT" />

</wsdl:message>

<wsdl:portType name="soap_MI">

<wsdl:operation name="soap_MI">

<wsdl:input message="p1:soapRequest_MT" />

<wsdl:output message="p1:soapResponse_MT" />

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="soap_MIBinding" type="p1:soap_MI">

<soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document" transport="http://schemas.xmlsoap.org/soap/http" />

<wsdl:operation name="soap_MI">

<soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="http://sap.com/xi/WebService/soap1.1" />

<wsdl:input>

<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />

</wsdl:input>

<wsdl:output>

<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name="soap_MIService">

<wsdl:port name="soap_MIPort" binding="p1:soap_MIBinding">

<soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://blrkecsaptst2:8000/sap/xi/engine?type=entry&amp;version=3.0&amp;Sender.Service=SOAPclient_forRFC&amp;Interface=http%3A%2F%2Finfosys.com%2Fxi%2FOneNGL%2Ftraining%2Fwebservice%2Fsoap-rfc%5Esoap_MI" />

</wsdl:port>

</wsdl:service>

</wsdl:definitions>

The SOAP client request parameters are "Name, EmpID EmpLocation,EmpPractice,EmpProject, Technlogy" and reponse will be "status"

After uploading the WSDL in the SOAP cleint tool, it appears in the request page.

Step 3. I have filled these request parameters below each element in the wsdl that appeared in the tool. When submit the request I am getting the following error in the response screen of the tool,

com.sap.uddi.generic.impl.soap.NativeSOAPException : Server returned: 401 Unauthorized

=== START OF RESPONSE DUMP ===

HTTP/1.1 401 Unauthorized

connection: close

www-authenticate: Basic realm="XISOAPApps"

pragma: no-cache

cache-control: no-cache

expires: 0

content-type: text/html

content-length: 1469

server: SAP J2EE Engine/6.40

date: Fri, 19 Aug 2005 04:48:46 GMT

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<title>Error Report</title>

<style>

td {font-family : Arial, Tahoma, Helvetica, sans-serif; font-size : 14px;}

A:link

A:visited

A:active

</style>

</head>

<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" rightmargin="0">

<table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" height="75">

<tr bgcolor="#FFFFFF">

<td align="left" colspan="2" height="48"><font face="Arial, Verdana, Helvetica" size="4" color="#666666"><b>&nbsp;&nbsp;401 &nbsp Unauthorized</b></font></td>

</tr>

<tr bgcolor="#3F73A3">

<td height="23" width="84"><img width=1 height=1 border=0 alt=""></td>

<td height="23"><img width=1 height=1 border=0 alt=""></td>

<td align="right" height="23"><font face="Arial, Verdana, Helvetica" size="2" color="#FFFFFF"><b>SAP J2EE Engine/6.40&nbsp;</b></font></td>

</tr>

<tr bgcolor="#9DCDFD">

<td height="4" colspan="3"><img width=1 height=1 border=0 alt=""></td>

</tr>

</table>

<br><br><br><br><br><br>

<p><font face="Arial, Verdana, Helvetica" size="3" color="#000000"><b>&nbsp;&nbsp;Access Denied.</b></font></p>

<p><font face="Arial, Verdana, Helvetica" size="2" color="#000000"><table><tr><td valign="top"><b>&nbsp;Details:</b></td><td valign="top"><PRE>No details available</PRE></font></td></tr></table></font></p>

</body>

</html>

=== END OF RESPONSE DUMP ===

can you please let me know where I have to mention the user name and password for accessing the XI server and

where I have mention the request parameters.

Thanks

Mukesh

former_member187339
Active Contributor
0 Kudos

Hi Mukeshlal,

<i>>> While creating the WSDL using XI webservice wizard I have used "http://hostname:port/sap/xi/engine?type=entry" as my URL.can you confirm me whether it is correct?</i>

It should be like this

http://host:port/XISOAPAdapter/MessageServlet?channel=party:service:channel

Under party:service:channel enter the party name, the service name, and the name of the communication channel. If no party has been created, enter the following: channel=:service:channel

<i>>>In wsdl change this

<soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://blrkecsaptst2:8000/sap/xi/engine?type=entry&version=3.0&Sender.Service=SOAPclient_forRFC&Interface=http%3A%2F%2Finfosys.com%2Fxi%2FOneNGL%2Ftraining%2Fwebservice%2Fsoap-rfc%5Esoap_MI" /></i>

with the address formed by the above help (http://blrkecsaptst2:8000/XISOAPAdapter/MessageServlet?channel=:SOAPclient_forRFC:<b>channel</b>)

For Username and password, try this :

Got to View->Settings->Http Header, specify the parameters there and test

Hope this will be helpful

Regards

Suraj

former_member187339
Active Contributor
0 Kudos

Hi Mukeshlal,

You have to give the credentials on the page from which you will be calling XI.

See this weblog :

https://weblogs.sdn.sap.com/pub/wlg/2131 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]

Hope this will be helpful

Regards

Suraj