0 Replies Latest reply on Dec 11, 2012 3:40 AM by greendale

    Cached Web Service Client sends wrong SoapAction in HTTP header

    greendale

      Hi all,

       

      I have a problem with an application which I have migrated from JBoss AS5 to AS7. Parts of the application contain a JaxWS webservice client which makes calls to a remote web service. The former implementation was based on the jboss-ws native stack. For performance reasons the web service client instance was cached and reused. When migrating to AS7 I have not changed the webservice client code so far, at least at first glance it looked like everything is working fine.

       

      But, whenever a JaxWS client is reused - taken from the pool - it sends a wrong SoapAction in the HTTP Headers. For Example

       

      server.log:

      ---------------------------

      ID: 3

      Address: http://server:8080/....ServiceInterface

      Encoding: UTF-8

      Content-Type: text/xml

      Headers: {Accept=[*/*], Accept-Encoding=[gzip], SOAPAction=["http://..../wsdl:GetConfigurations"]}

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

      <soap:Header>

         <nsh:AuthenticationHeader xmlns:nsh="http:....">...</nsh:AuthenticationHeader>

      </soap:Header>

      <soap:Body>

         <GetTemplates xmlns="....."> ... </GetTemplates>

      </soap:Body></soap:Envelope>

      --------------------------------------

       

      So as one sees, the actual call is 'GetTemplates' but the SoapAction in the header is 'GetConfigurations', which causes an Error-500 on the remote server.

       

       

      For the moment - as a hack - I remove the SoapAction from the HttpHeaders, before putting back the client stup into the pool:

       

      Map httpHeaders = ((BindingProvider)stub).getRequestContext();

      httpHeaders.remove("org.apache.cxf.message.Message.PROTOCOL_HEADERS");

       

       

      But I do not feal very comfortable with this hack. Does any ody know about this issue, or have I missed something during migration?