2
votes

I have the below use case.

  1. Request is received by the ws-inbound gateway of service1.
  2. Service1 Passes the request to another ws-outbound gateway service2
  3. Service2 ws inbound gateway has an interceptor configured, which adds a custom soap header to the response
  4. the response from service 2 is passed to the output channel of service 1 (Final response).

I am able to see that soap header is added by printing the soap envelope in interceptor (service2), but it is not present in the final response. Any pointers to solve this issue will be helpful

1
Let us no if you really need SOAP model for the first service. Maybe just raw HTTP proxying would be enough for you? I mean <int-http:inbound-gateway> -> <int-http:outbound-gateway>. The second one will still be the WS Adapters pair. In addition, please, confirm that you see your header over the network. - Artem Bilan
Hi, Yes I need SOAP model for the first service also. Both the services are currently deployed in my local machine. - Anil Bhaskaran
OK. So, give me, please, a confirmation that your header travels over the network. It doesn't matter that your services are locally, your <int-ws:outbound-gateway> sends a request to some http://localhost:9999, so the network is involved and you can intercept that traffic with some tool. - Artem Bilan
Hi, I tried to intercept Service1 and added the response headers. This time It is working fine. But If it is added in Service2 and the response is passed to service1, it is not working - Anil Bhaskaran

1 Answers

1
votes

The <int-ws:outbound-gateway> uses DefaultSoapHeaderMapper by default. And its logic to populate source.getSoapAction(); and source.getSoapHeader();. But for that purpose you should configure mapped-reply-headers for your desired headers on the <int-ws:outbound-gateway>.