Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Authorization error calling a XI web service from Web Dynpro

Hi all,

I'm trying to communicate to XI from a Web Dynpro application but I get an Unauthorization error (401).

I've generated a WSDL in XI and import it to web dynpro as a new Model. But when a I call the web service, the exception "Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized." appears.

I don't know how to pass the right user and password from Web Dynpro, I've tried the web service from SOAP client tools and it works fine.

I'll apreciate any help.

Regards,

Diego.

Former Member
replied

Hi Campana,

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");

req._setPassword("password");

This way you will specify username/Password for Webservice.

Request_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetail is the Root Node of Webservice.

Hope this answer Helps.

Thanks

Madhan

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question