-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I agree with Robert. You you custom class to create the appropriate header element as an OMElement and add it to the ServiceClient that is used inside the stub.
Stub stub = new AddressBookServiceStub(); OMElement header = <get the header from your custom class>; ServiceClient serviceClient = stub._getServiceClient(); serviceClient.addHeader(header) Best, Sanka robert lazarski wrote: > A simple solution in you case may be just > ServiceClient.addHeader(OMElement) . > > HTH, Robert > > On 11/27/06, *robert lazarski* < [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Forwarding with the correct prefix. > > Back in my axis 1.x days I did that type of thing. In axis2 try > ServiceClient --> AxisService, using that you can get access to > handler chains via AxisOperation. > > Do we have docs for client side handler chains? If not, Jatinder, > when you get this working you can help us with that if you'd like. > > HTH, Robert > > > ---------- Forwarded message ---------- From: *Jatinder Kaur* > <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > Date: > Nov 27, 2006 5:58 PM Subject: How to add custom SOAP Headers in > Client Code To: [email protected] > <mailto:[email protected]> > > Hi All, > > I am a newbie in this field -- so any help is greatly appreciated. > > I've a custom class file that implements javax.xml.rpc.Handler > class. In this custom class, I am setting the username and password > in the handleRequest method. The server returns a session ID back > that I am extracting in handleResponse method implementation. > > How can I link my custom class to the client code that I've > generated using Axis2. In Axis 1.4, I used something like this: > > java.util.List list = > service.getHandlerRegistry().getHandlerChain(new QName(" > http://xyz.com/webservices", "createResponse")); list.add(new > javax.xml.rpc.handler.HandlerInfo > (WebSessionHandler.class,null,null)); > > WebMarketingPort myProxy = (WebMarketingPort) service.getPort(new > QName("http://xyz.com/webservices", "createResponse"), > WebMarketingPort.class ); > > Since I don't have the Port classes in Axis2 ( I just have the stub > class), what is the best way to incorporate my custom class in the > client code. If you can please provide some code or point me to > some documentation, that would be great. > > Thanks, Jatinder > > - -- Sanka Samaranayake WSO2 Inc. http://sankas.blogspot.com/ http://www.wso2.net/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (GNU/Linux) iD8DBQFFa7SB/Hd0ETKdgNIRArz0AJ0WaTuYQbkVnuXmvN63H5imM+gUNwCeMS5T 4YksrgAtRqCPpRtyHC/ucpo= =a39J -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
