2

I have the following HTTP outbound gateway.

<int-http:outbound-gateway id="myWs"
    request-channel="requests"
    url="http://localhost/test"
    http-method="POST"
    charset="UTF-8"
    reply-timeout="1234"/>

I want to add the SAOPAction to the HTTP header. How can I do that? Using the an Outbound Web Service Gateway is not an option for me, because my SOAP Envelope is not a standard SOAP envelope.

1 Answer 1

2

Use a header enricher and a custom header-mapper ...

<int:chain input-channel="requestChannel">
    <int:header-enricher>
        <int:header name="SOAPAction" value="http:/foo/bar" />
    </int:header-enricher>
    <int-http:outbound-gateway
                            header-mapper="mapper"
                            url="http://localhost:18080/http/receiveGateway"
                            http-method="POST"
                            expected-response-type="java.lang.String"/>
</int:chain>

<bean id="mapper" class="org.springframework.integration.http.support.DefaultHttpHeaderMapper">
    <property name="userDefinedHeaderPrefix" value=""/> <!-- remove the default X- prefix -->
    <property name="outboundHeaderNames" value="SOAPAction" />
</bean>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.