You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christopher Cheng <li...@christophercheng.com> on 2014/05/25 09:35:07 UTC

java.net.SocketTimeoutException: SocketTimeoutException invoking http://api.ean.com/ean-services/rs/hotel/v3/ping: Read Timeout

I am using a CXF 2.7 and try a very simple REST call with this and return
the SocketTimeoutException, but I am able to use Chrome to see the results
with " http://api.ean.com/ean-services/rs/hotel/v3/ping". 
What's the problem?

WebClient client =
WebClient.create("http://api.ean.com/ean-services/rs/hotel/v3/");
client.path("ping");
client.type("text/xml").accept("text/xml");
System.out.println(client.get(String.class));

Caused by: java.net.SocketTimeoutException: SocketTimeoutException invoking
http://api.ean.com/ean-services/rs/hotel/v3/ping: Read Timeout
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
	at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:57)
	at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(H
TTPConduit.java:1359)


RE: java.net.SocketTimeoutException: SocketTimeoutException invoking http://api.ean.com/ean-services/rs/hotel/v3/ping: Read Timeout

Posted by XiLai Dai <xl...@talend.com>.
Hi,

Seems the address in WebClient.create() doesn't match the endpoint which your REST service exposed:

Available RESTful services:
Endpoint address: http://localhost:7400/ean-services/rs/hotel/v3
WADL : http://localhost:7400/ean-services/rs/hotel/v3?_wadl

Regards.

-----Original Message-----
From: Christopher Cheng [mailto:lists@christophercheng.com] 
Sent: Sunday, May 25, 2014 3:35 PM
To: users@cxf.apache.org
Subject: java.net.SocketTimeoutException: SocketTimeoutException invoking http://api.ean.com/ean-services/rs/hotel/v3/ping: Read Timeout

I am using a CXF 2.7 and try a very simple REST call with this and return the SocketTimeoutException, but I am able to use Chrome to see the results with " http://api.ean.com/ean-services/rs/hotel/v3/ping". 
What's the problem?

WebClient client =
WebClient.create("http://api.ean.com/ean-services/rs/hotel/v3/");
client.path("ping");
client.type("text/xml").accept("text/xml");
System.out.println(client.get(String.class));

Caused by: java.net.SocketTimeoutException: SocketTimeoutException invoking
http://api.ean.com/ean-services/rs/hotel/v3/ping: Read Timeout
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
	at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:57)
	at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(H
TTPConduit.java:1359)