Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to enable cached authentication details..??  RSS feed

Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using Oracle Service Bus(OSB). I have two web services running in OSB. One importing schema and making use of it and other one without using schema. I have no problem to invoke the service that doesn't import schema. I am sending the username and password as given in the below code snippet.

weblogic.wsee.connection.transport.http.HttpTransportInfo httpInfo = new weblogic.wsee.connection.transport.http.HttpTransportInfo();
ABCServiceSoap_Service service = new ABCServiceSoap_Service_Impl("http://test1:6118/ABCAuthorizationService/ABCAuthorizationServiceProxyService?WSDL"

With the above code, the service client works fine and no issue. I could invoke the operations. But for the other service which imports schema, I am getting 401 error if i use the same code as above. The reason i notice is the authentication details i give is used to retrieve the WSDL only. For retrieving the schema import, again it expects username and password. How can i pass the username/pw to retrieve the schema? Is there some kind of cache where i can store the username/pw which will be used in subsequent requests or any other way to send authentication details?

The code snippet of proxy wsdl which refers the xmlschema from resource folder is as below.

<s2:import namespace="" schemaLocation="http://test1:6118/ABCAuthorizationService/ABCAuthorizationServiceProxyService?SCHEMA%2FABCAuthorizationService%2FResource%2FXMLSchema" />

Below is the exception i get in eclipse.

Exception in thread "Main Thread" javax.xml.rpc.ServiceException: Failed to parse WSDL http://test1:6118/ABCAuthorizationService/ABCAuthorizationServiceProxyService?WSDL weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- Server returned HTTP response code: 401 for URL: http://TEST1:6118/ABCAuthorizationService/ABCAuthorizationServiceProxyService?SCHEMA%2FABCAuthorizationService%2FResource%2FXMLSchema

Please correct me if my understanding is wrong.

Thanks in advance for your reply.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!