6 Replies Latest reply on Jun 9, 2009 1:05 PM by valerie choy

    servicemix-http-provider sends out soap message in 2 packets

    valerie choy Newbie

      Hi,

       

      I find out that my servicemix-http-provider sends out the soap message in 2 packets:

      1) first packet contains the http header:

       

      POST /AbwsWs/Abws HTTP/1.1..

      CONTENT_TYPE: text/xml;charset=UTF-8..

      Content-Length: 664..

      SOAPAction: ""..

      User-Agent: Jakarta Commons-HttpClient/3.0.1..

      REQUEST_METHOD: POST..

      REQUEST_URI: http://localhost:8192/Service/..

      ....................

       

      2) second packet contains the soap envelop:

       

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

      <soap:Body>

        <abws:FindWindowsElm xmlns:abws="http://com/ventyx/soi/poc/abws">.        

          <abws:request>.        

            ...............              

          </abws:request>.     

        </abws:FindWindowsElm>

      </soap:Body>

      </soap:Envelope>

       

      Question: is there any way to configure servicemix-http to send out the message in one single packet ?

       

      thanks

      Valerie

        • 1. Re: servicemix-http-provider sends out soap message in 2 packets
          Torsten Mielke Apprentice

          Do you talk about 2 TCP packets being sent out or 2 HTTP packets?

          Can you capture the packets in a network sniffer like wireshark and attach them to this thread (perhaps obfuscate the IP addresses used)?

           

          In case of 2 tcp packets being sent, there is probably nothing you can do in ServiceMix as this is controlled by the underlying OS. Note that when the request is routed through different networks, a gateway or router might break up a TCP request if the network to send to has a smaller maximum transmission unit (MTU) configured.

           

          If you encounter 2 HTTP packets being sent, then it might be due to HTTP chunking taking place. In which case your HTTP header should contain:

          Transfer-Encoding: chunked

           

          which I do not see in your quote.

          • 2. Re: servicemix-http-provider sends out soap message in 2 packets
            valerie choy Newbie

            It is actually 2 HTTP packets being sent out. I put a sniffer in between and notice the following  :

             

            1) At time T1: first HTTP packet sent out by the servicemix-http provider to the server:

             

            No.     Time        Source                Destination           Protocol Info

                  4 0.031921    10.100.50.156         10.100.10.212         TCP      qtms-bootstrap > 27852 Seq=1 Ack=1 Win=64240 Len=245

             

            POST /AbwsWs/Abws HTTP/1.1..

            CONTENT_TYPE: text/xml;charset=UTF-8..

            Content-Length: 664..

            SOAPAction: ""..

            User-Agent: Jakarta Commons-HttpClient/3.0.1..

            REQUEST_METHOD: POST..

            REQUEST_URI: http://localhost:8192/Service/..

            Host: 10.100.10.212:2785

             

            2) At time T2: First Response received from server:

             

            No.     Time        Source                Destination           Protocol Info

                  5 0.043151    10.100.10.212         10.100.50.156         TCP      27852 > qtms-bootstrap Seq=1 Ack=246 Win=32768 Len=179

             

            HTTP/1.1 500 Internal Server Error..

            Date: Wed, 27 May 2009 18:08:29 GMT..

            Transfer-Encoding: chunked..

            Content-Type: text/xml; charset="utf-8"..

            X-Powered-By: Servlet/2.5 JSP/2.1.

             

            3) At time T3: Second Response received from server:

             

            No.     Time        Source                Destination           Protocol Info

                  6 0.043958    10.100.10.212         10.100.50.156         TCP      27852 > qtms-bootstrap Seq=180 Ack=246 Win=32768 Len=368

             

            0168..

            27852 Seq=246 Ack=548 Win=63693 Len=664

             

             

             

             

            I wonder whether there is any way to disable HTTP chunking at the servicemix-http component ?

             

            Thanks a lot

            Valerie

            • 3. Re: servicemix-http-provider sends out soap message in 2 packets
              Torsten Mielke Apprentice

              The SOAP server that the servicemix-http provider sends out the messages to is an external non-Servicmix server?

              It is actually the response from the server that shows http chunking being used as the reply in T2 contains:

              Transfer-Encoding: chunked..
              

               

              I don't see http chunking being used in the outgoing request from the servicemix-http components.

               

              Also, we highly recommend the servicemix-cxf-bc component over the servicemix-http component when dealing with SOAP messages, as it has better support for SOAP. Do you mind switching to servicemix-cxf-bc instead?

              • 4. Re: servicemix-http-provider sends out soap message in 2 packets
                valerie choy Newbie

                 

                I tried with servicemix-cxf-bc and it's working .... Thanks a lot for the suggestion.

                 

                Now, I try to understand the difference between servicemix-http and servicemix-cxf-bc by examining the sniffer logs files of both cases.

                I find out that both use HTTP-chunking when sending http messages to the external server. However, the HTTP headers are different.

                 

                In the servicemix-http case, the header looks like:

                 

                POST /AbwsWs/Abws HTTP/1.1..

                CONTENT_TYPE: text/xml;charset=UTF-8..

                Content-Length: 541..

                SOAPAction: ""..

                User-Agent: Jakarta Commons-HttpClient/3.0.1..

                REQUEST_METHOD: POST..

                REQUEST_URI: http://localhost:8192/Service/..

                 

                while in the servicemix-cxf-bc case, the header looks like:

                 

                POST /AbwsWs/Abws HTTP/1.1..

                Content-Type: text/xml; charset=UTF-8..

                SOAPAction: ""..Accept: *..

                Cache-Control: no-cache..

                Pragma: no-cache..User-Agent: Java/1.6.0_13..

                Host: 10.100.10.212:27852..

                Connection: keep-alive..

                Content-Length: 537....

                 

                I also find out in the doc http://fusesource.com/docs/framework/2.2/bind_trans/bind_trans.pdf, that there is a way to configure the consumer/provider component to disable chunking and to allow keep-alive connection. So I went ahead to modify the configuration in the wsdl file and/or xbeans.xml of my servicemix-http-provider to see whether it makes a difference. Unfortunately, it looks like it does not work:

                 

                1) the following field when added to the wsdl file is being ignored (ie. the outgoing HTTP messages are still being chunked)

                 

                &lt;service name="AbwsHttpProviderSvc"&gt;

                &lt;port name="AbwsHttpProviderSvcPort" binding="abws:AbWebServiceSoapBinding"&gt;

                &lt;soap:address location="http://10.100.10.212:27852/AbwsWs/Abws" /&gt;

                &lt;http-conf:client AllowChunking="false" /&gt;

                &lt;http-conf:client Connection="Keep-Alive" /&gt;

                &lt;/port&gt;

                &lt;/service&gt;

                 

                2)  while the following change in the xbeans.xml file will trigger an exception during the mvn packaging phase:

                 

                  &lt;http-conf:conduit name="AbwsHttpProviderSvcPort.http-conduit" &gt;

                     &lt;http-conf:client AllowChunking="false"

                                    Connection="Keep-Alive" /&gt;

                  &lt;/http-conf:conduit&gt;

                 

                the Exception looks like:

                ...................

                Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unrecognized xbean namespace mapping: http://cxf.apache.org/transports/http/configuration

                at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(X

                BeanNamespaceHandler.java:277) .........................

                 

                Tough luck... Looks like there is no option to change configuration of servivemix-http and that I need to stick with servicemix-cxf-bc.

                 

                 

                • 5. Re: servicemix-http-provider sends out soap message in 2 packets
                  Torsten Mielke Apprentice

                  The PDF doc you quoted in your previous reply is for configuring the servicemix-cxf-bc component, it does not apply to servicemix-http. So the AllowChunking property only applies to servicemix-cxf-bc.

                   

                  I anyway highly suggest servicemix-cxf-bc over servicemix-http when it comes to using SOAP messages, as the former has better built-in support and offer more features.

                   

                  I hope this helps.

                  • 6. Re: servicemix-http-provider sends out soap message in 2 packets
                    valerie choy Newbie

                    Actually, I am using servicemix-cxf-bc now instead of servicemix-http.

                    thanks very much for all your help.

                     

                    V.