Results 1 to 7 of 7

Thread: http:outbound-gateway and custom http headers.

  1. #1
    Join Date
    Jun 2006
    Location
    Smithfield, RI
    Posts
    51

    Default http:outbound-gateway and custom http headers.

    Hi,

    We are using 2.0.1 version of http:outbound-gatway to make a webservice call to an external legacy application. They are not wsi-compliant so the SOAPAction and content types are not as per the standard.

    So we switched over to use http:outbound-gateway as xml over http. But when setting some custom http headers the gatway expects the parameter to begin with "X-". All other message header values are ignored, so we specifically set something like "mapped-request-headers='SOAP_Action, ABC, XYZ'", but still it is not getting to the http header.

    Below is the example code,

    Code:
     <http:outbound-gateway  url="http://external-soa-system:8020/soaapp/endpoint" http-method="POST" charset="UTF-8" request-channel="requestChannel" reply-channel="replyChannel" expected-response-type="java.lang.String" mapped-request-headers="SOAP_Action, ABC, XYZ">

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Are you saying that you *are* seeing the request header as "X-SOAP_Action"?

  3. #3
    Join Date
    Jun 2006
    Location
    Smithfield, RI
    Posts
    51

    Default

    Yes you are right, I am seeing as X-SOAP_Action.

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    The DefaultHttpHeaderMapper uses "X-" as a prefix (unless already present) for ALL headers that are not "standard" HTTP headers.

    You can provide a reference via the 'header-mapper' attribute *instead of* providing the 'mapped-request-headers'. Then, you could provide your own custom implementation - or possibly a modified version of the the DefaultHttpHeaderMapper.

    We could probably consider adding a boolean flag to the DefaultHttpHeaderMapper to disable the prefix, but it is a generally recognized practice to use "X-" for non-standard headers.

    Let me know if this gives you any ideas.

    Regards,
    Mark

  5. #5
    Join Date
    Jun 2006
    Location
    Smithfield, RI
    Posts
    51

    Default

    We did implemented our own HTTP Header Mapper and added custom headers. It would be neat if we can bypass and set them without "X-".

    Thanks for your quick response and Happy New Year !!!

  6. #6
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Feel free to open an issue in JIRA. If I understand correctly, it would be sufficient to have a boolean flag to disable the prefix, correct?

    Thanks and Happy New Year to you as well!
    -Mark

  7. #7
    Join Date
    Jun 2006
    Location
    Smithfield, RI
    Posts
    51

    Default

    Yes it is correct. We should be able to control that behaviour though a boolean setting.
    Below is the defect,
    https://jira.springsource.org/browse/INT-1722

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •