[JBossWS] - Re: Java Client Application using Stub with WS-Security
by method_ben
I tried your suggestion :
package com.main;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import javax.naming.NamingException;
import javax.xml.namespace.QName;
import javax.xml.rpc.Stub;
import org.jboss.ws.core.StubExt;
import com.client.*;
public class MainTest {
public static void main(String[] args) throws MalformedURLException, NamingException
{
System.setProperty("org.jboss.ws.wsse.keyStore", "etc/wsse.keystore");
System.setProperty("org.jboss.ws.wsse.trustStore", "etc/wsse.truststore");
System.setProperty("org.jboss.ws.wsse.keyStorePassword", "mypass");
System.setProperty("org.jboss.ws.wsse.trustStorePassword", "mypass");
System.setProperty("org.jboss.ws.wsse.keyStoreType", "jks");
System.setProperty("org.jboss.ws.wsse.trustStoreType", "jks");
URL url = new URL("http://127.0.0.1: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 !
}
}
jboss-wwse-client.xml :
<?xml version="1.0" encoding="UTF-8"?>
<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
</jboss-ws-security>
Generate my keystore and my truststore with this command line :
keytool -genkey -alias wsse -keyalg RSA -keypass mypass -storepass mypass -keystore c:/wsse.keystore
keytool -export -alias wsse -storepass mypass -file c:/server.cer -keystore c:/wsse.keystore
keytool -import -v -trustcacerts -alias wsse -file c:/server.cer -keystore c:/wsse.truststore -keypass mypass -storepass mypass
and I still get this error :
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:35)
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
server.log (jboss_folder/server/default/log):
2007-11-29 09:20:58,342 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] handleWSDLRequest: jboss.ws:context=test,endpoint=Test
2007-11-29 09:20:58,342 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] WSDL request, using host: 127.0.0.1
2007-11-29 09:20:58,451 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] handleWSDLRequest: jboss.ws:context=test,endpoint=Test
2007-11-29 09:20:58,451 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] WSDL request, using host: 127.0.0.1
2007-11-29 09:20:58,545 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] handleWSDLRequest: jboss.ws:context=test,endpoint=Test
2007-11-29 09:20:58,545 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] WSDL request, using host: 127.0.0.1
My setup :
jboss-4.2.2.GA
jbossws-2.0.2.GA
JDK 6 update 3
Thank you very much for your help !
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108888#4108888
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108888
18 years, 5 months
[JBoss jBPM] - deploying jbpm 3.2.2 process archive in jboss 4.2.x
by vishal423
hi,
I am new to ant as well as to jbpm.
i am using jboss 4.2.2GA with Mysql 5.0.45.
While deploying process archive using ant script i am getting following error:
"couldn't deploy process archives : hibernate.cfg.xml not found".
My build.xml file is
| <?xml version="1.0" encoding="UTF-8"?>
| <project name="DeployTest" default="deploy.par" basedir="." >
| <property name="librarydir" value="${basedir}/lib" />
| <path id="libraries" >
| <fileset dir="${librarydir}" >
| <include name="*.jar" />
| </fileset>
| </path>
|
| <target name="deploy.par" >
| <taskdef name="deploypar" classname="org.jbpm.ant.DeployProcessTask">
| <classpath refid="libraries" />
| </taskdef>
| <deploypar process="build/Test.par" jbpmcfg="${basedir}/bin/jbpm.cfg.xml" />
| </target>
| </project>
|
Where *.jars refer to all required jar files. I am not getting where to specify path of hibernate.cfg.xml file.
Syntax in user guide is outdated. Earlier using cfg attribute we can specify our hibernate.cfg.xml file, but now its replaced with jbpmcfg.
Please reply, since its very very urgent for me.
any suggestions welcomed.
Regards,
vishal
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108880#4108880
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108880
18 years, 5 months