Problem with jax-ws client

I created the jax-ws client by running the command:

  C: \ wsdl> wsimport -keep -verbose -d generated HealthMobilitySequenceArtifacts.wsdl

Service address in wsdl file:

  soap: address location = "http: // localhost: 8585 / active-bpel / services / HealthMobilitySequence

Well, I packed the generated files in the jar ( clentjaxw.jar ), and I use it as an imported library in the eclipse project for some tests.

The fact is that I can do my tests without problems, but when I provide clientjaxw.jar to a colleague, at runtime it has the following error:

  Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection refused: connect
         at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput (Unknown Source)
         at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process (Unknown Source)
         at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest (Unknown Source)
         at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest (Unknown Source)
         at com.sun.xml.internal.ws.api.pipe.Fiber .__ doRun (Unknown Source)
         at com.sun.xml.internal.ws.api.pipe.Fiber._doRun (Unknown Source)
         at com.sun.xml.internal.ws.api.pipe.Fiber.doRun (Unknown Source)
         at com.sun.xml.internal.ws.api.pipe.Fiber.runSync (Unknown Source)
         at com.sun.xml.internal.ws.client.Stub.process (Unknown Source)
         at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess (Unknown Source)
         at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke (Unknown Source)
         at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke (Unknown Source)
         at com.sun.xml.internal.ws.client.sei.SEIStub.invoke (Unknown Source)
         at $ Proxy29.bookTreatment (Unknown Source)
         at test.TestJaxWS.main (TestJaxWS.java:32)
     Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect (Native Method)
         at java.net.PlainSocketImpl.doConnect (Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress (Unknown Source)
         at java.net.PlainSocketImpl.connect (Unknown Source)
         at java.net.SocksSocketImpl.connect (Unknown Source)
         at java.net.Socket.connect (Unknown Source)
         at java.net.Socket.connect (Unknown Source)
         at sun.net.NetworkClient.doConnect (Unknown Source)
         at sun.net.www.http.HttpClient.openServer (Unknown Source)
         at sun.net.www.http.HttpClient.openServer (Unknown Source)
         at sun.net.www.http.HttpClient. (Unknown Source)
         at sun.net.www.http.HttpClient.New (Unknown Source)
         at sun.net.www.http.HttpClient.New (Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient (Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect (Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect (Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getOutputStream (Unknown Source)
         ... 15 more

I do not understand the problem: nevertheless, the college can visualize the service in the browser at this address, and also starts ping localhost. Moreover, I checked that it is not behind the proxy.

Do you have some ideas about the cause of the problem?


UPDATE: I have to add new data: I found that the college has access to the browser through: http: // localhost: 8585 / active-bpel / services / HealthMobilitySequence? Wsdl , but if it tries to access: http: //127.0. 0.1: 8585 / active-bpel / services / HealthMobilitySequence? wsdl or the same URL with an IP address instead of the local host, it fails. On my machine, I do not have such a problem, I can access with all the features: localhost, machine name, 127.0.0.1, ipaddress.

So, I think this may be a problem, I mean, I can imagine that through java the URL http: // localhost: 8585 / active-bpel / services / HealthMobilitySequence is translated before opening the java socket , in the new one, using the ip address (or 127.0.0.1) instead of the local host, and access failure. Thus, it seems that the problem is related to the operating system, since we share the exact same configuration as part of the operating system (win xp on my machine, Vista on our own).

Some ideas? Thanks


UPDATE: Hi, for some reason, changing the machine (always 64 bits), the college solved the problem that I described. In any case, he has another problem that is not client dependent, since he experienced the same thing, causing the use of eclipse web explorer. The exception is the following: java.lang.ClassCastException: com.sun.xml.internal.messaging.saaj.soap.ver1_1.Envelope1_1Impl cannot be passed to java.lang.String

  org.apache.axis.SOAPPart.getAsString(SOAPPart.java:554) org.apache.axis.SOAPPart.writeTo(SOAPPart.java:322) org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269) org.apache.axis.Message.writeTo(Message.java:539) org.apache.axis.transport.http.AxisServlet.sendResponse(AxisServlet.java:902) org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:777) javax.servlet.http.HttpServlet.service(HttpServlet.java:647) org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 

Please note that the web service it invokes calls one of the bpel processes deployed to ActiveBPEL (version 5.0.2) running in Tomcat 5.5.27. In addition, its configuration is as follows: OP: windows 7, jdk: 1.6, arch: 64 bits, while mine: OP: windows xp, jdk: 1.6, arch: 32 bits. Do you have any idea about the problem?

Thank you in advance

+4
source share
1 answer

I just ran into this problem when creating and testing ActiveBPEL code. My solution was to explicitly map java.xml.soap.MessageFactory to implement Axis. This avoids incompatibility between the two SOAP packages.

Display can be done in several different ways.

  • Use the system property -Djavax.xml.soap.MessageFactory = org.apache.axis.soap.MessageFactoryImpl
  • Include the factory file in the class path: /META-INF/javax.xml.soap.MessageFactory, where the contents of this file are a single line of text: org.apache.axis.soap.MessageFactoryImpl

If you create an AE source, the latter is the preferred mechanism and can be added to the org.activebpel.rt.axis.bpel project. If you use binaries, you probably need to create a custom property when you run the script for your container (Tomcat / Jetty).

+1
source

Source: https://habr.com/ru/post/1369457/


All Articles