cancel
Showing results for 
Search instead for 
Did you mean: 

User authentication error with Proxy Java Calling web Service in XI

AntonioSanz
Active Participant
0 Kudos

Hello,

I have deploy a Web Service in SAP XI 3.0. within a SOAP sender adapter.

I have also created the Proxy Java Class to access the webservice in the Developer Studio and a Plain Java Class (only with a method main) which uses the proxy classes to consume the web service.

But when I launch the program a get the next error message:

java.rmi.RemoteException: Service call exception; nested exception is:

com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized.

at com.everis.serviciosweb.xi.MI_OUT_STATUSBindingStub.MI_OUT_STATUS(MI_OUT_STATUSBindingStub.java:73)

at com.everis.llamadas.invocacionWSStatus.main(invocacionWSStatus.java:76)

Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized.

at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.handleResponseMessage

Where MI_OUT_STATUSBindingStub is my Stub Class.

I have tried to set USERNAME_PROPERTY and PASSWORD_PROPERTY at runtime from my Stub class to the values that I use to access SAP XI (Integration Repository & Integration Directory) but it still doesn't´t work.

Have anyone a solution?

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Your scenario is little confusing.

You have a sender webservice, which should be an outbound interface.

Then, you also created a java proxy client, which should be generated from an outbound interface.

The java proxy client can send a message to XI without using the webservice. Is there any reason the webservice is used?

Have you tried just using the java proxy client?

Regards,

Bill

AntonioSanz
Active Participant
0 Kudos

Thanks William.

Yes, I have a sender webservice to access an outbound interface. And I have created in Developer Studio a Standalone WebService Proxy Project with the wsdl file that I have obtained from Integration Directory.

But this classes are not the proxy classes (Java Proxy/ABAP Proxy) that can be use to call XI via XI adapter.

And my requiriments are to use the webservice, that is why I am using this aproach.

Regards,

Antonio

Former Member
0 Kudos

Hi Antonio,

You can try to use the SOAP Client tool, which can be downloaded from SDN.

Since this is a generic tool to test webservices, you can determine whether your java program or XI is causing the problem.

If the soap client test tool is producing the same error, then there is probably a configuration error in XI. Make sure userid and password are properly entered in the test tool.

Regards,

Bill

AntonioSanz
Active Participant
0 Kudos

Thanks for your answer.

I have download the SOAP Client tool and I get the same error. I have also tried to send a message from the runtime workbench and I get the same error.

I think that the problem have a relationship with ICM configuration. I have tried to configure the user/password and authentication method for the ICM service /sap/xi/engine thru transaction SICF but I don´t know how do it exactly.

After that I'm going to prove with this user/password.

Antonio.

AntonioSanz
Active Participant
0 Kudos

Hi,

finally I have fixed it.

The root of the problem was on the way that I proceed with the generation of wsdl in Integration Directory.

The second step in the wizard for generation of wsdl ask for a url to call the web service and gives you an option to complete the url automatic. I have use this option and it have proposed my an url of type http://<host>:<port>/sap/xi/engine?entry=.

But the SOAP adapter call is in the form http://<host>:<port>/XISOAPAdapter/MessageServlet?channel=<party>:<business service>:<channel>

So using this type of url in the generation of wsld solves all the problems.

Regards,

Antonio.