-
1. Re: Looking for example code
acxsjones Aug 22, 2005 12:20 PM (in response to acxsjones)Any help out there
-
2. Re: Looking for example code
thomas.diesler Aug 25, 2005 5:45 PM (in response to acxsjones)tdiesler@satellite /cygdrive/d/projects/jboss-branch/jboss-4.0.x/testsuite $ ant -Dtest=org.jboss.test.webservice.handlerflow.HandlerFlowTestCase one-test one-test: [junit] Running org.jboss.test.webservice.handlerflow.HandlerFlowTestCase [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.512 sec
-
3. Re: Looking for example code
acxsjones Aug 25, 2005 10:45 PM (in response to acxsjones)OK I am lost:
The example you pointed me to is calling an EJB.
I have a test client that was built from the wsdl of an ejb under 4.0.2 with wscompile.
I can talk to the ejb via soap xml and the wsdl with no problem. I can not find any way to add a soap header to the classes already generate from wscompile.
So I need an example of a j2se client that calls a webserice with a soap header.
I have been able to attach a handler to the server side, but my client is not running under a container.
Thanks for any help you can give. -
4. Re: Looking for example code
thomas.diesler Aug 26, 2005 3:40 AM (in response to acxsjones)With J2EE-1.4 compliant WS clients, you add the handler to the service-ref element, like this
<enterprise-beans> <session> <ejb-name>HelloEjb</ejb-name> <home>org.jboss.test.webservice.handlerflow.HelloHome</home> <remote>org.jboss.test.webservice.handlerflow.HelloRemote</remote> <ejb-class>org.jboss.test.webservice.handlerflow.HelloBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <service-ref> <service-ref-name>service/HelloService</service-ref-name> <service-interface>javax.xml.rpc.Service</service-interface> <wsdl-file>META-INF/wsdl/HelloService.wsdl</wsdl-file> <jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file> <handler> <handler-name>ClientHandler1</handler-name> <handler-class>org.jboss.test.webservice.handlerflow.ClientHandler1</handler-class> <soap-header>impl:HelloHeader</soap-header> </handler> <handler> <handler-name>ClientHandler2</handler-name> <handler-class>org.jboss.test.webservice.handlerflow.ClientHandler2</handler-class> <soap-header>impl:HelloHeader</soap-header> </handler> </service-ref> </session> </enterprise-beans>
There is no portable API that allows you to do that in WS4EE. Access to HandlerRegistry is not allowed. -
5. Re: Looking for example code
thomas.diesler Aug 26, 2005 3:42 AM (in response to acxsjones)In case you don't know how to do this for a standalone java client, have a look at application-client.xml.
-
6. Re: Looking for example code
zozilla Aug 31, 2005 9:32 PM (in response to acxsjones)acxsjones, i met the same question you've met.
in a standalone client, i wroteString namespaceURI = ".."; List<HandlerInfo> list = new ArrayList<HandlerInfo>(); HandlerInfo hi = new HandlerInfo(); hi.setHandlerClass(MyClientHandler.class); list.add(hi); service.getHandlerRegistry().setHandlerChain( new QName(namespaceURI, "WSEEDemoEndpointPort"), list);
it throws such exception, it seems should be work, but it throws such excpetionjava.lang.UnsupportedOperationException: Components should not use the getHandlerRegistry() method
can anybody help me? -
7. Re: Looking for example code
acxsjones Sep 1, 2005 2:08 PM (in response to acxsjones)This is a site that I found a good "client" example that use wscompile to get the client handler in chain.
http://java.sun.com/webservices/docs/1.3/tutorial/doc/JAXRPC7.html