File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Urgent! (Very IMP) Implementing client on SSL in webservices!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Urgent! (Very IMP) Implementing client on SSL in webservices!!!" Watch "Urgent! (Very IMP) Implementing client on SSL in webservices!!!" New topic
Author

Urgent! (Very IMP) Implementing client on SSL in webservices!!!

Vamsi Jaya prasad
Greenhorn

Joined: Oct 28, 2002
Posts: 4
I am working on webservices. I am working on mutual atentication using SSL. I configured the SSL at server side. And i have written the below code in the client side to configure it for SSL. The code is.....
public static void main(String[] argv) throws Exception
{
// Setup the global JAXM message factory
System.setProperty("javax.xml.soap.MessageFactory", "weblogic.webservice.core.soap.MessageFactoryImpl");
// Setup the global JAX-RPC service factory
System.setProperty( "javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl");
System.setProperty("java.protocol.handler.pkgs", "weblogic.webservice.client");
SSLAdapterFactory adapterFactory = SSLAdapterFactory.getDefaultFactory();
WLSSLAdapter adapter = (WLSSLAdapter) adapterFactory.getSSLAdapter();
adapter.setStrictChecking(false);
adapter.setTrustedCertificatesFile("C:\\bea700\\weblogic700\\server\\lib\\cacerts");
adapterFactory.setDefaultAdapter(adapter);
adapterFactory.setUseDefaultAdapter(true);
HelloWorldEJB_Impl ws = new HelloWorldEJB_Impl(wsdlURL);
//System.out.println(ws.getWSDLDocumentLocation().toString());
HelloWorldEJBPort port = ws.getHelloWorldEJBPort("weblogic","weblogic");
String returnVal = port.sayHello("MY STRING");
System.out.println(returnVal);
}
But it is giving below exception
java.io.IOException: Write Channel Closed, possible SSL handshaking or trust failure at com.certicom.tls.record.WriteHandler.write(Unknown Source)at com.certicom.tls.interfaceimpl.TLSConnectionImpl.fireAlertSent(Unknown Source)at com.certicom.tls.record.handshake.HandshakeHandler.fireAlert(UnknownSource)at com.certicom.tls.record.handshake.HandshakeHandler.fireAlert(UnknownSource)at com.certicom.tls.record.handshake.HandshakeHandler.handleHandshakeMessage(Unknown Source)at com.certicom.tls.record.handshake.HandshakeHandler.handleHandshakeMessages(Unknown Source)at com.certicom.tls.record.ReadHandler.interpretContent(Unknown Source)at com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)at com.certicom.tls.record.ReadHandler.readUntilHandshakeComplete(Unknown Source)at com.certicom.tls.interfaceimpl.TLSConnectionImpl.completeHandshake(Unknown Source)at com.certicom.tls.record.WriteHandler.write(Unknown Source)at com.certicom.net.ssl.HttpsClient.doHandshake(Unknown Source)at com.certicom.net.ssl.internal.HttpURLConnection.getInputStream(Unknown Source)at weblogic.webservice.client.https.HttpsURLConnection.getInputStream(HttpsURLConnection.java:216)at weblogic.webservice.tools.wsdlp.DefinitionFactory.createDefinition(DefinitionFactory.java:71)at weblogic.webservice.tools.wsdlp.WSDLParser.<init>(WSDLParser.java:63)at weblogic.webservice.WebServiceFactory.createFromWSDL(WebServiceFactory.java:108)at weblogic.webservice.WebServiceFactory.createFromWSDL(WebServiceFactory.java:84)at weblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:73)at examples.webservices.basic.statelessSession.HelloWorldEJB_Impl.<init>HelloWorldEJB_Impl.java:23) at examples.webservices.basic.statelessSession.Client.main(Client.java:49)Exception in thread "main" weblogic.webservice.tools.wsdlp.WSDLParseException: Failed to retrieve WSDL from https://localhost:7002/basic_statelessSession/HelloWorldEJB?WSDL. Please check the URL and make sure that it is a valid XML file [java.io.IOException: Write Channel Closed, possible SSL handshaking or trust failu
re]
Can any body know about please let me know what is the wrong with the above code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Urgent! (Very IMP) Implementing client on SSL in webservices!!!