[jboss-user] [JBossWS] - Java Client Application using Stub with WS-Security
method_ben
do-not-reply at jboss.com
Wed Nov 28 16:21:02 EST 2007
I have some problems to call methods from my web service. I use WS-Security to secure my web service. All necessary files (jboss-wsse-server.xml,jboss-wsse-client.xml, wsse.keystore, wsse.truststore) are in my WAR file.
My stubs are generated by wsconsume.
I have made a java application where I put my stub generated stub. This application is not deployed in JBoss. It's a simple java application with a "main".
Main.java :
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import javax.naming.NamingException;
import javax.xml.namespace.QName;
import org.jboss.ws.core.StubExt;
import com.client.*;
public static void main(String[] args) throws MalformedURLException, NamingException
{
URL url = new URL("http://localhost:8080/test/Test?wsdl");
QName qName = new QName("rrr", "TestService");
TestService service = new TestService(url,qName);
Test ws = service.getPort(Test.class);
((StubExt) ws).setSecurityConfig(new File("etc/jboss-wsse-client.xml").toURI().toURL().toExternalForm());
((StubExt) ws).setConfigName("Standard WSSecurity Client");
ws.hello("Benoit"); // doesnt work !
}
When I execute it, I get that :
Exception in thread "main" javax.xml.ws.WebServiceException: org.jboss.ws.core.CommonSOAPFaultException: An internal WS-Security error occurred. See log for details
at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.processHandlerFailure(HandlerChainExecutor.java:276)
at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:155)
at org.jboss.ws.core.jaxws.client.ClientImpl.callRequestHandlerChain(ClientImpl.java:160)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:297)
at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:243)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
at $Proxy14.hello(Unknown Source)
at com.main.MainTest.main(MainTest.java:51)
Caused by: org.jboss.ws.core.CommonSOAPFaultException: An internal WS-Security error occurred. See log for details
at org.jboss.ws.extensions.security.WSSecurityDispatcher.convertToFault(WSSecurityDispatcher.java:105)
at org.jboss.ws.extensions.security.WSSecurityDispatcher.handleOutbound(WSSecurityDispatcher.java:314)
at org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleOutboundSecurity(WSSecurityHandler.java:95)
at org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient.handleOutbound(WSSecurityHandlerClient.java:45)
at org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:295)
at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:140)
... 7 more
Anyone knows how I can resolve my problem ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108685#4108685
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108685
More information about the jboss-user
mailing list