Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Axis 1.0 w/o SOAPAction HTTP Header?  RSS feed

 
Ken Pelletier
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Axis 1.0 requires that every inbound SOAP message over HTTP have a SOAPAction header. There seems to be quite a bit of disagreement about whether this ir correct, but it certainly breaks clients which do not send one.
Sending SOAPAction: "" is all that's needed to satisfy Axis.
Is there a way to configure Axis ( perhaps a handler in the request flow ) to add a SOAPAction header to the http request if it doesn't exist, prior to the request processing?
I added a servlet filter in front of the Axis servlet, but was stumped as to how to ADD the HTTP header to the request from within the filter. The *request* needs the SOAPAction header before it gets to Axis.
If I had a way to add a header to a request inside a filter, it'd be solved.
Any help?
 
Ken Pelletier
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, I no sooner pressed "Send" than I recalled how I can do it.
The Filter system lets you implement the Adapter pattern via request and response wrappers.
I just wrapped the request with a class of my own that overrides the relevant header methods in HttpServlerRequest.
Works like a champ.
Thanks for listening...
 
Florian LACOSTE
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm having the same problem. Do you have a sample of your code so i can see how it works ?

I vaguely tried a filter but I(m not sure it can works in my case. I'm trying to add the soapAction header on a request sent by chiba-web (from an XForms doc) to call a WS with Axis.

Thx
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!