Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-330

WebServiceTemplate hasFaut skips check for fault in response if the connection implements FaultAwareWebServiceConnection

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.5.1
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Tomcat 4.1.36 / JDK 1.4_14

      Description

      Hello,
      I use WebserviceTemplate configured
      <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
      <constructor-arg ref="messageFactory"/>
      <property name="checkConnectionForFault" value="true"></property>
      </bean>.

      As you can see, my server returns an error 500, but due to the code of hasError:
      return !(faultConnection.hasFault() && request instanceof FaultAwareWebServiceMessage);

      hasError returns false.
      this code seems strange to me, if a 500 is returned the response might not be XML so unmarshalling will fail and it does:
      org.springframework.ws.soap.axiom.AxiomSoapMessageCreationException: Unknown content type 'text/html;charset=ISO-8859-1'
      at org.springframework.ws.soap.axiom.AxiomSoapMessageFactory.getSoapEnvelopeNamespace(AxiomSoapMessageFactory.java:262)
      at org.springframework.ws.soap.axiom.AxiomSoapMessageFactory.createAxiomSoapMessage(AxiomSoapMessageFactory.java:224)
      at org.springframework.ws.soap.axiom.AxiomSoapMessageFactory.createWebServiceMessage(AxiomSoapMessageFactory.java:196)
      at org.springframework.ws.transport.AbstractWebServiceConnection.receive(AbstractWebServiceConnection.java:53)
      at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:491)
      at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:440)
      at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:395)
      at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:341)
      at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:326)
      at com.kingfisher.product.wsclient.TestSpringWSClient.main(TestSpringWSClient.java:100)

      Related to http://jira.springframework.org/browse/SWS-137.

      Request:
      POST /TutorialWS/services/LocalProduct HTTP/1.1
      Accept-Encoding: gzip
      Content-Type: text/xml; charset="UTF-8"
      SOAPAction: ""
      Cache-Control: no-cache
      Pragma: no-cache
      User-Agent: Java/1.4.2_12
      Host: 127.0.0.1:9090
      Accept: text/html, image/gif, image/jpeg, ; q=.2, */; q=.2
      Connection: keep-alive
      Content-Length: 486

      <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><v1:getLocatedProducts xmlns:v1="http://v1.product.ws.store.kingfisher.com" xmlns:xsd="http://data.v1.product.ws.store.kingfisher.com/xsd"><v1:param0><xsd:callType>1</xsd:callType><xsd:familyCode>1</xsd:familyCode><xsd:moduleCode>1</xsd:moduleCode><xsd:subFamilyCode>1</xsd:subFamilyCode></v1:param0></v1:getLocatedProducts></soapenv:Body></soapenv:Envelope>

      Response:
      HTTP/1.1 500 Erreur Interne de Servlet
      Server: Apache-Coyote/1.1
      Content-Type: text/html;charset=ISO-8859-1
      Content-Language: fr-FR
      Transfer-Encoding: chunked
      Date: Mon, 14 Apr 2008 17:06:47 GMT
      Connection: close

      <html><head><title>Apache Tomcat/4.1.36-LE-jdk14 - Rapport d'erreur</title><STYLE><!--H1

      {font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;}

      H3

      {font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;}

      BODY

      {font-family : sans-serif,Arial,Tahoma;color : black;background-color : white;}

      B

      {color : white;background-color : #0086b2;}

      HR

      {color : #0086b2;}

      --></STYLE> </head><body><h1>Etat HTTP 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Rapport d'exception</p><p><b>message</b> <u></u></p><p><b>description</b> <u>Le serveur a rencontr� une erreur interne () qui l'a emp�ch� de satisfaire la requ�te.</u></p><p><b>exception</b> <pre>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NoClassDefFoundError: Test
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:535)
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:463)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:145)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:139)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:198)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2460)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:119)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:545)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:157)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: java.lang.NoClassDefFoundError: Test
      at com.kingfisher.product.ws.ProductWsMarshallingEndpoint.invokeInternal(ProductWsMarshallingEndpoint.java:58)
      at org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint.invoke(AbstractMarshallingPayloadEndpoint.java:131)
      at org.springframework.ws.server.endpoint.adapter.MessageEndpointAdapter.invoke(MessageEndpointAdapter.java:41)
      at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:216)
      at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:163)
      at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)
      at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
      at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:197)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:523)
      ... 37 more
      </pre></p><p><b>cause m�re</b> <pre>java.lang.NoClassDefFoundError: Test
      at com.kingfisher.product.ws.ProductWsMarshallingEndpoint.invokeInternal(ProductWsMarshallingEndpoint.java:58)
      at org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint.invoke(AbstractMarshallingPayloadEndpoint.java:131)
      at org.springframework.ws.server.endpoint.adapter.MessageEndpointAdapter.invoke(MessageEndpointAdapter.java:41)
      at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:216)
      at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:163)
      at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)
      at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
      at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:197)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:523)
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:463)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:145)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:139)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:198)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2460)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:119)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:545)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:157)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
      at java.lang.Thread.run(Thread.java:534)
      </pre></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/4.1.36-LE-jdk14</h3></body></html>

        Issue Links

          Activity

          pmouawad@ubik-ingenierie.com Philippe Mouawad created issue -
          arjen.poutsma Arjen Poutsma made changes -
          Field Original Value New Value
          Fix Version/s 1.5.1 [ 10917 ]
          arjen.poutsma Arjen Poutsma made changes -
          Link This issue is related to SWS-137 [ SWS-137 ]
          arjen.poutsma Arjen Poutsma made changes -
          Link This issue is related to SWS-308 [ SWS-308 ]
          arjen.poutsma Arjen Poutsma made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Due to the wide variety of WS servers out there, it is quite hard to create a handleError() method that satisfies everybody. (See the linked to issues, for instance). Therefore, I think it's best if the error resolution is made pluggable, similarly to the FaultMessageResolver. That way, you can just plug in your error handling strategy, with a sensible, WS-I compliant default provided.

          Show
          arjen.poutsma Arjen Poutsma added a comment - Due to the wide variety of WS servers out there, it is quite hard to create a handleError() method that satisfies everybody. (See the linked to issues, for instance). Therefore, I think it's best if the error resolution is made pluggable, similarly to the FaultMessageResolver. That way, you can just plug in your error handling strategy, with a sensible, WS-I compliant default provided.
          arjen.poutsma Arjen Poutsma made changes -
          Link This issue depends on SWS-338 [ SWS-338 ]
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Ignore my earlier comment: error resolution is not pluggable.

          Instead, I'm now checking the response content-type, so see whether it's XML. I've also added a checkConnectionForError property, which - when set to false - completely ignores any HTTP status codes.

          Show
          arjen.poutsma Arjen Poutsma added a comment - Ignore my earlier comment: error resolution is not pluggable. Instead, I'm now checking the response content-type, so see whether it's XML. I've also added a checkConnectionForError property, which - when set to false - completely ignores any HTTP status codes.
          arjen.poutsma Arjen Poutsma made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Closing issues for 1.5.1

          Show
          arjen.poutsma Arjen Poutsma added a comment - Closing issues for 1.5.1
          arjen.poutsma Arjen Poutsma made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          13d 18h 50m 1 Arjen Poutsma 27/Apr/08 11:36 PM
          In Progress In Progress Resolved Resolved
          1d 23h 1m 1 Arjen Poutsma 29/Apr/08 10:37 PM
          Resolved Resolved Closed Closed
          5d 22h 43m 1 Arjen Poutsma 05/May/08 9:21 PM

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              pmouawad@ubik-ingenierie.com Philippe Mouawad
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: