0 Replies Latest reply on Nov 8, 2007 10:58 AM by tnfink

    Problem with SOAPProcessor

    tnfink

      Hi,

      I am evaluating JBoss ESB and tried to use the SOAPProcessor to build an ESB-Web-Service frontend for a JBossWS service. I used the quickstart webservice_producer as guideline.

      I built a client with SAAJ. The client can connect to the JBossWS service without a problem. But when I try the ESB-frontend I get two error:

      * only a part of the message is received by the ESB and given to a action

      * the client cannot receive the SOAP error message because the content type is text/html.

      My infrastructure ist JBossAS 4.2.1, JBoss ESB 4.2.1, JBossWS 2.0.0 (patched by the ESB).

      This is the client code:

       URL = "http://localhost:9999/";
       MessageFactory messageFactory = MessageFactory.newInstance();
       SOAPMessage message = messageFactory.createMessage(new MimeHeaders(),
       inputStream);
      
       SOAPConnectionFactory newInstance = SOAPConnectionFactory.newInstance();
       SOAPConnection connection = newInstance.createConnection();
       try {
       System.out.println("Schicke Nachricht..");
       SOAPMessage answer = connection.call(message, URL);
       System.out.println("Antwort:");
       answer.writeTo(System.out);
       } finally {
       connection.close();
       }
       }
      

      This is the ESB-configuration:
       <providers>
       <!-- JBoss - Remoting Bus -->
       <jbr-provider name="JBR-Http" protocol="http"
       host="localhost">
       <jbr-bus busid="HttpWebServices" port="9999" />
       </jbr-provider>
      
       <jms-provider name="JBossMessaging"
       connection-factory="ConnectionFactory">
       <jms-bus busid="internalEsbBus">
       <jms-message-filter dest-type="QUEUE"
       dest-name="akquinet/queues/jbosssoa/wsm/internalEsbBus" />
       </jms-bus>
       </jms-provider>
       </providers>
      
       <services>
       <service category="akquinetWsm"
       name="VerarbeiteDokumentenantrag"
       description="Empfaengt einen allgemeinen Dokumentenantrag und leitet diesen weiter">
       <listeners>
       <jbr-listener name="WebServiceListener"
       busidref="HttpWebServices" maxThreads="2" is-gateway="true"
       />
       <jms-listener name="internalEsbListener"
       busidref="internalEsbBus" maxThreads="1" />
       </listeners>
      
       <actions mep="RequestResponse">
       <action name="log"
       class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="message" value="File geladen" />
       <property name="printfull" value="false" />
       </action>
       <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
       <property name="jbossws-endpoint" value="DokumentenantragWS"/>
       </action>
       </actions>
       </service>
       </services>
      


      This is the error on the client side:
      Schicke Nachricht..
      Exception in thread "main" javax.xml.soap.SOAPException: java.io.IOException: Could not transmit message
       at org.jboss.ws.core.soap.SOAPConnectionImpl.callInternal(SOAPConnectionImpl.java:115)
       at org.jboss.ws.core.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:66)
       at de.akquinet.jbosssoa.wsm.dokumentenantrag.test.SendSoapMessage.sendSoapMessage(SendSoapMessage.java:34)
       at de.akquinet.jbosssoa.wsm.dokumentenantrag.test.SendSoapMessage.main(SendSoapMessage.java:21)
      Caused by: java.io.IOException: Could not transmit message
       at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:201)
       at org.jboss.ws.core.client.SOAPRemotingConnection.invoke(SOAPRemotingConnection.java:77)
       at org.jboss.ws.core.soap.SOAPConnectionImpl.callInternal(SOAPConnectionImpl.java:106)
       ... 3 more
      Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
       at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:332)
       at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:135)
       at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
       at org.jboss.remoting.Client.invoke(Client.java:1550)
       at org.jboss.remoting.Client.invoke(Client.java:530)
       at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:180)
       ... 5 more
      Caused by: java.io.IOException: javax.xml.soap.SOAPException: Unsupported content type: text/html
       at org.jboss.ws.core.soap.SOAPMessageUnMarshaller.read(SOAPMessageUnMarshaller.java:92)
       at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:472)
       at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:304)
       ... 10 more
      Caused by: javax.xml.soap.SOAPException: Unsupported content type: text/html
       at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:242)
       at org.jboss.ws.core.soap.SOAPMessageUnMarshaller.read(SOAPMessageUnMarshaller.java:84)
       ... 12 more
      


      This is the error on the server side:
      16:54:44,834 INFO [STDOUT] File geladen:
      16:54:44,835 INFO [STDOUT] [<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:wsm='http://akquinet.de/dokumentenantrag'><soapenv:Header></soapenv:Header><soapenv:Body>
       <wsm:Dokumentenantrag xmlns:wsm='http://akquinet.de/dokumentenantrag'>
       ].
      16:54:44,837 ERROR [STDERR] [Fatal Error] :3:13: XML document structures must start and end within the same entity.
      16:54:44,850 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
      org.jboss.ws.core.CommonSOAPFaultException: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
       at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:93)
       at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:256)
       at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:179)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:377)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:260)
       at org.jboss.soa.esb.actions.soap.SOAPProcessor.process(SOAPProcessor.java:142)
       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
       at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:303)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:613)
      16:54:44,850 ERROR [SOAPFaultHelperJAXRPC] SOAP request exception
      javax.xml.rpc.soap.SOAPFaultException: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
       at org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC.exceptionToFaultMessage(SOAPFaultHelperJAXRPC.java:189)
       at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.exceptionToFaultMessage(SOAPFaultHelperJAXWS.java:157)
       at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.createFaultMessageFromException(SOAP11BindingJAXWS.java:104)
       at org.jboss.ws.core.CommonSOAPBinding.bindFaultMessage(CommonSOAPBinding.java:645)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:418)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:260)
       at org.jboss.soa.esb.actions.soap.SOAPProcessor.process(SOAPProcessor.java:142)
       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
       at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:303)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:613)
      


      And finally the Web-Service implementation:

      @WebService(name = "DokumentenantragWS", targetNamespace="http://akquinet.de/dokumentenantrag")
      @SOAPBinding(style=Style.DOCUMENT)
      public class DokumentenantragWS {
       @WebMethod
       public AnfrageErgebnis stelleAnfrage(Dokumentenantrag dokumentenAnfrage) {
       System.out.println("XXXX eine anfrage YYYYY");
       return new AnfrageErgebnis(true,"Kein Kommentar");
       }
      }
      


      Anyone any ideas?

      -- Torsten