File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes How to enable cached authentication details..?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to enable cached authentication details..??" Watch "How to enable cached authentication details..??" New topic
Author

How to enable cached authentication details..??

Kuppusamy Venkatasubramanian
Ranch Hand

Joined: Dec 30, 2004
Posts: 91
Hi,

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();
httpInfo.setUsername(username.getBytes());
httpInfo.setPassword(pwd.getBytes());
ABCServiceSoap_Service service = new ABCServiceSoap_Service_Impl("http://test1:6118/ABCAuthorizationService/ABCAuthorizationServiceProxyService?WSDL"
,httpInfo);

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="http://www.w3.org/2001/XMLSchema" 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 -- java.io.IOException: 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.

SAMY..

SCJP1.4, SCBCD 1.3, SCWCD 1.4, SCEA 5, JLPT-N3
My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to enable cached authentication details..??