Doh!

Wrong client code...  This setHeader() is more appropriate...  

((Stub)binding).setHeader("biBusHeader", bibus, HeaderLifeCycle.REPLACE );

...it is a little ugly... comment's welcome!
Sylvain.


-----Original Message-----
From: St-Germain, Sylvain [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 02, 2002 10:41 AM
To: Axis-User (E-mail)
Subject: Axis - unofficial SOAP Header support...


Well, due to the overwhelming demand here is the patch...

It was generated from today's CVS.

There is a minor fix in there as well (JavaStubWriter.java) that forces
WSDL2Java (using -a) to define the mapping for all types even when not
directly referred to in the WSDL.

Do not hesitate to send me any comment, I still want it in the main Axis
stream but am currently lacking some time to finalize it.  I simplified the
implementation, but it is still lacking proper exception handling.

Attached are the patch and the new files. 
Here is how I use it...

            // Set-up the soap header with credential.  If successful the 
            // response's header, will contains a passport. 
            BiBusHeader bibus = new BiBusHeader();
            HdrSession  hdrs  = new HdrSession();

            CAM         cam   = new CAM();              

            cam.setAction(ActionEnum.logon);

            hdrs.setCredentials(...);

            bibus.setCAM(cam);
            bibus.setHdrSession(hdrs);

            // The object "biBus" will be serialized as a SOAP Header, 
            // the response version of the object will REPLACE the 
            // the cache instance in order that successive request
            // use the response's version, avoiding (in this case)
            // the server to have to login every time.

            si.binding.setHeader("biBusHeader", bibus,
HeaderLifeCycle.REPLACE );
            // At this point, the biBus object contains the credential
            si.doQuery("/content/*");
            // From now on, the biBus object contains the user's passport
            si.doQuery("/content/myFolder/*");

I built it this morning but did not have the chance to test it yet.
Let me know how it goes.

--
Sylvain St-Germain                   (613) 738.1338 x5250
Macadamian Technologies  @ Cognos    [EMAIL PROTECTED]

                         "Software experts to the 
                  world's leading technology companies"

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.
    


This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

Reply via email to