Skip to main content

JAX-RPC2 and SOAPAction HTTP header

4 replies [Last post]
tim_walls
Offline
Joined: 2004-07-05

Hi all,

Apologies if this is the wrong forum for this, and also apologies if this is a stupid question - I'm new to this SOAP lark :*). I haven't found an answer after much searching though so I thought I'd ask!

I'm trying to use JAX-RPC2 to communicate with a SOAP service, but I'm running into problems because the SOAPAction HTTP header isn't being sent. (The service is running on Microsoft, & is apparently strict about receiving the header.)

The WSDL correctly defines what should be sent, and the stub code generated by wscompile includes the following:

_setProperty("SOAPAction", "http://example.service.com/theaction");
_delegate.send(messageStruct);

Regardless, when the message is sent the SOAPAction header is an empty string.

Is there any way to convince JAX-RPC2 that it should send the SOAPAction header, or alternatively is there a "correct" way for me to bolt some sort of hook in (in the handler chain?) which would add the header at the SAAJ level?

[And if there isn't a way, can I put this in as a suggestion for a feature :*).]

Thanks in advance,
Tim.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bbissett
Offline
Joined: 2003-06-16

Hi Tim,

It was a bug in the EA release. The stub property
was hard-coded in a few places rather than relying
on BindingProvider.SOAPACTION_URI_PROPERTY.

Also, it seemed to be using two different values in
some places, so the generated code is also in error.
This will be fixed in the next release.

In the meantime, there is a workaround that you can
use. After getting your stub, set the property with
the following property name and it will be picked up
and added to the SOAPAction header:

myStub._setProperty("http.soap.action",
"http://example.service.com/theaction");

Cheers,
Bobby

tim_walls
Offline
Joined: 2004-07-05

Thanks Bobby,

I'm reassured it wasn't just me being stupid anyway :-). Thanks very much for the workaround, much appreciated.

Kind regards,
Tim.

kohlert
Offline
Joined: 2003-06-16

Tim,
It looks like you might have found a bug. Let me look into
it and I will get back to you.

tim_walls
Offline
Joined: 2004-07-05

Thanks very much, much appreciated!

Cheers,
Tim.