users@jax-rpc.java.net

Re: SOAP Headers

From: Edoardo Causarano <edoardocausarano_at_tin.it>
Date: Mon, 14 Nov 2005 03:23:34 +0100

Client side handlers are not a problem. I did manage to get them
working (a logging example) just to get the grips with it, and in any
case one can turn them on programmatically from the client code. What
I can't manage is to declaratively setup handlers on the server and I
really need them (I tried to dodge the problem dumping all methods in
the same SEI and going with http sessions but the thing is getting
way out of hand now). Following instructions I found on the JAX-RPC
site and (I think) the JWSDP tutorial, I put this in the wscompile
config for the server task:

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<wsdl location="JWSDP-Service.wsdl" packageName="com.example.jwsdp">
</wsdl>
         <handlerChains>
             <chain runAt="server">
                 <handler
className="com.example.jwsdp.handlers.Example"/>
             </chain>
         </handlerChains>
</configuration>

where the given class just logs init and process requests to log4j
(as a starter, I thought) and isn't bound to any known SOAP Header
(will return an empty array). Nothing came out of it so I put the
directive in the jaxrpc-ri.xml descriptor just in case:

<?xml version="1.0" encoding="UTF-8"?>

<webServices targetNamespaceBase="http://example.com"
     typeNamespaceBase="http://example.com/types/"
     urlPatternBase="/icode" version="1.0"
     xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/dd">
     <endpoint description="Server interaction Web Service"
         displayName="Server Manager"
         implementation="com.example.jwsdp.ServerPortImpl"
         interface="com.example.jwsdp.ServerPort"
         model="/WEB-INF/model-wsdl-doclit.xml.gz" name="ServerPort"
         wsdl="/WEB-INF/JWSDP-Service.wsdl">

         <handlerChains>
                 <chain runAt="server">
                         <handler className="com.example.jwsdp.handlers.Example" />
             </chain>
         </handlerChains>
     </endpoint>
     <endpointMapping endpointName="ServerPort" urlPattern="/server"/>
</webServices>

but still had no success. Since I use Eclipse and write the xml
descriptors by hand I reached out and downloaded NetBeans hoping it
would generate a valid file I could template on; unfortunately the
files are only good for a full blown application server while I use a
simpler Tomcat container and bundled WAR (my web service is not a
SOAP wrapper to a EJB backend).

AXIS will fail on java artifact creation and attachment handling
while Sun RI won't do Handlers (mind, handlers were a breeze on
Axis). Currently, I have no way to implement my web service on a Java
based tech. If anyone has ever successfully made a server side
handler chain on a simple servlet container platform (no AS) please
post a working example, I'd appreciate it.

e

-- 
A baby seal walks into a club...
Il giorno 10/nov/05, alle ore 19:50GMT+01:00, Bobby Bissett -  
Javasoft ha scritto:
> Edoardo Causarano wrote On 11/10/05 06:44,:
>> Can anyone point me to a working, complete with requirements, example
>> of SOAP Header processing in jax-rpc RI?
>> I've been trying unsuccessfully to get a simple handler filter to log
>> "hello world" on message retrieval and nothing ever happens.
>> I'd like to get handlers and headers to work, please.
>
> I don't have a full example of jaxrpc using handlers (though there are
> handler samples in the JAX-WS 2.0 bundles), but the AttachmentsSample
> example in the jwsdp uses a handler on the client side. The latest  
> jwsdp
> can be found here:
> http://java.sun.com/webservices/downloads/webservicespack.html.
>
> To add a handler to your service, you can add the <handlerChains>
> element to your config-server.xml following the example in
> AttachmentsSample/etc/config-client.xml. Just change <chain
> runAt="client"> to <chain runAt="server"> and, of course, specify the
> class name of the handler you're using.
>
> If you're trying to specify the handler a different way, let me know
> what you're seeing when you build the service. From the above, it  
> sounds
> like you're saying that the handler is not being invoked.
>
> Cheers,
> Bobby
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>