8 Replies Latest reply on Jan 8, 2015 12:52 PM by moraleslos

    soapaction header

    moraleslos

      Hi,

       

      I'm running into an issue where the soapaction header is not being passed to a soap-based Web service.  The error message returned is this:

       

      <SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><faultcode xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">soap:Client</faultcode><faultstring>System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: .

       

      I would assume SY would automatically add the header since it was defined in the WSDL like this:

       

      <wsdl:binding name="StockQuoteSoap" type="tns:StockQuoteSoap">

          <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>

          <wsdl:operation name="GetQuote">

            <soap:operation soapAction="http://www.webserviceX.NET/GetQuote" style="document"/>

            <wsdl:input>

              <soap:body use="literal"/>

            </wsdl:input>

            <wsdl:output>

              <soap:body use="literal"/>

            </wsdl:output>

          </wsdl:operation>

        </wsdl:binding>

       

       

      So what I did was to explicitly add it via a post processor defined in the camel route like this:

       

      exchange.getOut().getHeaders().put("SOAPAction", "http://www.webserviceX.NET/GetQuote");

       

      That didn't work either.  Any ideas?

        • 1. Re: soapaction header
          mageshbk

          I think you might be hitting this issue:

           

          https://issues.jboss.org/browse/SWITCHYARD-2236

           

          Could you check with 2.0 alpha release to see if this solves your issue?

          1 of 1 people found this helpful
          • 2. Re: soapaction header
            jorgemoralespou_2

            Hi,

            I think that what you are missing is setting the header in the ContextMapper, so it can be copied and sent. Keep in mind that although you set up the header in Camel, the SOAPMessageCOmposer will not copy that header to the binding unless instructed.

            Try to add the header, or for a simple test, anything ".*" in the includes section of the ContextMapper for that outbound binding.

             

            I think that what Magesh suggest is more relevant to SOAP services and not for SOAP references.

            • 3. Re: soapaction header
              jorgemoralespou_2

              Hi, I might be wrong and fix SY-2236 fixes both sides (services and references) for copying the headers from/into the context. So, you'll have to use SY 2 and not SY 1.

              • 4. Re: soapaction header
                moraleslos

                I am using SY 2 Alpha 2

                • 5. Re: soapaction header
                  jorgemoralespou_2

                  Hi,

                  You should upgrade to 2.0.0.Beta1. The issue was solved in the meantime.

                  • 6. Re: soapaction header
                    moraleslos

                    I'm still getting the same issue.  Originally I thought I got passed this when I was hitting a 502: Bad Gateway error but doing this multiple times I get the same SOAPAction header error.  Keeping everything the same as mentioned above, I've added into the context mapper.  The SY config file now looks like this (changes in bold):

                     

                    <sca:reference name="StockQuoteSoap" multiplicity="0..1" promote="Route/StockQuoteSoap">

                          <sca:interface.wsdl interface="stockquote.wsdl#wsdl.porttype(StockQuoteSoap)"/>

                          <soap:binding.soap name="WeatherExternalSoap">

                            <soap:contextMapper includeNamespaces=".*" includes=".*" soapHeadersType="VALUE"/>

                            <soap:messageComposer unwrapped="true"/>

                            <soap:wsdl>stockquote.wsdl</soap:wsdl>

                            <soap:wsdlPort>StockQuoteSoap</soap:wsdlPort>

                            <soap:endpointAddress>http://www.webservicex.net/stockquote.asmx</soap:endpointAddress>

                          </soap:binding.soap>

                        </sca:reference>

                     

                    Not sure how to tackle this.

                    • 7. Re: soapaction header
                      moraleslos

                      Ok I'll give beta a shot

                      • 8. Re: soapaction header
                        moraleslos

                        Looks like upgrading to beta 1 worked-- I can set the headers in the processor without needing to specify the context mapper and it passes the header correctly.