[JBossWS] - Dispatch + wssecurity
by fonseca
Hi,
I'm having a bit of trouble figuring this out - I'm trying to create a simple standalone dispatch for communication with an already set up webservice. I got everything working as expected if I use no security system - the problem arises when trying to invoke a request message involving an WSSecurityHandlerClient, resulting in a:
| javax.xml.ws.soap.SOAPFaultException: org.jboss.ws.core.CommonSOAPFaultException: This service requires <wsse:Security>, which is missing.
| at org.jboss.ws.core.jaxws.client.DispatchSOAPBinding.getReturnObject(DispatchSOAPBinding.java:165)
| at org.jboss.ws.core.jaxws.client.DispatchImpl.getReturnObject(DispatchImpl.java:290)
| at org.jboss.ws.core.jaxws.client.DispatchImpl.invokeInternal(DispatchImpl.java:141)
| at org.jboss.ws.core.jaxws.client.DispatchImpl.invoke(DispatchImpl.java:102)
|
The server looks all good, and is expecting security information (encryption) which for some reason the client isn't sending.
In my client, I have:
| ...
| System.setProperty("org.jboss.ws.wsse.keyStore", [...]);
| System.setProperty("org.jboss.ws.wsse.keyStorePassword", [...]);
| System.setProperty("org.jboss.ws.wsse.trustStore", [...]);
| System.setProperty("org.jboss.ws.wsse.trustStorePassword", [...]);
|
| URL serverURL = new URL(store.getString(PreferenceConstants.SERVER_URL));
| URL serviceURL = new URL(serverURL, "services/testService");
|
| service = new TestService(TestClient.class.getClassLoader().getResource("META-INF/TestService.wsdl"), new QName(namespace, "TestService"));
| port = service.getTestPort();
|
| BindingProvider bindingProvider = (BindingProvider) port;
| List<Handler> handlerChain = new ArrayList<Handler>();
| handlerChain.add(new WSSecurityHandlerClient());
| bindingProvider.getBinding().setHandlerChain(handlerChain);
|
| Map<String, Object> reqContext = bindingProvider.getRequestContext();
| reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.toString());
| reqContext.put(BindingProvider.USERNAME_PROPERTY, SecurityService.instance().getID());
| reqContext.put(BindingProvider.PASSWORD_PROPERTY, "");
|
|
| dispatch = service.createDispatch(new QName(namespace, "TestPort"), StreamSource.class, Mode.PAYLOAD);
| dispatch.getBinding().setHandlerChain(handlerChain);
|
| StreamSource response = dispatch.invoke(new StreamSource(new StringReader(request))); //request is a simple payload string
|
META-INF/jboss-wsse-client.xml
| <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">
|
| <config>
| <username/>
| <encrypt type="x509v3" alias="key"/>
| <requires>
| <encryption/>
| </requires>
| </config>
| </jboss-ws-security>
|
META-INF/standard-jaxws-client-config.xml
| <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>
|
Am I wrong to assume dispatch.invoke is responsible for appending the security tags in my message?
Any help is appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084199#4084199
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084199
18 years, 9 months
[Beginners Corner] - help! stuck with redhat developer studio beta 1 and ejb3 on
by wiggy
Bit of a long shot - cant find a topic for redhat developer beta feedback - logged in at redhat and registered and cant any fora other than the jboss ones in a lloop again.
problem: i'm running jboss AS4.2 in the redhat developer download bundle.
I create a seam project which sets up a project with an EAR 5.0 facet.
fails immediately as it says ear 5 not supported on jbossAS 4.2 - despite this being the deployed AS it sets up with.
eclipse suggests as quick fix to setup a new runtime - I am guessing it wants an jboss 5 server config.
cant find any such adapter from eclipse with the dowanload new adapters.
what the heck is one supposed to do here .
does any one know who to get a jboss 5 server adapter? when i've tried using a jboss 4.2 adapter and point at jboss 5 install- the server fails to start
stuck
any one got any good ideas how to proceed?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084198#4084198
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084198
18 years, 9 months
[JBossWS] - Unable to load Provider: Failed to load javax.xml.ws.spi.Pro
by sselvia
Using the wsrunclient and I'm having the following problem:
wsrunclient com.datamentors.web.DMWebClient
javax.xml.ws.WebServiceException: Unable to load Provider: Failed to load javax.xml.ws.spi.Provider: org.jboss.ws.core.jaxws.spi.ProviderImpl
at javax.xml.ws.spi.Provider.provider(Provider.java:98)
at javax.xml.ws.Service.(Service.java:83)
at com.datamentors.web.jboss.DMWebService.(DMWebService.java:40)
at com.datamentors.web.DMWebClient.processJBoss421JAXWSRequest(DMWebClient.java:103)
at com.datamentors.web.DMWebClient.main(DMWebClient.java:131)
Caused by: java.lang.IllegalStateException: Failed to load javax.xml.ws.spi.Provider: org.jboss.ws.core.jaxws.spi.ProviderImpl
at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:96)
at javax.xml.ws.spi.Provider.provider(Provider.java:90)
... 4 more
Caused by: java.lang.NoClassDefFoundError: org/jboss/util/NotImplementedException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:91)
... 5 more
What jar is missing from the wsrunclient classpath???
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084194#4084194
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084194
18 years, 9 months
[JBossWS] - Re: change in run-time the soap:address location of wsdl.
by drblmb
I don't understand how to do this. Using JBossWS 2.0.1GA - and still can't figure out how to override the end point address. What Stub?
Let's suppose you are running in production, and have a web service running at 1,000 different locations (IP Addresses). You don't want the overhead of having to go pull down the WSDL everytime you get the port, so you statically link with a .WSDL file stored locally. The problem, however, is that the soap:address location is statically defined in the WSDL. So - how does your JBossWS client change the endpoint address (NOT THE WSDL LOCATION) after getting the web service port?
Example: I have the same web service running at x.x.x.A and at x.x.x.B. So I get the port, and I want to send the same SOAP Request to both servers - why even get the port twice? Just send it to x.x.x.A (assuming that is where the WSDL is pointing to), and then change the endpoint address to x.x.x.B, and using the same port, call the same method again and it should go to x.x.x.B.
This is what we need to do - does anyone know how to do this? And yes, I know that you can override the WSDL location in the constructor - that isn't what I need to do here. I have been working on this for several days without success.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084183#4084183
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084183
18 years, 9 months
[JBossWS] - Re: Client Discovery of Service Endpoint in Production Envir
by drblmb
I do understand the question. My question is pretty much the same:
Let's suppose you are running in production, and have a web service running at 1,000 different locations (IP Addresses). You don't want the overhead of having to go pull down the WSDL everytime you get the port, so you statically link with a .WSDL file stored locally. The problem, however, is that the soap:address location is statically defined in the WSDL. So - how does your JBossWS client change the endpoint address (NOT THE WSDL LOCATION) after getting the web service port?
Example: I have the same web service running at x.x.x.A and at x.x.x.B. So I get the port, and I want to send the same SOAP Request to both servers - why even get the port twice? Just send it to x.x.x.A (assuming that is where the WSDL is pointing to), and then change the endpoint address to x.x.x.B, and using the same port, call the same method again and it should go to x.x.x.B.
This is what we need to do - does anyone know how to do this? And yes, I know that you can override the WSDL location in the constructor - that isn't what I need to do here. I have been working on this for several days without success.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084179#4084179
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084179
18 years, 9 months