Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 32801 invoked from network); 29 Jul 2009 21:00:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jul 2009 21:00:36 -0000 Received: (qmail 32212 invoked by uid 500); 29 Jul 2009 21:00:36 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 32120 invoked by uid 500); 29 Jul 2009 21:00:36 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 32108 invoked by uid 99); 29 Jul 2009 21:00:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jul 2009 21:00:36 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jul 2009 21:00:26 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MWGFq-0003rL-4D for users@cxf.apache.org; Wed, 29 Jul 2009 14:00:06 -0700 Message-ID: <24727454.post@talk.nabble.com> Date: Wed, 29 Jul 2009 14:00:06 -0700 (PDT) From: Sergey Beryozkin To: users@cxf.apache.org Subject: Re: Running into problems with using WebClient In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: sergey.beryozkin@iona.com References: X-Virus-Checked: Checked by ClamAV on apache.org Hi It's an issue with CXF JAXRS 2.2.2, the logging interceptor replaces the HTTP in stream with another InputStream but WebClient fails to check it and reads the HTTP stream again. Fixed in 2.2.3, for now please remove a logging interceptor once you've confirmed the message is coming back thanks, Sergey kiran.sidhu wrote: > > Hi, > > I have a simple RESTful Web Service that I got from one > of the samples on the web. I am able to invoke it from browser and it > shows the output on the browser, but when I try and call it from my > client code using WebClient, it's throwing the following exception, Am I > missing something ? > > > > WARNING: .No operation matching request path /customers is found, > ContentType : */*, Accept : > text/html,application/xhtml+xml,application/xml,. > > Jul 29, 2009 10:38:23 AM > org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper toResponse > > WARNING: WebApplicationException has been caught : no cause is available > > Jul 29, 2009 10:38:23 AM > org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose > > > > Here is the Client code : > > > > WebClient wc = > WebClient.create("http://localhost:8080/cxf-webservices/webservices/cust > omerservice"); > > wc.accept("text/html,application/xhtml+xml,application/xml"); > > Response getresponse = wc.path("/customers").get(); > > > > > > Here is the Web Service : > > > > > > > > > > > > > > > > > > @Path("/customerservice/") > > @Produces("text/xml") > > public class CustomerService { > > > > private TreeMap customerMap = new > TreeMap(); > > public CustomerService() { > > //Hard coded for testing > > Customer customer = new Customer(); > > customer.setId(0); > > customer.setName("Harold Abernathy"); > > customer.setAddress("Sheffield, UK"); > > addCustomer(customer); > > } > > > > @GET > > @Path("/customers") > > public CustomerCollection getCustomers() { > > return new CustomerCollection( customerMap.values()); > > } > > > > @GET > > @Path("/customers/{id}") > > public Customer getCustomer(@PathParam("id") int cId) { > > > > return customerMap.get(cId); > > } > > > > @POST > > @Path("/customers/add") > > @Produces("text/plain") > > @Consumes("application/xml") > > public String addCustomer(Customer customer) { > > int id = customerMap.size(); > > customer.setId(id); > > customerMap.put(id, customer); > > return "Customer " + customer.getName() + " added with Id " + > id; > > } > > > > Any help will be appreciated. > > Thanks > > Kiran > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > _ > > Notice: This information is intended only for the person(s) or entity(ies) > to which it is addressed. This information may contain information that is > confidential or otherwise protected from disclosure. If you are not the > intended recipient of this message, or if this message has been addressed > to you in error, please immediately alert the sender by reply e-mail and > then delete this message, including any attachments. Any dissemination, > distribution or other use of the contents of this message by anyone other > than the intended recipient is strictly prohibited. > > -- View this message in context: http://www.nabble.com/Running-into-problems-with-using-WebClient-tp24724574p24727454.html Sent from the cxf-user mailing list archive at Nabble.com.