[JBossWS] - Re: Unable to create a WSClient that uses jboss-wsse-client.
by PeterJ
I also see that the handler chain is missing for the client. Without that, the client doesn't know to apply the jboss-wsse-client.xml.
I was going to refer you to the documentation on how to do this, but noticed that there is nothing about it in the documentation. Perhaps I got it from the older documentation? No matter, add to your client a META-INF/standard-jaxws-client-config.xml file with these contents:
<?xml version="1.0" encoding="UTF-8"?>
|
| <!-- $Id: standard-jaxws-client-config.xml 2313 2007-02-09 10:02:09Z thomas.diesler(a)jboss.com $ -->
|
| <jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
| xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
|
|
| <client-config>
| <config-name>Standard WSSecurity Client</config-name>
| <post-handler-chains>
| <javaee:handler-chain>
| <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
| <javaee:handler>
| <javaee:handler-name>WSSecurityHandlerOutbound</javaee:handler-name>
| <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient</javaee:handler-class>
| </javaee:handler>
| </javaee:handler-chain>
| </post-handler-chains>
| </client-config>
|
| </jaxws-config>
The name is unimportant, the client code for JBossWS will pick up the first client-config in this file.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034127#4034127
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034127
17 years, 8 months
[JBossWS] - Re: Unable to create a WSClient that uses jboss-wsse-client.
by noclueu2
One more question that might answer my problem.
In the service code for user/password I add annotation:
@RolesAllowed("internal")
| and
| @SecurityDomain(value="JBossWS")
|
In the client to pass the user password, I had to add:
| BindingProvider bindingProvider = (BindingProvider) port;
| Map<String, Object> reqContext = bindingProvider.getRequestContext();
| reqContext.put(BindingProvider.USERNAME_PROPERTY, "myuser");
| reqContext.put(BindingProvider.PASSWORD_PROPERTY, "mypassword");
|
For signing/encryption I added this annotation to the service:
@HandlerChain(file="resource://config/ServerHandler.xml", name="SecureHandlerChain")
and added the the ServerHandler.xml and jboss-wsse-server.xml
To the client, I did nothing special to the code, just added the jboss-wsse-client.xml. Is there a bit of code I am not doing, that I should? If so, what is it?
Thanks Again,
Richard K
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034114#4034114
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034114
17 years, 8 months
[JBossWS] - Re: Unable to create a WSClient that uses jboss-wsse-client.
by noclueu2
I tried changing the config files to have encrypt in them with no succes. The serve continues to work but my client does not.
Here is the error message:
| javax.xml.ws.soap.SOAPFaultException: javax.xml.rpc.soap.SOAPFaultException: This service requires <wsse:Security>, which is missing.
| at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SOAPFaultHelperJAXWS.java:56)
| at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultException(SOAP11BindingJAXWS.java:111)
| at org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPBinding.java:460)
| at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:333)
| at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:185)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:163)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:149)
| at $Proxy8.pullFromHat(Unknown Source)
| at com.partminer.test.client.ClientTest.main(Unknown Source)
|
Here is the client request (Notice how there is no signing or encryption):
| POST /MagicService/TestMagicBean?datatype=SOAPMessage HTTP/1.1
| Authorization: Basic Y29ubmVjdGVzOnNlY3JldA==
| SOAPAction: ""
| Content-Type: text/xml; charset=UTF-8
| User-Agent: Java/1.5.0_11
| Host: localhost:8080
| Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
| Connection: keep-alive
| Content-Length: 245
|
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns1:PullFromHat xmlns:ns1='http://com.test.www/test/jsr181ejb'><arg0>Java Client Test</arg0></ns1:PullFromHat></env:Body></env:Envelope>
|
And the server response:
| HTTP/1.1 500 Internal Server Error
| Server: Apache-Coyote/1.1
| X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
| Content-Type: text/xml;charset=UTF-8
| Transfer-Encoding: chunked
| Date: Tue, 03 Apr 2007 14:31:45 GMT
| Connection: close
|
| bd
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><faultcode>env:Server
| c
| </faultcode>
| 72
| <faultstring>javax.xml.rpc.soap.SOAPFaultException: This service requires <wsse:Security>, which is missing.
| e
| </faultstring>
| c
| </env:Fault>
| 1a
| </env:Body></env:Envelope>
| 0
|
|
|
It seems the server is doing what is expected but the client is not.
Thanks,
Richard K
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034108#4034108
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034108
17 years, 8 months