13 Replies Latest reply on Oct 30, 2007 6:04 AM by Tom Fennelly

    Error while attempting to call Web Service using SOAPClient

    Dan Salt Newbie

      Hi,

      I'm using JBoss ESB4.2GA running within JBoss AS 4.2.1GA. I've got the Quickstarts up and running and all seems to be OK. I'm now trying to prototype some code and am running into problems.

      I've got a number of Web Services deployed and want to use the ESB as a "proxy" to them. So I have an ESB project that receives the WS SOAP message, routes to the SOAPClient which calls the "real" Web Service.

      I started with no code and the following config:

      <?xml version="1.0" encoding="UTF-8"?>
      <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
       parameterReloadSecs="5" >
      
       <providers>
       <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
       jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
       jndi-URL="localhost">
      
       <jms-bus busid="lightESBChannel">
       <jms-message-filter dest-type="QUEUE" dest-name="queue/light_services_gateway_esb"/>
       </jms-bus>
       <jms-bus busid="lightESBReplyChannel">
       <jms-message-filter dest-type="QUEUE" dest-name="queue/light_services_gateway_esb_reply"/>
       </jms-bus>
       </jms-provider>
      
       <jbr-provider name="JBR-Http" protocol="http" host="localhost">
       <jbr-bus busid="Http-1" port="9876" />
       </jbr-provider>
       </providers>
      
       <services>
       <service category="LightSwitchServices" name="serviceGW" description="Light Switch ESB Service GW">
       <listeners>
       <jbr-listener name="HttpListener" busidref="Http-1" is-gateway="true" maxThreads="1" />
       <jms-listener name="JMS-ESBListener" busidref="lightESBChannel" maxThreads="1" />
       </listeners>
       <actions>
       <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="message" value="[service gateway] BEFORE routing message to WS"/>
       </action>
       <action name="soapui-client-action" class="org.jboss.soa.esb.actions.soap.SOAPClient">
       <property name="wsdl" value="http://localhost:8080/LightServices/LightSwitchBean?wsdl" />
       <property name="SOAPAction" value="switchOnLight"/>
       </action>
       </actions>
       </service>
       </services>
      </jbossesb>
      


      When I run this, I got the following error:

      09:28:56,757 INFO [ServiceInvoker] Unresponsive EPR: EPR: PortReference < <wsa:Address http://localhost:9876/> >
      09:28:56,898 INFO [STDOUT] [service gateway] BEFORE routing message to WS:
      09:28:56,898 INFO [STDOUT] [<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns1:switchOnLight xmlns:ns1="http://ejb.examples.soa.systems.energy.ge/"/></env:Body></env:Envelope>].
      09:28:56,898 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline
      java.lang.ClassCastException: java.lang.String
       at org.jboss.soa.esb.actions.soap.SOAPClient.process(SOAPClient.java:304)
       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:265)
       at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:297)
       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:595)
      


      Looking into this, it appears that the method in question (SOAPClient.java:304) was having problems with the fact that my Web Service does not take or return any parameters. In the event of a empty map, it tries to take the Message Body and cast it to a map. In the case above, it was a String, thus the failure.

      Now I appreciate that the documentation says that I must set an empty map, but surely it would be neater to handle this case without custom code?

      Anyways, I create a basic pre/post class which simply sets an empty map in the message. I added the following:

      <action name="pre-request-mapper" class="ge.energy.systems.soa.examples.esb.actions.EmptyParameterRequestMapper" />
      


      This now gets much further, calls my Web Service, but then fails on the return.

      09:32:48,726 INFO [STDOUT] [service gateway] BEFORE routing message to WS:
      09:32:48,726 INFO [STDOUT] [<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns1:switchOnLight xmlns:ns1="http://ejb.examples.soa.systems.energy.ge/"/></env:Body></env:Envelope>].
      09:32:48,726 WARN [SOAPClient] Params Map found in message, but the map is empty.
      09:32:50,195 INFO [STDOUT] 09:32:50,195 WARN [SoapUI] Failed to load settings [soapui-settings.xml (The system cannot find the file specified)], creating new
      09:32:52,617 INFO [STDOUT] Progress: 1 - Caching definition from url [http://localhost:8080/LightServices/LightSwitchBean?wsdl]
      09:32:52,742 INFO [STDOUT] 09:32:52,742 INFO [SchemaUtils] Added default schema from file:/D:/DevEnvironments/JBossESB/jboss-4.2.1.GA/server/default/tmp/deploy/tmp19970soapui-1.7.1.jar!/xop.xsd with targetNamespace http://www.w3.org/2004/08/xop/include
      09:32:52,945 INFO [STDOUT] 09:32:52,945 INFO [SchemaUtils] Added default schema from file:/D:/DevEnvironments/JBossESB/jboss-4.2.1.GA/server/default/tmp/deploy/tmp19970soapui-1.7.1.jar!/XMLSchema.xsd with targetNamespace http://www.w3.org/2001/XMLSchema
      09:32:52,960 INFO [STDOUT] 09:32:52,960 INFO [SchemaUtils] Added default schema from file:/D:/DevEnvironments/JBossESB/jboss-4.2.1.GA/server/default/tmp/deploy/tmp19970soapui-1.7.1.jar!/xml.xsd with targetNamespace http://www.w3.org/XML/1998/namespace
      09:32:52,992 INFO [STDOUT] 09:32:52,992 INFO [SchemaUtils] Added default schema from file:/D:/DevEnvironments/JBossESB/jboss-4.2.1.GA/server/default/tmp/deploy/tmp19970soapui-1.7.1.jar!/swaref.xsd with targetNamespace http://ws-i.org/profiles/basic/1.1/xsd
      09:32:52,992 INFO [STDOUT] 09:32:52,992 INFO [SchemaUtils] Added default schema from file:/D:/DevEnvironments/JBossESB/jboss-4.2.1.GA/server/default/tmp/deploy/tmp19970soapui-1.7.1.jar!/xmime200505.xsd with targetNamespace http://www.w3.org/2005/05/xmlmime
      09:32:52,992 INFO [STDOUT] 09:32:52,992 INFO [SchemaUtils] Added default schema from file:/D:/DevEnvironments/JBossESB/jboss-4.2.1.GA/server/default/tmp/deploy/tmp19970soapui-1.7.1.jar!/xmime200411.xsd with targetNamespace http://www.w3.org/2004/11/xmlmime
      09:32:53,273 INFO [STDOUT] 09:32:53,273 WARN [HttpMethodBase] Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
      09:32:53,351 INFO [STDOUT] Progress: 1 - Loading definition from cache
      09:32:53,460 INFO [STDOUT] Retrieving document at 'http://localhost:8080/LightServices/LightSwitchBean?wsdl'.
      09:32:53,960 INFO [STDOUT] 09:32:53,960 INFO [SchemaUtils] Loading schema types from [http://localhost:8080/LightServices/LightSwitchBean?wsdl]
      09:32:53,960 INFO [STDOUT] 09:32:53,960 INFO [SchemaUtils] Getting schema http://localhost:8080/LightServices/LightSwitchBean?wsdl
      09:32:53,976 INFO [STDOUT] 09:32:53,976 INFO [SchemaUtils] schema for [http://ejb.examples.soa.systems.energy.ge/] contained [{}] namespaces
      09:32:54,601 INFO [STDOUT] 09:32:54,601 INFO [WsdlImporter] Finding importer for {http://ejb.examples.soa.systems.energy.ge/}LightSwitchBinding
      09:32:54,601 INFO [STDOUT] 09:32:54,601 INFO [WsdlImporter] Importing binding {http://ejb.examples.soa.systems.energy.ge/}LightSwitchBinding
      09:32:54,742 INFO [STDOUT] 09:32:54,742 INFO [Soap11HttpBindingImporter] importing endpoint http://127.0.0.1:8080/LightServices/LightSwitchBean
      09:32:54,851 INFO [STDOUT] 09:32:54,851 INFO [Soap11HttpBindingImporter] importing operation isLightOn
      09:32:54,945 INFO [STDOUT] 09:32:54,945 INFO [Soap11HttpBindingImporter] importing operation switchOffLight
      09:32:54,945 INFO [STDOUT] 09:32:54,945 INFO [Soap11HttpBindingImporter] importing operation switchOnLight
      09:32:55,304 WARN [HttpMethodBase] Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
      09:32:55,335 ERROR [SOAPMessageUnMarshaller] Cannot unmarshall SOAPMessage
      javax.xml.soap.SOAPException: Unsupported content type: text/html
       at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:240)
       at org.jboss.ws.core.soap.SOAPMessageUnMarshaller.read(SOAPMessageUnMarshaller.java:75)
       at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:472)
       at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:304)
       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:171)
       at org.jboss.ws.core.client.SOAPRemotingConnection.invoke(SOAPRemotingConnection.java:77)
       at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:322)
       at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:230)
       at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
       at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
       at $Proxy113.switchOnLight(Unknown Source)
       at ge.energy.systems.soa.examples.web.LightTest.doGet(LightTest.java:195)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:595)
      


      I wasn't able to accurately debug what was going on - can anyone help me? The "real" WebService works fine outside of this example. It's prototype is very simply:

      void switchOnLight()


      Many Thanks,
      Dan

        • 1. Re: Error while attempting to call Web Service using SOAPCli
          Dan Salt Newbie

          After extensive digging, I've found this:

          http://jira.jboss.com:8080/jira/browse/JBWS-1824

          Can anyone confirm that this what is causing what I am seeing? In the meantime I will download the latest WS stack and see if it improves the situation.

          Cheers,
          Dan

          • 2. Re: Error while attempting to call Web Service using SOAPCli
            Burr Sutter Master

            Is "http://localhost:8080/LightServices/LightSwitchBean?wsdl" a JBossWS endpoint? If so then you should consider the use of the following:

            <action name="JBossWSAdapter"
             class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
             <property name="jbossws-endpoint" value="GoodbyeWorldWS"/>
            </action>


            The SoapClient action is more targeted at non-JBossWS endpoints (e.g. those hosted on another App Server or .NET, etc) and is focused on exposing WS endpoints as JMS or some other ESB supported transport.

            Another likely cause of your issue (related to SoapClient) is that request mapping can be tricky. Make sure to first call your soap endpoint with SoapUI (soapui.org) to see how it should look. Then dump your message to the console in your action chain to see what it really looks like. Then have your "mapper" class build a nice clean hashmap (follow the webservice_consumer examples).

            However, if you have a JBossWS endpoint, try SoapProcessor as well.




            • 3. Re: Error while attempting to call Web Service using SOAPCli
              Tom Fennelly Master

              Dan, what you're seeing is a known issue with JBossRemoting (http://jira.jboss.com/jira/browse/JBESB-783) and has been fixed in the JBossRemoting 2.2.2.SP2. It you patch your AS with this, you should get past this issue.

              T.

              • 4. Re: Error while attempting to call Web Service using SOAPCli
                Dan Salt Newbie

                Hi,

                I've followed the JIRA issue back to the JBoss Remoting link (http://jira.jboss.com/jira/browse/JBREM-653), where it states that it was fixed in 2.2.2 SP1, and downloaded the updated jboss-remoting.jar from here:

                http://repository.jboss.com/jboss/remoting/2.2.2.SP1-brew/lib/

                Replaced the jar in both the /client and the /server/default/lib directories.

                But the same thing happens, no change to the stack trace or the eventual outcome.

                Is there something else I should have done to patch this?

                Cheers,
                Dan

                • 5. Re: Error while attempting to call Web Service using SOAPCli
                  Dan Salt Newbie

                  Hi again,

                  As a followup to this, I have also located and downloaded the very latest JBoss-Remoting.jar (2.2.2GA-CP01) from the repository. Again, I have replaced the versions in /client and /server/default/lib, and cleared out the tmp/work areas and restarted. Still no change to the outcome.

                  Any ideas?

                  Cheers,
                  Dan

                  • 6. Re: Error while attempting to call Web Service using SOAPCli
                    Tom Fennelly Master

                    Sorry Dan, after reading back through your posts there I notice something important... you're using JBossESB 4.2GA. I'm afraid you'll still have this issue with 4.2GA because it's not setting the Content-Type. Are you in a position to checkout and try 4.2.1 IR2 from SVN?

                    • 7. Re: Error while attempting to call Web Service using SOAPCli
                      Dan Salt Newbie

                      Hi,

                      Thanks for the reply. I'm sure that I could try the latest build, although I've not done it before and thus far have not found anywhere that describes how to check-out the source. Is there a "readme" or Wiki?

                      Cheers,
                      Dan

                      • 8. Re: Error while attempting to call Web Service using SOAPCli
                        Dan Salt Newbie

                        .... ignore the previous post.

                        Sod's Law came into effect, and I found the help pages I was looking for. Will let you know if the new version fixes the problem.

                        Cheers,
                        Dan

                        • 9. Re: Error while attempting to call Web Service using SOAPCli
                          Dan Salt Newbie

                          Hi again,

                          Still no luck - can anyone spot what I've missed??

                          I'm now using JBossESB 4.2.1 IR1, and the jboss-remoting.jar version 2.2.2 SP2. Cleared out all temporary data, etc.

                          It still sends back the data as text/html.

                          13:16:35,870 ERROR [SOAPMessageUnMarshaller] Cannot unmarshall SOAPMessage
                          javax.xml.soap.SOAPException: Unsupported content type: text/html; charset=UTF-8
                           at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:248)
                           at org.jboss.ws.core.soap.SOAPMessageUnMarshaller.read(SOAPMessageUnMarshaller.java:84)
                           at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:502)
                           at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:306)
                           at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:136)
                           at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
                           at org.jboss.remoting.Client.invoke(Client.java:1634)
                           at org.jboss.remoting.Client.invoke(Client.java:548)
                           at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:183)
                           at org.jboss.ws.core.client.SOAPRemotingConnection.invoke(SOAPRemotingConnection.java:77)
                           at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:337)
                           at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:243)
                           at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
                           at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
                           at $Proxy113.switchOnLight(Unknown Source)
                           at ge.energy.systems.soa.examples.web.LightTest.doGet(LightTest.java:193)
                           at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
                           at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                           at java.lang.Thread.run(Thread.java:595)
                          13:16:35,948 ERROR [[LightTest]] Servlet.service() for servlet LightTest threw exception
                          javax.xml.ws.WebServiceException: java.io.IOException: Could not transmit message
                           at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:317)
                           at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:255)
                           at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
                           at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
                           at $Proxy113.switchOnLight(Unknown Source)
                           at ge.energy.systems.soa.examples.web.LightTest.doGet(LightTest.java:193)
                           at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
                           at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                           at java.lang.Thread.run(Thread.java:595)
                          Caused by: java.io.IOException: Could not transmit message
                           at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:204)
                           at org.jboss.ws.core.client.SOAPRemotingConnection.invoke(SOAPRemotingConnection.java:77)
                           at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:337)
                           at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:243)
                           ... 24 more
                          Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
                           at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:334)
                           at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:136)
                           at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
                           at org.jboss.remoting.Client.invoke(Client.java:1634)
                           at org.jboss.remoting.Client.invoke(Client.java:548)
                           at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:183)
                           ... 27 more
                          Caused by: java.io.IOException: javax.xml.soap.SOAPException: Unsupported content type: text/html; charset=UTF-8
                           at org.jboss.ws.core.soap.SOAPMessageUnMarshaller.read(SOAPMessageUnMarshaller.java:92)
                           at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:502)
                           at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:306)
                           ... 32 more
                          Caused by: javax.xml.soap.SOAPException: Unsupported content type: text/html; charset=UTF-8
                           at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:248)
                           at org.jboss.ws.core.soap.SOAPMessageUnMarshaller.read(SOAPMessageUnMarshaller.java:84)
                           ... 34 more
                          
                          

                          What have I missed?

                          Cheers,
                          Dan

                          • 10. Re: Error while attempting to call Web Service using SOAPCli
                            Dan Salt Newbie

                            Sorry - typo - I've built JBoss ESB 4.2.1 IR2

                            • 11. Re: Error while attempting to call Web Service using SOAPCli
                              Tom Fennelly Master

                              Sorry Dan. Can you try this....

                              Create a "SetMessageProperty" action that looks like this...

                              public class SetMessageProperty extends AbstractActionPipelineProcessor {
                              
                               private ConfigTree config;
                              
                               public SetMessageProperty(ConfigTree config) {
                               this.config = config;
                               }
                              
                               public Message process(Message message) throws ActionProcessingException {
                               Set<String> attribs = config.getAttributeNames();
                              
                               for (String attrib : attribs) {
                               message.getProperties().setProperty(attrib, config.getAttribute(attrib));
                               }
                              
                               return message;
                               }
                              }
                              


                              Then add a config (after the SOAPClient) for setting the "Content-Type" for the JBossRemotingGateway response (this should actually be supported by the gateway)....

                              <action name="Set-Properties" class="com.blah.SetMessageProperty">
                               <property name="Content-Type" value="text/xml;charset=UTF-8"/>
                              </action>
                              


                              • 12. Re: Error while attempting to call Web Service using SOAPCli
                                Dan Salt Newbie

                                Ah-ha!! Success! :)

                                Okay, so what does this mean? That I don't have a correct version somewhere? Is there any way that I can programatically confirm what version of the ESB and Gateway I'm running?

                                Cheers,
                                Dan