6 Replies Latest reply on Jan 17, 2008 9:26 AM by Kevin Conner

    Port problem invoking a external web service with SOAPClient

    Ron Newbie

      Hi,

      I am trying to connect a external web service (Axis2) using a SOAPClient action. When this web service is published on port 80, i don't have problem. But, when the same web service is published on a different port (8081) then the JBoss ESB generate a org.jboss.soa.esb.actions.ActionProcessingException: Failed to invoke SOAP Endpoint: 'http://127.0.0.1:80/MyWS-War/services/MyWS' caused by java.net.ConnectException:Connection Refused. The message shows that the JBoss ESB is trying to invoke the Web Service using the port 80, but it should do it using the port 8081. My jboss-esb.xml contains:

      <action name="soapui-client-action"
      class="org.jboss.soa.esb.actions.soap.SOAPClient">
      <property name="wsdl" value="http://127.0.0.1:8081/MyWS-War/services/MyWS?wsdl" />
      <property name="operation" value="myOper" />
      <property name="responseAsOgnlMap" value="true" />
      <property name="SOAPAction" value="myOper"/>
      </action>
      


      When i use JBossWS its works. I test the webservice_consumer1 in the quickstarts examples with any port (80, 8081) and no problem. The problem is with axis web services.

      Any idea?? Is possible to change the port that SOAPClient is using?? How??

      Thanks!!!

        • 1. Re: Port problem invoking a external web service with SOAPCl
          toby saville Novice

          Hello,

          I have the same java.net.ConnectException:Connection Refused problem sometimes, however i'm running on port 80. My config is:

          <action name="soapui-client" class="org.jboss.soa.esb.actions.soap.SOAPClient">
           <property name="wsdl" value="http://activation.staging.uk.easynet.com/xng/services/web?wsdl"/>
           <property name="SOAPAction" value="xngCommission"/>
           <property name="operation" value="xngCommission"/>
          </action>
          

          Error in server.log:
          2008-01-11 11:37:59,216 WARN [org.jboss.soa.esb.listeners.message.ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Address jms://esb.local.uk.easynet.com/queue/activation_inbound_xng_commision_channel_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : jnp://esb.local.uk.easynet.com:1099/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ClusteredConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : 1/> > ] ReplyTo: JMSEpr [ PortReference < <wsa:Address jms://esb.local.uk.easynet.com/queue/om_om_channel_esb_reply/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : jnp://esb.local.uk.easynet.com:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ClusteredConnectionFactory/>, <wsa:ReferenceProperties jbossesb:message-selector : jbossESBresponseUUID='b58119ab-be52-4958-960f-c0c30ecea8fa'/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : 1/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: ID:JBM-94215 RelatesTo: jms:correlationID#f718b89d-8341-433f-97e4-be46482007d3 ]
          org.jboss.soa.esb.actions.ActionProcessingException: Failed to invoke SOAP Endpoint: 'http://activation.staging.uk.easynet.com/xng/services/web ' - 'xngCommission'.
           at org.jboss.soa.esb.actions.soap.SOAPClient.invokeEndpoint(SOAPClient.java:382)
           at org.jboss.soa.esb.actions.soap.SOAPClient.process(SOAPClient.java:338)
           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:595)
          Caused by: java.net.ConnectException: Connection refused: connect
           at java.net.PlainSocketImpl.socketConnect(Native Method)
           at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
           at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
           at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
           at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
           at java.net.Socket.connect(Socket.java:516)
           at java.net.Socket.connect(Socket.java:466)
           at java.net.Socket.<init>(Socket.java:366)
           at java.net.Socket.<init>(Socket.java:239)
           at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(Unknown Source)
           at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(Unknown Source)
           at org.apache.commons.httpclient.HttpConnection.open(Unknown Source)
           at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown Source)
           at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown Source)
           at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
           at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
           at org.jboss.soa.esb.actions.soap.SOAPClient.invokeEndpoint(SOAPClient.java:375)
           ... 6 more
          
          


          cheers,
          toby

          • 2. Re: Port problem invoking a external web service with SOAPCl
            Kevin Conner Master

            The endpoint should be derived from the WSDL generated by your AXIS service. Can you generate the WSDL and send it to me?

            • 3. Re: Port problem invoking a external web service with SOAPCl
              Kevin Conner Master

              Toby, your issue is different and may be another symptom of the recent concurrency issues. I did update your case yesterday but our system is being migrated over to another platform today.

              Can you enable DEBUG logging for the following class and send me the log for the next failure?

              The class you should enable is org.apache.commons.httpclient.HttpConnection.

              Thanks

              • 4. Re: Port problem invoking a external web service with SOAPCl
                toby saville Novice

                will do Kevin, thanks for the update.

                • 5. Re: Port problem invoking a external web service with SOAPCl
                  Ron Newbie

                  Kevin, The WSDL generated by axis is:

                  <?xml version="1.0" encoding="UTF-8"?>
                  <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns0="http://test.medium.company.com" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://test.medium.company.com">
                   <wsdl:documentation>
                   Please Type your service description here
                   </wsdl:documentation>
                   <wsdl:types>
                   <xs:schema xmlns:ns="http://test.medium.company.com" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://test.medium.company.com">
                   <xs:element name="mediumService">
                   <xs:complexType>
                   <xs:sequence>
                   <xs:element minOccurs="0" name="xmlMessage" nillable="true" type="xs:string"/>
                   </xs:sequence>
                   </xs:complexType>
                   </xs:element>
                   <xs:element name="mediumServiceResponse">
                   <xs:complexType>
                   <xs:sequence>
                   <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
                   </xs:sequence>
                   </xs:complexType>
                   </xs:element>
                  </xs:schema>
                   </wsdl:types>
                   <wsdl:message name="mediumServiceRequest">
                   <wsdl:part name="parameters" element="ns0:mediumService"/>
                   </wsdl:message>
                   <wsdl:message name="mediumServiceResponse">
                   <wsdl:part name="parameters" element="ns0:mediumServiceResponse"/>
                   </wsdl:message>
                   <wsdl:portType name="MediumWSPortType">
                   <wsdl:operation name="mediumService">
                   <wsdl:input message="ns0:mediumServiceRequest" wsaw:Action="urn:mediumService"/>
                   <wsdl:output message="ns0:mediumServiceResponse" wsaw:Action="urn:mediumServiceResponse"/>
                   </wsdl:operation>
                   </wsdl:portType>
                   <wsdl:binding name="MediumWSSOAP11Binding" type="ns0:MediumWSPortType">
                   <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
                   <wsdl:operation name="mediumService">
                   <soap:operation soapAction="urn:mediumService" style="document"/>
                   <wsdl:input>
                   <soap:body use="literal"/>
                   </wsdl:input>
                   <wsdl:output>
                   <soap:body use="literal"/>
                   </wsdl:output>
                   </wsdl:operation>
                   </wsdl:binding>
                   <wsdl:binding name="MediumWSSOAP12Binding" type="ns0:MediumWSPortType">
                   <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
                   <wsdl:operation name="mediumService">
                   <soap12:operation soapAction="urn:mediumService" style="document"/>
                   <wsdl:input>
                   <soap12:body use="literal"/>
                   </wsdl:input>
                   <wsdl:output>
                   <soap12:body use="literal"/>
                   </wsdl:output>
                   </wsdl:operation>
                   </wsdl:binding>
                   <wsdl:binding name="MediumWSHttpBinding" type="ns0:MediumWSPortType">
                   <http:binding verb="POST"/>
                   <wsdl:operation name="mediumService">
                   <http:operation location="MediumWS/mediumService"/>
                   <wsdl:input>
                   <mime:content type="text/xml" part="mediumService"/>
                   </wsdl:input>
                   <wsdl:output>
                   <mime:content type="text/xml" part="mediumService"/>
                   </wsdl:output>
                   </wsdl:operation>
                   </wsdl:binding>
                   <wsdl:service name="MediumWS">
                   <wsdl:port name="MediumWSSOAP11port_http" binding="ns0:MediumWSSOAP11Binding">
                   <soap:address location="http://127.0.0.1:8081/MediumWS-War/services/MediumWS"/>
                   </wsdl:port>
                   <wsdl:port name="MediumWSSOAP12port_http" binding="ns0:MediumWSSOAP12Binding">
                   <soap12:address location="http://127.0.0.1:8081/MediumWS-War/services/MediumWS"/>
                   </wsdl:port>
                   <wsdl:port name="MediumWSHttpport" binding="ns0:MediumWSHttpBinding">
                   <http:address location="http://127.0.0.1:8081/MediumWS-War/services/MediumWS"/>
                   </wsdl:port>
                   </wsdl:service>
                  </wsdl:definitions>
                  


                  The soapui-client config asociated to the WSDL is:

                  <action name="soapui-client-action"
                   class="org.jboss.soa.esb.actions.soap.SOAPClient">
                   <property name="wsdl" value="http://127.0.0.1:8081/MediumWS-War/services/MediumWS?wsdl" />
                   <property name="operation" value="mediumService" />
                   <property name="responseAsOgnlMap" value="true" />
                   <property name="SOAPAction" value="mediumService"/>
                   </action>
                  


                  I thought that the problem is because the ESB and the Axis Web Service were in the same JBoss AppServer, but i moved the WS to an Apache Tomcat Web Server and the same problem is presented. I forgot to publish my complete configuration:

                  - JBoss AppServer 4.2.1
                  - JBoss ESB 4.2.1.
                  - JBossWS 2.0.0 native.



                  • 6. Re: Port problem invoking a external web service with SOAPCl
                    Kevin Conner Master

                    Thanks, I'll go through this later and get back to you.