4 Replies Latest reply on Mar 7, 2003 9:18 PM by 3004

    "Connection refused" when using Java client for Web Service

    3004

      I deployed a web service to Weblogic Server 7.0 running on Windows 2000. I can
      use IE browser to see its WSDL perfectly but when I run the Java client, the proxy
      method call generates the following error:


      java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
      at java.net.Socket.connect(Socket.java:426)
      at java.net.Socket.connect(Socket.java:376)
      at java.net.Socket.<init>(Socket.java:291)
      at java.net.Socket.<init>(Socket.java:119)
      at weblogic.webservice.binding.soap.HttpClientBinding.createSocket(HttpC
      lientBinding.java:412)
      at weblogic.webservice.binding.soap.HttpClientBinding.createSocket(HttpC
      lientBinding.java:390)
      at weblogic.webservice.binding.soap.HttpClientBinding.send(HttpClientBin
      ding.java:246)
      at weblogic.webservice.core.handler.ClientHandler.handleRequest(ClientHa
      ndler.java:34)
      at weblogic.webservice.core.HandlerChain.handleRequest(HandlerChain.java
      :131)
      at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
      a:417)
      at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
      a:359)
      at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:225)
      at weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
      181)
      at weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
      207)
      at CenterWSClient.main(CenterWSClient.java:73)
      javax.xml.rpc.JAXRPCException: Failed to send request:java.net.ConnectException:
      Connection refused: connect
      at weblogic.webservice.core.handler.ClientHandler.handleRequest(ClientHa
      ndler.java:37)
      at weblogic.webservice.core.HandlerChain.handleRequest(HandlerChain.java
      :131)
      at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
      a:417)
      at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
      a:359)
      at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:225)
      at weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
      181)
      at weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
      207)
      at CenterWSClient.main(CenterWSClient.java:73)
      Exception in handler's handleRequest().
      java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: Conn
      ection refused: connect; nested exception is:
      javax.xml.rpc.soap.SOAPFaultException: Connection refused: connect
      at weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
      186)
      at weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
      207)
      at CenterWSClient.main(CenterWSClient.java:73)
      Caused by: javax.xml.rpc.soap.SOAPFaultException: Connection refused: connect
      at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
      a:459)
      at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
      a:359)
      at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:225)
      at weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
      181)
        • 1. Re: "Connection refused" when using Java client for Web Service
          3004
          In your client program, when you do "new XXX_Impl(String wsdlurl)", did you
          pass in the wsdl you were hitting with browser?

          -Neal


          "Ray Yan" <ray_y_yan@hotmail.com> wrote in message
          news:3e67a421$1@newsgroups.bea.com...
          >
          I deployed a web service to Weblogic Server 7.0 running on Windows 2000. I
          can
          use IE browser to see its WSDL perfectly but when I run the Java client,
          the proxy
          method call generates the following error:


          java.net.ConnectException: Connection refused: connect
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
          at
          java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
          at java.net.Socket.connect(Socket.java:426)
          at java.net.Socket.connect(Socket.java:376)
          at java.net.Socket.<init>(Socket.java:291)
          at java.net.Socket.<init>(Socket.java:119)
          at
          weblogic.webservice.binding.soap.HttpClientBinding.createSocket(HttpC
          lientBinding.java:412)
          at
          weblogic.webservice.binding.soap.HttpClientBinding.createSocket(HttpC
          lientBinding.java:390)
          at
          weblogic.webservice.binding.soap.HttpClientBinding.send(HttpClientBin
          ding.java:246)
          at
          weblogic.webservice.core.handler.ClientHandler.handleRequest(ClientHa
          ndler.java:34)
          at
          weblogic.webservice.core.HandlerChain.handleRequest(HandlerChain.java
          :131)
          at
          weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
          a:417)
          at
          weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
          a:359)
          at
          weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:225)
          at
          weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
          181)
          at
          weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
          207)
          at CenterWSClient.main(CenterWSClient.java:73)
          javax.xml.rpc.JAXRPCException: Failed to send
          request:java.net.ConnectException:
          Connection refused: connect
          at
          weblogic.webservice.core.handler.ClientHandler.handleRequest(ClientHa
          ndler.java:37)
          at
          weblogic.webservice.core.HandlerChain.handleRequest(HandlerChain.java
          :131)
          at
          weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
          a:417)
          at
          weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
          a:359)
          at
          weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:225)
          at
          weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
          181)
          at
          weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
          207)
          at CenterWSClient.main(CenterWSClient.java:73)
          Exception in handler's handleRequest().
          java.rmi.RemoteException: SOAP
          Fault:javax.xml.rpc.soap.SOAPFaultException: Conn
          ection refused: connect; nested exception is:
          javax.xml.rpc.soap.SOAPFaultException: Connection refused: connect
          at
          weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
          186)
          at
          weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
          207)
          at CenterWSClient.main(CenterWSClient.java:73)
          Caused by: javax.xml.rpc.soap.SOAPFaultException: Connection refused:
          connect
          at
          weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
          a:459)
          at
          weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
          a:359)
          at
          weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:225)
          at
          weblogic.jws.proxies.CenterWSSoap_Stub.update(CenterWSSoap_Stub.java:
          181)
          • 2. Re: "Connection refused" when using Java client for Web Service
            3004

            Neal,

            I did cut and paste the URL with ?WSDL into the Java client program as follows:

            http://localhost:7001/vendorservices/.../CenterWS.jws?WSDL

            This URL works fine in the IE browser and I get the complete WSDL back.

            Thanks for your quick response!

            Ray

            "Neal Yin" <nyin@bea.com> wrote:
            In your client program, when you do "new XXX_Impl(String wsdlurl)", did
            you
            pass in the wsdl you were hitting with browser?

            -Neal


            "Ray Yan" <ray_y_yan@hotmail.com> wrote in message
            news:3e67a421$1@newsgroups.bea.com...
            I deployed a web service to Weblogic Server 7.0 running on Windows
            2000. I
            can
            use IE browser to see its WSDL perfectly but when I run the Java client,
            the proxy
            method call generates the following error:

            • 3. Re: "Connection refused" when using Java client for Web Service
              3004
              From the stack trace I can tell that actually client already got the wsdl,
              it failed when invoking the service. In wsdl's service port address section,
              please check if that address is actually accessible to client.

              -Neal



              "Ray Yan" <ray_y_yan@hotmail.com> wrote in message
              news:3e67db21$1@newsgroups.bea.com...
              >
              Neal,

              I did cut and paste the URL with ?WSDL into the Java client program as
              follows:
              >
              http://localhost:7001/vendorservices/.../CenterWS.jws?WSDL

              This URL works fine in the IE browser and I get the complete WSDL back.

              Thanks for your quick response!

              Ray

              "Neal Yin" <nyin@bea.com> wrote:
              In your client program, when you do "new XXX_Impl(String wsdlurl)", did
              you
              pass in the wsdl you were hitting with browser?

              -Neal


              "Ray Yan" <ray_y_yan@hotmail.com> wrote in message
              news:3e67a421$1@newsgroups.bea.com...
              I deployed a web service to Weblogic Server 7.0 running on Windows
              2000. I
              can
              use IE browser to see its WSDL perfectly but when I run the Java
              client,
              the proxy
              method call generates the following error:

              • 4. Re: "Connection refused" when using Java client for Web Service
                3004

                Neal,

                Thanks for your responses!

                I finally figured out what the problem is --
                We developed the jws files and other Java bean classes in Weblogic Workshop, and
                then used jwsCompile to package the whole application in an EAR file. Then we
                shut down the workshop and started the server in production mode on the same Windows
                2000 development workstation. Finally we used the console to deploy the EAR to
                the server and successfully used the Java client to access the web service.

                After all this is done, I went back to Workshop to modify and run the same jws
                file. That's when things start to fall apart. To fix it, I had to shutdown Workshop,
                restart the server in production mode, undeploy and delete the application, and
                then shut down the server, go back to Workshop, rerun the jws file in debug mode
                in Workshop, shut down Workshop, recompile the jws files into EAR, restart the
                server in production mode, redeploy the application and voila!

                The key point is you have to delete the application from production server before
                going back to Workshop to run/debug the same application.

                Ray


                "Neal Yin" <nyin@bea.com> wrote:
                From the stack trace I can tell that actually client already got the
                wsdl,
                it failed when invoking the service. In wsdl's service port address section,
                please check if that address is actually accessible to client.

                -Neal



                "Ray Yan" <ray_y_yan@hotmail.com> wrote in message
                news:3e67db21$1@newsgroups.bea.com...
                Neal,

                I did cut and paste the URL with ?WSDL into the Java client program
                as
                follows:
                http://localhost:7001/vendorservices/.../CenterWS.jws?WSDL

                This URL works fine in the IE browser and I get the complete WSDL back.

                Thanks for your quick response!

                Ray

                "Neal Yin" <nyin@bea.com> wrote:
                In your client program, when you do "new XXX_Impl(String wsdlurl)",
                did
                you
                pass in the wsdl you were hitting with browser?

                -Neal


                "Ray Yan" <ray_y_yan@hotmail.com> wrote in message
                news:3e67a421$1@newsgroups.bea.com...
                I deployed a web service to Weblogic Server 7.0 running on Windows
                2000. I
                can
                use IE browser to see its WSDL perfectly but when I run the Java
                client,
                the proxy
                method call generates the following error: