Hi, at the moment, there are two technologies one can use to build RESTful
services in CXF, namely CXF HTTP Binding and CXF JSR-311 (JAX-RS). Sedo is
actually using CXF HTTP Binding, while Barry is refering to CXF JSR-311
(because the @ConsumeMime annotation only exists in JSR-311). I know this is
a bit confusing, well the basic message we can send out is that people are
encouraged to move to CXF JSR-311, because it is standard based and the
development activities around CXF JSR-311 impl are much more active than CXF
Http binding. 

Sedo, to answer your question, the stack trace shows that your server is not
responding. Check your server port number and address, or if there is any
exceptions in your server console. 

Hope this helps,
Jervis


sedo wrote:
> 
> Hmm, still doesn't works for me :-/
> using latest release 2.0.4
> 
> 
> 
> 
> Barry Fitzgerald wrote:
>> 
>> Hi,
>> 
>> I had this problem too with the latest snapshot. I added a
>> @ConsumeMime("text/xml") to the method and it seemed to fix it.
>> 
>> Barry
>> 
>> On Feb 1, 2008 11:37 AM, sedo <[EMAIL PROTECTED]> wrote:
>> 
>>>
>>> I write my own sample according to restful_http_binding
>>> But when using Client and addCustomer(Customer c) method, it throws
>>> something like this:
>>> (same thing when I add addCustomer method to the client in cxf sample):
>>> pls help :-/
>>>
>>> org.apache.cxf.phase.PhaseInterceptorChain doIntercept
>>> INFO: Interceptor has thrown exception, unwinding now
>>> org.apache.cxf.interceptor.Fault: Could not send Message.
>>>        at
>>>
>>> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage
>>> (MessageSenderInterceptor.java:64)
>>>        at
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
>>> PhaseInterceptorChain.java:207)
>>>        at
>>>
>>> org.apache.cxf.binding.http.interceptor.DatabindingOutSetupInterceptor.handleMessage
>>> (DatabindingOutSetupInterceptor.java:91)
>>>        at
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
>>> PhaseInterceptorChain.java:207)
>>>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
>>>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
>>>        at
>>> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>>>        at
>>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
>>>        at $Proxy25.addPerson(Unknown Source)
>>>        at sk.posam.ws.restwebservice.client.Client.main(Client.java:43)
>>> Caused by: java.net.SocketTimeoutException: Read timed out
>>>        at java.net.SocketInputStream.socketRead0(Native Method)
>>>        at java.net.SocketInputStream.read(Unknown Source)
>>>        at java.io.BufferedInputStream.fill(Unknown Source)
>>>        at java.io.BufferedInputStream.read1(Unknown Source)
>>>        at java.io.BufferedInputStream.read(Unknown Source)
>>>        at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
>>>        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
>>>        at
>>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
>>> Source)
>>>        at java.net.HttpURLConnection.getResponseCode(Unknown Source)
>>>        at
>>>
>>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse
>>> (HTTPConduit.java:1863)
>>>        at
>>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
>>> HTTPConduit.java:1791)
>>>        at
>>> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
>>>        at
>>> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
>>>        at
>>>
>>> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage
>>> (MessageSenderInterceptor.java:62)
>>>        ... 9 more
>>> Exception in thread "main" javax.xml.ws.http.HTTPException
>>>        at
>>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:147)
>>>        at $Proxy25.addPerson(Unknown Source)
>>>        at sk.posam.ws.restwebservice.client.Client.main(Client.java:43)
>>> Caused by: org.apache.cxf.interceptor.Fault: Could not send Message.
>>>        at
>>>
>>> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage
>>> (MessageSenderInterceptor.java:64)
>>>        at
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
>>> PhaseInterceptorChain.java:207)
>>>        at
>>>
>>> org.apache.cxf.binding.http.interceptor.DatabindingOutSetupInterceptor.handleMessage
>>> (DatabindingOutSetupInterceptor.java:91)
>>>        at
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
>>> PhaseInterceptorChain.java:207)
>>>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
>>>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
>>>        at
>>> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>>>        at
>>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
>>>        ... 2 more
>>> Caused by: java.net.SocketTimeoutException: Read timed out
>>>        at java.net.SocketInputStream.socketRead0(Native Method)
>>>        at java.net.SocketInputStream.read(Unknown Source)
>>>        at java.io.BufferedInputStream.fill(Unknown Source)
>>>        at java.io.BufferedInputStream.read1(Unknown Source)
>>>        at java.io.BufferedInputStream.read(Unknown Source)
>>>        at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
>>>        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
>>>        at
>>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
>>> Source)
>>>        at java.net.HttpURLConnection.getResponseCode(Unknown Source)
>>>        at
>>>
>>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse
>>> (HTTPConduit.java:1863)
>>>        at
>>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
>>> HTTPConduit.java:1791)
>>>        at
>>> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
>>>        at
>>> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
>>>        at
>>>
>>> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage
>>> (MessageSenderInterceptor.java:62)
>>>        ... 9 more
>>> --
>>> View this message in context:
>>> http://www.nabble.com/cxf-RESTful-samples---addCustomer-%28by-http-POST%29-doesn%27t-work-tp15224908p15224908.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/cxf-RESTful-samples---addCustomer-%28by-http-POST%29-doesn%27t-work-tp15224908p15260577.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to