cancel
Showing results for 
Search instead for 
Did you mean: 

Problem calling XI WebServices from WebDynpro Java

Former Member
0 Kudos

<b>At this moment i have put it in the action button from view primary:</b>

<i>"wdThis.wdGetXIWebServiceComponentController().executeRequest_CDWS_MI_CDWS_MI();"</i>

<b>But now the result is a exception:</b>

<i>"Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized"</i>

<b>I have proved later:</b>

<i>In the Component Controller or Customer Controller doInit Method you have to specify this way.

Request_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay req=new Request_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay();

wdContext.nodeRequest_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay().bind(req);

req._setUser("username"); (eg. user_XI)

req._setPassword("password"); (eg. password_XI)

This way you will specify username/Password for Webservice.

Request_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetail is the Root Node of Webservice.</i>

<b>But now the message is: "Server Error".</b>

What can be happening now?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

I have solved the problem!!, the problem consisted in the URL Adress Target de XI.

The format must thus be:

--http://<host>:<port>/XISOAPAdapter/MessageServlet?channel=:<sender>:<channel>

Thanks by everything.

Luis.

Former Member
0 Kudos

Hi,

First check the Web Service is working properly or not ?

What is the return type of the Service ??

Post the complete "server error" stacktrace.

Regards, Anilkumar

former_member185029
Active Contributor
0 Kudos

Hi,

make sure that you are passing all the data as specified by schema.

I would suggest you to test your WSDL using tools like XML Spy.

This way you can check the SOAP request that is getting generated.

Ashutosh

Former Member
0 Kudos

Hi Luis

Try adding an additional catch block to the execute method of your custom controller, to catch exceptions of type javax.xml.rpc.soap.SOAPFaultException:

catch (SOAPFaultException sfe) {

manager.reportException("SOAPFaultException: " + sfe.getDetail(),false);

catch(Exception e){

manager.reportException(e.getMessage(), false);

}

This should give you more detail about the error you're getting back from the XI server.

Cheers

Tom