Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Vamsi Jaya prasad
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic