Spring consuming-ws: Exception: java.net.ConnectException: Connection refused (Connection refused) - web-services

I run my spring ws application downloaded from official spring.io web site, and it gives me following error
Please help me, cant understand what's problem?
P.s: It is consuming web service, building on maven,
and "http://www.webservicex.com/stockquote.asmx?WSDL" works if call via browser

Related

scribe oauth connection refused

I am trying to use scribe. Just copied the Facebook example it asked to paste the code, which I got in request after login to FB. as below
And paste the authorization code here
AQB7XIMSqkD_OjE_bbHAz4nWQxkuWrQLUmCsYcw5VW4Tlxti3PEA-8F7YGNLKhonX0tBzA2GaXpt7Mz7ym83j4aeXc6kCHurqSRVbB8DpXSjnnkh3cm3XwUHJEfuOeo3Zf_gEFOtlJDvET-b38ECz4Y4jke5gCSmu9NIndG376M4r4siNXGopHq8VO4fQSw9tg_1O27GR3CNSbKVrx1Mk-GqPIhVHg28Zt5zikthZ7l9t8zI_nXIo6T3F17FJxQGMT8NZL8kGh4fUmGAMKCHouP964b_67F6ddQ3K6u1C4KNdSfNiLY76Qude8OWtweeK1Tou29hvs1iJojuMaWEs8Va
I am getting this error.
Trading the Request Token for an Access Token...
Exception in thread "main" org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service.
at org.scribe.model.Request.send(Request.java:70)
at org.scribe.model.Request.send(Request.java:76)
at org.scribe.oauth.OAuth20ServiceImpl.getAccessToken(OAuth20ServiceImpl.java:36)
at com.ibm.fb.FacebookExample.main(FacebookExample.java:36)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:80)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:369)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:176)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:402)
at java.net.Socket.connect(Socket.java:590)
at com.ibm.jsse2.qc.connect(qc.java:559)
at com.ibm.jsse2.pc.connect(pc.java:47)
at sun.net.NetworkClient.doConnect(NetworkClient.java:192)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:407)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:502)
at com.ibm.net.ssl.www2.protocol.https.c.<init>(c.java:60)
at com.ibm.net.ssl.www2.protocol.https.c.a(c.java:62)
at com.ibm.net.ssl.www2.protocol.https.d.getNewHttpClient(d.java:6)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:940)
at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:63)
at com.ibm.net.ssl.www2.protocol.https.b.connect(b.java:76)
at org.scribe.model.Response.<init>(Response.java:29)
at org.scribe.model.Request.doSend(Request.java:117)
at org.scribe.model.Request.send(Request.java:66)
... 3 more
Someone please point out where its going wrong.
Regards.
Adeeb

Web service Axis2 client code generation issue

I'm trying the consume a web services built using Axis2, so I have followed this example for creating client code.
I have the endpoint and I'm able to access it through the browser. But trying to generate the client code with:
WSDL2Java.bat -uri <<endpoint>> -o client
throws the exception below:
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.(CodeGenerationEngine.java:181)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:570)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:411)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:525)
at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:272)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:923)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318)
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.(CodeGenerationEngine.java:99)
... 2 more
What could be the reason for this error?
If you can access the WSDL from a browser but not from the tool in command line then it's possible that your browser uses a HTTP proxy for it's connection while wsdl2java goes straight for the address.
Try setting some JVM parameters for using a proxy, as described in Java Networking and Proxies and if that fails, there is always the option to download the WSDL with the browser and run wsdl2java with the locally downloaded file.

Migrating web service from ColdFusion 8 to 10 issues

I have a web service that has been running on CF 8 for awhile now without issues. We've recently moved to CF10, and this web service no longer works. I've already tried switching the Axis setting to 1, it's still tossing errors. Has anyone else encountered this, or have an ideas on what else to look for here?
Process:
CF Server sends a web service request to App Server.
App Server processes request, generates another web service back to CF Server with SOAP data pushes, then replies back to the step 1 originating request with a boolean response on how its own web service request went.
CF Server Errors:
The web service operation caused an invocation exception.The root cause was that: ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error.
Cannot perform web service invocation [Method Name]. The fault returned when invoking the web service operation is: java.lang.NoClassDefFoundError: org/apache/james/mime4j/MimeException
App Server Error Logs:
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
SEVERE: SAAJ0009: Message send failed
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
Caused by: java.io.IOException: Error writing to server
I've gone as far as modifying the App Server configuration to have it's web service request push out to the CF 8 server for processing, while still replying back to the originating request from the CF 10 server. This worked fine. It's definitely something with the requests or my CF 10 web service config.
I can't post any of the code examples unfortunately.
24 Sept 13 Update
I've tried various combinations of v1 and v2 in the CF admin, with wsdl and wsdl2, and the application.cfc setup. The app that is interacting with this service has given me the ability to modify a variety of parameters for soap versioning and some internal items. I can get the two services to talk with a bare bones connection of give me your soap and I'll toss a YES back. Whenever I try to use the full request it seems to never actually hit my web service, and gets stopped somewhere by CF. I see no logging on it other than in the web service log.
I found the solution to my problem. The ColdFusion connector was causing the fault. After installing ColdFusion 10 and patching, I had run the wsconfig to rebuild the connector. I had either done this incorrectly, or for some reason it didn't take. I ran it this morning, removed the connector, re-added it.... everything working fine now. Very frustrating.

Weblogic WebService client dependencies

I would like to ask which would be the correct jar files needed to a functional ws client to an authenticated weblogic JAX-RPC.
Situation:
I created the same WS client on Jdeveloper and on OEPE. When I run in the IDE, my client only works on Jdeveloper. Then I generated a Jar file from Jdeveloper and the same error from OEPE ocurrs when I run that jar.
I suppose this happens because there are some libs missing. I really need help! After putting many libs on the classpath, this is the mistake:
"Exception in thread "main" javax.xml.rpc.ServiceException: Failed to
parse WSDL htp://url?WSDL weblogic.wsee.wsdl.WsdlException: Failed to
read wsdl file from url due to -- java.net.ConnectException:
Connection refused: connect
at weblogic.wsee.jaxrpc.ServiceImpl.throwServiceException(ServiceImpl.java:185)
at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:492)
at weblogic.wsee.jaxrpc.ServiceImpl.(ServiceImpl.java:126)
at br.com.scopus.teste.ServicoAssinaturaImplService_Impl.(ServicoAssinaturaImplService_Impl.java:21)
at br.com.scopus.teste.Client.main(Client.java:26) Caused by: weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url d
ue to -- java.net.ConnectException: Connection refused: connect
at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:313)
at weblogic.wsee.wsdl.internal.WsdlDefinitionsImpl.parse(WsdlDefinitions
Impl.java:432)
at weblogic.wsee.wsdl.internal.WsdlDefinitionsImpl.parse(WsdlDefinitions
Impl.java:417)
at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:81)
at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:68)
at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:
483)
... 3 more"
Maybe Important information:
These are the jar I am using: wlfullclient.jar wsclient.jar adf-config.xml weblogic.jar wseeclient.jar wsclient_extended.jar glassfish.jaxws.rt_1.2.0.0_2-1-5.jar
Weblogic version: 10.3.5
Thanks!
This is probably not a library issue.
You are getting "java.net.ConnectException: Connection refused". So the web service stack managed to perform the call to the WSDL URL but couldn't get through. One reason could be that your URL is incorrect, referring the incorrect interface (localhost rather than actual hostname or vice versa) or anything else.
Try to copy-paste the URL it is telling you it can't access in a web-browser and you should see the same problem.

JBossWS 3.3.1 upgrade client returns HTTP 404 Not Found exception

Web service - Service is on WAS v7. Client is on JBoss v5. We recently upgraded to JBossWS 3.3.1. Since then the client is unable to communicate with the service on WAS.
Without any changes to code, we get the below exception
2012-01-19 14:42:15,317 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS]->error#419 (ajp-cwsappdev01%2F205.132.14.29-8109-1)
SOAP request exception java.io.IOException:
Error initializing socket factory SSL context: Can not find truststore url.
Added the following lines of code to the client:
((BindingProvider) impl).getRequestContext().put(StubExt.PROPERTY_KEY_STORE, "/usr/local/jee/.../cacerts"));
((BindingProvider) impl).getRequestContext().put(StubExt.PROPERTY_KEY_STORE_PASSWORD, "*****"));
((BindingProvider) impl).getRequestContext().put(StubExt.PROPERTY_CHUNKED_ENCODING_SIZE, "0");
After making the code change, am getting the below error:
Caused by: org.jboss.ws.WSException: Invalid HTTP server response [404] - Not Found
Any ideas? I added the chunked encoding property, as WAS does not support it properly. Any other incompatibility between JBoss and WebSphere App Server?
Thanks for your help in advance!
==================
I made some code changes and am now getting the below message. I use JBossWS-Native 3.3.1 and JAX-WS 2.1 versions. Does any one know how I can disable chunked encoding in JBoss?
File standard-jaxws-client-config.xml moved into one of JBoss the core JARS - updating it would need me to 'unjar' - edit file - and jar back again.
2012-01-24 10:35:57,930 WARN [org.jboss.ws.core.client.transport.NettyClient]->warn#352 (ajp-cwsappdev01%2F205.132.14.29-8109-4) Can't set chunk size from call properties, illegal value provided!
2012-01-24 10:35:58,001 ERROR [org.jboss.ws.core.CommonClient]->error#419 (ajp-cwsappdev01%2F205.132.14.29-8109-4) Exception caught while (preparing for) performing the invocation:
java.io.IOException: Could not transmit message
at org.jboss.ws.core.client.transport.NettyClient.invokeInternal(NettyClient.java:229)
at org.jboss.ws.core.client.transport.NettyClient.invoke(NettyClient.java:121)
at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:150)
at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:69)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:369)
at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:181)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:161)
at $Proxy796.getCWSAccount(Unknown Source)
Cause: Although the client had port specified as 8004 in the endpoint URL; when the request hit the service it was coming in for port 443. We moved/"attached" the service to port 443 and the web server was able to map it to the right application. will need to figure out why/where the endpoint was changed fro 8004 to 443..