• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

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

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic