Uploaded image for project: 'JBoss ESB'
  1. JBoss ESB
  2. JBESB-3636

ESB - SOAPProxy throws SAXParseException when soapAction is missing in WSDL and message has attachment

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.10
    • Fix Version/s: None
    • Component/s: Deployment
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Use quickstarts/webservice_proxy_basic

      1) Open a command prompt and cd to quickstarts/webservice_proxy_basic. Run ant deploy to deploy webservice_proxy_basic. Run ant runtest to test it deployed correctly and works.

      2) Use the soapUI testing tool and create a new project with the wsdl: http://127:0.0.1/Quickstart_webservice_proxy_basic/http/Proxy_Basic/Proxy?wsdl

      3) Open Request1 and add a value to the toWhom element and send the message. Should get a valid response.

      4) Now use soapUI to add an attachment (I added a pdf file). Resend the message. Should still get a valid response. Notice in the soa-p console that the attachment is printed out (as a bunch of giberish).

      5) Copy the HelloWorldWSService7545491345617367911.wsdl in server/default/data/wsdl/Quickstart_webservice_proxy_basic_ws to somewhere convenient (I copied it to root), and rename it to HelloWorldWSService.wsdl. Open this file and remove the soapAction="" in the soap:operation element.

      <binding name="HelloWorldBinding" type="tns:HelloWorld">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="sayHello">
      <soap:operation />

      6) Edit jboss-esb.xml in quickstarts/webservice_proxy_basic to use a different wsdl value in the SOAPProxy configuration:

      <action name="proxy"
      class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy">
      <!-- <property name="wsdl" value="internal://jboss.ws:context=Quickstart_webservice_proxy_basic_ws,endpoint=HelloWorldWS"/> -->
      <property name="wsdl" value="file:///HelloWorldWSService.wsdl"/>

      </action>

      7) Use ant deploy to re-deploy the quickstart.

      8) Use soapUI to resend the message with attachment. You should see an exception:

      2011-07-05 12:44:49,823 WARN [org.jboss.soa.esb.actions.soap.proxy.SOAPProxy] (pool-41-thread-1) null binding for soapaction [""]; parsing envelope to discover operation...
      2011-07-05 12:44:49,838 ERROR [STDERR] (pool-41-thread-1) [Fatal Error] :2:1: Content is not allowed in prolog.
      2011-07-05 12:44:49,840 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/Quickstart_webservice_proxy_basic].[Proxy_Basic-GwListener]] (http-127.0.0.1-8080-2) Servlet.service() for servlet Proxy_Basic-GwListener threw exception
      org.xml.sax.SAXParseException: Content is not allowed in prolog.
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.jboss.soa.esb.actions.soap.proxy.SOAPProxy.getOperation(SOAPProxy.java:413)
      at org.jboss.soa.esb.actions.soap.proxy.SOAPProxy.process(SOAPProxy.java:345)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:649)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:603)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:433)
      at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:550)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:680)

      9) Remove the attachment in soapUI and resend the message. It should work:

      2011-07-05 12:48:27,633 INFO [STDOUT] (pool-41-thread-1) Message before SOAPProxy:
      2011-07-05 12:48:27,633 INFO [STDOUT] (pool-41-thread-1) [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://webservice_proxy_basic/helloworld">
      <soapenv:Header/>
      <soapenv:Body>
      <hel:sayHello>
      <!-Optional:->
      <toWhom>Jeff</toWhom>
      </hel:sayHello>
      </soapenv:Body>
      </soapenv:Envelope>].
      2011-07-05 12:48:27,634 WARN [org.jboss.soa.esb.actions.soap.proxy.SOAPProxy] (pool-41-thread-1) null binding for soapaction [""]; parsing envelope to discover operation...
      2011-07-05 12:48:27,650 INFO [STDOUT] (pool-41-thread-1) Message after SOAPProxy:
      2011-07-05 12:48:27,650 INFO [STDOUT] (pool-41-thread-1) [<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayHelloResponse xmlns:ns2="http://webservice_proxy_basic/helloworld"><return>Hello 'Jeff' on Tue Jul 05 12:48:27 MDT 2011</return></ns2:sayHelloResponse></env:Body></env:Envelope>].

      Show
      Use quickstarts/webservice_proxy_basic 1) Open a command prompt and cd to quickstarts/webservice_proxy_basic. Run ant deploy to deploy webservice_proxy_basic. Run ant runtest to test it deployed correctly and works. 2) Use the soapUI testing tool and create a new project with the wsdl: http://127:0.0.1/Quickstart_webservice_proxy_basic/http/Proxy_Basic/Proxy?wsdl 3) Open Request1 and add a value to the toWhom element and send the message. Should get a valid response. 4) Now use soapUI to add an attachment (I added a pdf file). Resend the message. Should still get a valid response. Notice in the soa-p console that the attachment is printed out (as a bunch of giberish). 5) Copy the HelloWorldWSService7545491345617367911.wsdl in server/default/data/wsdl/Quickstart_webservice_proxy_basic_ws to somewhere convenient (I copied it to root), and rename it to HelloWorldWSService.wsdl. Open this file and remove the soapAction="" in the soap:operation element. <binding name="HelloWorldBinding" type="tns:HelloWorld"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="sayHello"> <soap:operation /> 6) Edit jboss-esb.xml in quickstarts/webservice_proxy_basic to use a different wsdl value in the SOAPProxy configuration: <action name="proxy" class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy"> <!-- <property name="wsdl" value="internal://jboss.ws:context=Quickstart_webservice_proxy_basic_ws,endpoint=HelloWorldWS"/> --> <property name="wsdl" value="file:///HelloWorldWSService.wsdl"/> </action> 7) Use ant deploy to re-deploy the quickstart. 8) Use soapUI to resend the message with attachment. You should see an exception: 2011-07-05 12:44:49,823 WARN [org.jboss.soa.esb.actions.soap.proxy.SOAPProxy] (pool-41-thread-1) null binding for soapaction [""] ; parsing envelope to discover operation... 2011-07-05 12:44:49,838 ERROR [STDERR] (pool-41-thread-1) [Fatal Error] :2:1: Content is not allowed in prolog. 2011-07-05 12:44:49,840 ERROR [org.apache.catalina.core.ContainerBase. [jboss.web] . [localhost] . [/Quickstart_webservice_proxy_basic] . [Proxy_Basic-GwListener] ] (http-127.0.0.1-8080-2) Servlet.service() for servlet Proxy_Basic-GwListener threw exception org.xml.sax.SAXParseException: Content is not allowed in prolog. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.jboss.soa.esb.actions.soap.proxy.SOAPProxy.getOperation(SOAPProxy.java:413) at org.jboss.soa.esb.actions.soap.proxy.SOAPProxy.process(SOAPProxy.java:345) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:649) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:603) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:433) at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:550) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) 9) Remove the attachment in soapUI and resend the message. It should work: 2011-07-05 12:48:27,633 INFO [STDOUT] (pool-41-thread-1) Message before SOAPProxy: 2011-07-05 12:48:27,633 INFO [STDOUT] (pool-41-thread-1) [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://webservice_proxy_basic/helloworld"> <soapenv:Header/> <soapenv:Body> <hel:sayHello> <!- Optional: -> <toWhom>Jeff</toWhom> </hel:sayHello> </soapenv:Body> </soapenv:Envelope>]. 2011-07-05 12:48:27,634 WARN [org.jboss.soa.esb.actions.soap.proxy.SOAPProxy] (pool-41-thread-1) null binding for soapaction [""] ; parsing envelope to discover operation... 2011-07-05 12:48:27,650 INFO [STDOUT] (pool-41-thread-1) Message after SOAPProxy: 2011-07-05 12:48:27,650 INFO [STDOUT] (pool-41-thread-1) [<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayHelloResponse xmlns:ns2="http://webservice_proxy_basic/helloworld"><return>Hello 'Jeff' on Tue Jul 05 12:48:27 MDT 2011</return></ns2:sayHelloResponse></env:Body></env:Envelope>] .

      Description

      SOAPProxy throws SAXParseException when soapAction is missing in WSDL and message has attachment. If the soapAction ="" in the WSDL, then the message is not parsed. If there is no soapAction in the WSDL, then SOAPProxy attempts to parse the document to find the operation in the message, and throws a SAXParseException. See Steps to Reproduce below for more details.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dward David Ward
                  Reporter:
                  rick_wagner Rick Wagner
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: