axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Rousell" <>
Subject How can I add an additional namespace to envelope from WSDL2Java client code
Date Wed, 23 Jun 2004 11:51:22 GMT

I'm still trying to get to grips with axis and have got completely
stuck. I have run WSDL2Java on a remote WSDL, successfully created
client code to make the call. 

However, the remote service requires the use of soap headers. I've
managed to add these okay by getting a stub object and using the
setHeader() method.

But, the request fails because the header section does not use the
correct namespace. Which has led me to think that I need to add the
required namespace to the opening envelope tag.

I've searched the wiki and this list but can't seem to find an answer. 

I create the service etc. like this:

    	// Use service interface to attache to serach locator service = new;
	// Now use the service to get a stub which implements the SDI. col = service.getSearchSoap();

	//prepare a stub for adding headers
	org.apache.axis.client.Stub s = (Stub) col;

I've tried using MessageContext.getMessage() but it fails. From what
I've read it seems as though this doesn't work with stub generated
client code.

When I manually edit the axis generated soap xml and try it in soapscope
it works, so I know it's to do with the missing namespace.

So, is there a way that anybody knows of getting hold of the envelope to
add another namespace?

Any help would be much appreciated as I'm totally stuck right now.



View raw message