Wednesday, December 14, 2011

How add a SOAPAction to the HTTP header of the outgoing request

WSO2 ESB will be used in order to demonstrate this.

Download WSO2 ESB and start the server.

Create a new proxy (Custom proxy) and paste the following configuration. The Header mediator will be used in this proxy.

<proxy xmlns="" name="test4" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
         <log />
         <header name="Action" value="foo" />
               <address uri="http://localhost:6060" />
Setting the header mediator in the design view

Setting the send mediator in the design view

In send mediator an Address Endpoint is used to define the url of the service. tcpmon is configured to listen to 6060 port http://localhost:6060.

Following is the output which is given from tcpmon - for soap 1.1

Content-Type: text/xml; charset=UTF-8
Accept-Encoding: gzip,deflate
SOAPAction: "foo"
Transfer-Encoding: chunked

Following is the output which is given from tcpmon - for soap 1.2

Content-Type: application/soap+xml; charset=UTF-8; action="foo"
Accept-Encoding: gzip,deflate
Transfer-Encoding: chunked

According to [1] this is the expected output. The SOAP 1.1 mandatory SOAPAction HTTP header has been removed in SOAP 1.2.


No comments:

Post a Comment