1 Reply Latest reply on Jul 9, 2009 11:46 AM by daixitrum

    HttpRouter strips SOAPAction?

      I'm using the HttpRouter as a proxy for my existing WebService, but look like when ESB forward the http to the WebService, it strips out the SOAPAction and I got a soapfault 'no SOAPAction header!'.

      This is my jboss-esb.xml:

      <?xml version="1.0"?>
      <jbossesb parameterReloadSecs="5"
       xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd
      http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
       <providers>
       <jbr-provider host="192.168.2.167" name="MyHttpGateway" protocol="http">
       <jbr-bus busid="MyHttpGateway" port="7777"/>
       </jbr-provider>
       </providers>
       <services>
       <service category="MyCategory" description="MyDescription"
       invmScope="GLOBAL" name="MyHttpProxyService">
       <listeners>
       <jbr-listener busidref="MyHttpGateway" is-gateway="true" name="MyHttpGateway"/>
       </listeners>
       <actions mep="RequestResponse">
       <action class="org.jboss.soa.esb.actions.routing.http.HttpRouter" name="HttpRouter">
       <property name="endpointUrl" value="http://localhost:8880/shared-resource/services/DSM"/>
       <property name="method" value="POST"/>
       </action>
       <action class="org.jboss.soa.esb.actions.SystemPrintln" name="message">
       <property name="message" value="In the ESB"/>
       </action>
       </actions>
       </service>
       </services>
      </jbossesb>


      When I'm calling the real WebService using SOAPUI, this is what I see on my TCPmon:
      POST /ads-scs/services/DecisionSpaceManagement HTTP/1.1
      Content-Type: text/xml;charset=UTF-8
      SOAPAction: "DSMPortType#Login"
      User-Agent: Jakarta Commons-HttpClient/3.1
      Host: localhost:8880
      Content-Length: 510
      
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:dsmtypes:2:2">
       <soapenv:Header/>
       <soapenv:Body>
       <urn:LoginObject>
       <urn:UserID>userid</urn:UserID>
       <urn:Password>password</urn:Password>
       </urn:LoginObject>
       </soapenv:Body>
      </soapenv:Envelope>


      And when I call the WebService through the ESB, the ESB sends this to the WebService (The SOAPAction is missing!):
      POST /ads-scs/services/DecisionSpaceManagement HTTP/1.1
      Content-Type: text/xml;charset=UTF-8
      User-Agent: Jakarta Commons-HttpClient/3.0.1
      Host: localhost
      Content-Length: 510
      
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:dsmtypes:2:2">
       <soapenv:Header/>
       <soapenv:Body>
       <urn:LoginObject>
       <urn:UserID>userid</urn:UserID>
       <urn:Password>password</urn:Password>
       </urn:LoginObject>
       </soapenv:Body>
      </soapenv:Envelope>


      with return message:
      HTTP/1.1 500 Internal Server Error
      Server: Apache-Coyote/1.1
      X-Powered-By: Servlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)/Tomcat-5.5
      Content-Type: text/xml;charset=utf-8
      Transfer-Encoding: chunked
      Date: Wed, 08 Jul 2009 21:50:37 GMT
      Connection: close
      
      225
      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope
       xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
       <soapenv:Fault>
       <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
       <faultstring>no SOAPAction header!</faultstring>
       <detail>
       <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">kpham</ns2:hostname>
       </detail>
       </soapenv:Fault>
       </soapenv:Body>
      </soapenv:Envelope>
      0

      Am I missing something in the jboss-esb.xml or the HttpRouter is stripping out the SOAPAction?
      I'm using JBoss AS 4.2.2GA and JBoss ESB 4.4GA
      Thanks in advanced.


        • 1. Re: HttpRouter strips SOAPAction?

          After looking at the source code for the HttpRouter class, I see that it's using the MappedHeaderList attribute to include any additional headers, so I added a property tag for MappedHeaderList under the HttpRouter action in my jboss-esb.xml as below.

          <action class="org.jboss.soa.esb.actions.routing.http.HttpRouter" name="HttpRouter">
           <property name="endpointUrl" value="http://localhost:8880/shared-resource/services/DSM"/>
           <property name="method" value="POST"/>
           <property name="MappedHeaderList" value="SOAPAction"/>
          </action>