-
1. Re: Web Service communication using certificates
marco_sap_86 Nov 19, 2012 6:31 PM (in response to marco_sap_86)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");
if(securityURL!=null){
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