[jboss-user] [JBoss Web Services] - building a WS Client with WS-Security
juan pablo
do-not-reply at jboss.com
Wed Jun 16 09:11:33 EDT 2010
juan pablo [http://community.jboss.org/people/jplistero] created the discussion
"building a WS Client with WS-Security"
To view the discussion, visit: http://community.jboss.org/message/548245#548245
--------------------------------------------------------------
Hi all,
I' am trying to build a web service client and sing the soap message.
I 'am using jbossws-cxf to generate the Stubs with wsconsume tool.
My first problem is to build the jboss-wsse-client.xml ...
I have my private key, my sing cert and the CA root for the server (I havent access to the server)
to build a keystore I use:
openssl pkcs12 -export -chain -in mySing.crt -CAfile root.cer -inkey myPrivate.key -out keystore.pkcs12
(I made a client with a soapui tool, and the keystore works fine)
so ... my jboss-wsse-client.xml:
*<jboss-ws-security xmlns=" http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/config"*
*xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"*
*xsi:schemaLocation=" http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/config*
* http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">*
*<config>*
*<sign type="x509v3" alias="1" />*
*<requires>*
*<signature />*
*</requires>*
*</config>*
*</jboss-ws-security>*
And in my Client, this is my code:
*System.setProperty("org.jboss.ws.wsse.keyStore","/home/jp/tmp/keystore.pkcs12");*
** *System.setProperty("org.jboss.ws.wsse.keyStorePassword", "12345");*
*System.setProperty("org.jboss.ws.wsse.keyStoreType", "pkcs");*
*SomeService service = new SomeService();
SomePort port = service.getPort();
URL securityURL = new File("/home/jp/workspace1/myProject/src/META-INF/jboss-wsse-client.xml").toURL();
((StubExt) port).setSecurityConfig(securityURL.toExternalForm());
((StubExt) port).setConfigName("Standard WSSecurity Client","/home/jp/workspace1****/myProject*/src/META-INF/jboss-wsse-client.xml");
also I add reference to jboss-AS-5.1/lib/endoresed and jboss-AS-5.1/client
Someone known what is Wrong ? the jboss-wsse-client.xml ? the Client ? the references jars ?
now I'am having this exception
******java.lang.reflect.UndeclaredThrowableException
*
*
*
*
*
*** *at $Proxy21.setConfigName(Unknown Source)*
** *at otroMain.Client.llamadoEstatica(Client.java:57)*
** *at otroMain.Client.main(Client.java:42)*
*Caused by: java.lang.reflect.InvocationTargetException*
** *at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)*
** *at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)*
** *at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)*
** *at java.lang.reflect.Method.invoke(Method.java:597)*
** *at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:111)*
** *... 3 more*
*Caused by: org.jboss.ws.WSException: Invalid config namespace: http://www.jboss.com/ws-security/config*
** *at org.jboss.ws.metadata.config.JBossWSConfigFactory.parse(JBossWSConfigFactory.java:94)*
** *at org.jboss.ws.metadata.config.JBossWSConfigFactory.getConfig(JBossWSConfigFactory.java:151)*
** *at org.jboss.ws.metadata.umdm.EndpointMetaData.initEndpointConfigMetaData(EndpointMetaData.java:923)*
** *at org.jboss.ws.metadata.umdm.EndpointMetaData.createEndpointConfigMetaData(EndpointMetaData.java:889)*
** *at org.jboss.ws.metadata.umdm.ClientEndpointMetaData.createEndpointConfigMetaData(ClientEndpointMetaData.java:83)*
** *at org.jboss.ws.metadata.umdm.FeatureAwareClientEndpointMetaDataAdapter.createEndpointConfigMetaData(FeatureAwareClientEndpointMetaDataAdapter.java:120)*
** *at org.jboss.ws.core.jaxws.client.ClientImpl.setConfigName(ClientImpl.java:492)*
thanks,
jp
*
*
*
*
*
*
*
*
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548245#548245]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100616/f6fa92bd/attachment-0001.html
More information about the jboss-user
mailing list