You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Daniel Jemiolo <da...@us.ibm.com> on 2006/05/25 22:29:43 UTC

[Axis2] ServiceClient - empty SOAP headers

Hi,

I'm trying to use Axis2's ServiceClient.sendReceive() method, and it seems 
to be ignoring the Options that I specify. I've looked through the code 
and figure out what step I'm missing - I've gotten all the way to 
InOutAxisOperationClient and it seems as though the Options object *is* 
used (plus, other people are using it successfully, which means it must be 
me  :)  ).

My code looks like this:


        Options options = new Options();
        options.setExceptionToBeThrownOnSOAPFault(false);
        options.setAction(action.toString());
 
        EndpointReference toEPR = ...
        EndpointReference fromEPR = ...
 
        options.setTo(toEPR);
        options.setFrom(fromEPR);

        OMElement body = ...

        ServiceClient client = new ServiceClient();
        client.setOptions(options);

        OMElement result = client.sendReceive(body);


The resulting SOAP envelope has an empty soapenv:Header element - none of 
the WS-Addressing headers specified in the Options object are present. 
I've tried using setOverrideOptions() and addHeader(), but neither of 
these changes the behavior. Through all of this, the soapenv:Body is 
correct.

Has anyone else experienced a blank set of SOAP headers when trying to use 
ServiceClient.sendReceive()?

Dan


Dan Jemiolo
IBM Corporation
Research Triangle Park, NC


+++ I'm an engineer. I make slides that people can't read. Sometimes I eat 
donuts. +++


Re: [Axis2] ServiceClient - empty SOAP headers

Posted by Brian De Pradine <PR...@uk.ibm.com>.
Hello,

It sounds like you haven't engaged the Addressing module in your client. 
See the EchoNonBlockingDualClient example in the Axis2 User's Guide for 
details on how to do this. 

Cheers

Brian DePradine
Web Services Development
IBM Hursley
External  +44 (0) 1962 816319         Internal 246319

If you can't find the time to do it right the first time, where will you 
find the time to do it again?


Daniel Jemiolo <da...@us.ibm.com> wrote on 25/05/2006 21:29:43:

> 
> Hi, 
> 
> I'm trying to use Axis2's ServiceClient.sendReceive() method, and it
> seems to be ignoring the Options that I specify. I've looked through
> the code and figure out what step I'm missing - I've gotten all the 
> way to InOutAxisOperationClient and it seems as though the Options 
> object *is* used (plus, other people are using it successfully, 
> which means it must be me  :)  ). 
> 
> My code looks like this: 
> 
> 
>         Options options = new Options(); 
>         options.setExceptionToBeThrownOnSOAPFault(false); 
>         options.setAction(action.toString()); 
> 
>         EndpointReference toEPR = ... 
>         EndpointReference fromEPR = ... 
> 
>         options.setTo(toEPR); 
>         options.setFrom(fromEPR); 
> 
>         OMElement body = ... 
> 
>         ServiceClient client = new ServiceClient(); 
>         client.setOptions(options); 
> 
>         OMElement result = client.sendReceive(body);
> 
> 
> The resulting SOAP envelope has an empty soapenv:Header element - 
> none of the WS-Addressing headers specified in the Options object 
> are present. I've tried using setOverrideOptions() and addHeader(), 
> but neither of these changes the behavior. Through all of this, the 
> soapenv:Body is correct. 
> 
> Has anyone else experienced a blank set of SOAP headers when trying 
> to use ServiceClient.sendReceive()? 
> 
> Dan 
> 
> 
> Dan Jemiolo
> IBM Corporation
> Research Triangle Park, NC
> 
> 
> +++ I'm an engineer. I make slides that people can't read. Sometimes
> I eat donuts. +++