1 Reply Latest reply on Nov 19, 2012 6:31 PM by Marco Sapienza

    Web Service communication using certificates

    Marco Sapienza Newbie

      Hello al, sorry for my bad english :-) . I create a web application with a web service. How can communicate with a web service client using certificate?.....I have installed JBoss AS 6.1.0 with jboss ws cxf.  thanks for the replies

        • 1. Re: Web Service communication using certificates
          Marco Sapienza Newbie

          I try to use a tutorial. I created keystore and truststore, for client and server. both client and server are web application, then i put keystore and truststore into WEB-INF folder.For the client, i created also jboss-wsse-client.xml and standard-jaxws-client-config.xml . For the server, create jboss-wsse-server.xml . The web service has the annotation :


          @EndpointConfig(configName = "Standard WSSecurity Endpoint")

          @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)


          Server side deploy is ok.


          The client side is(part of client):


          org.webservice.WebServiceJBOSS_Service service = new org.webservice.WebServiceJBOSS_Service();

                  org.webservice.WebServiceJBOSS port = service.getWebServiceJBOSSPort();

                  //URL jaxwsThatIsUsed = javax.xml.ws.Service.class.getProtectionDomain().getCodeSource().getLocation();

                  //System.out.println("JAXWS that is used: " + jaxwsThatIsUsed);

                  System.out.println("DIR CORR"+System.getProperty("user.dir"));

                  URL securityURL;

                  securityURL = new File("/Users/marcosapienza/NetBeansProjects/WebApplicationClientJBOSS/web/WEB-INF/jboss-wsse-client.xml").toURL();



                  ((StubExt)port).setConfigName("Standard WSSecurity Client","WEB-INF/wsrm-jaxws-client-config.xml");


                      System.out.println("FILE NON NULLO");


                          ((StubExt) port).setSecurityConfig(securityURL.toExternalForm());

                          ((StubExt) port).setConfigName("Standard WSSecurity Client","web/WEB-INF/standard-jaxws-client-config.xml");




          I get this error:  Exception in thread "main" java.lang.ClassCastException: $Proxy29 cannot be cast to org.jboss.ws.core.StubExt


          If i delete StubExt, web service client communicates with web service.


          someone has a suggestion. Thanks