Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 14991 invoked from network); 4 Jan 2010 07:13:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Jan 2010 07:13:06 -0000 Received: (qmail 66107 invoked by uid 500); 4 Jan 2010 07:13:05 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 65997 invoked by uid 500); 4 Jan 2010 07:13:04 -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 65987 invoked by uid 99); 4 Jan 2010 07:13:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jan 2010 07:13:04 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.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; Mon, 04 Jan 2010 07:12:54 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NRh7B-0001gT-Ev for users@cxf.apache.org; Sun, 03 Jan 2010 23:12:33 -0800 Message-ID: <27009526.post@talk.nabble.com> Date: Sun, 3 Jan 2010 23:12:33 -0800 (PST) From: Padmam To: users@cxf.apache.org Subject: Re: JAXRS - POST In-Reply-To: <01bd01ca83ed$f85d1ca0$1f02050a@emea.progress.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: padmavathi_v@infosys.com References: <01bd01ca83ed$f85d1ca0$1f02050a@emea.progress.com> X-Virus-Checked: Checked by ClamAV on apache.org Yes, it is annotated with @GET and @Produces. I also tried by setting the content type. Still getting the same error... Thanks Padma Sergey Beryozkin-2 wrote: > > Redirecting to the users list... > Do you have a @GET annotated method producing application/json ? > > cheers, Sergey > >> >> Thanks Sergey... >> >> Can you also tell me how to access this from a Client? >> I created following class and when tried to access it threw 405 >> exception: >> >> public class Client { >> >> /** >> * @param args >> */ >> public static void main(String[] args) { >> >> HelloWorld helloWorld = >> WebClient.create("http://localhost:8081/SampleRestProject/helloWorld/customers").accept("application/json").get(HelloWorld.class); >> } >> } >> >> Thanks >> Padma >> >> It should be @Consumes({"application/json", "application/xml"}) >> >> Also, pelase make sure ContentType of the HTTP request conatins either >> application/json or application/xml and that it accepts >> application/json >> >> >> cheers, Sergey >> >>> @Path("/customers") >>> public Customer getCustomers() { >>> Customer customer = new Customer(); >>> customer.setId(1); >>> customer.setName("Padma"); >>> return customer; >>> } >>> >>> } >>> >>> >>> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> xmlns:jaxrs="http://cxf.apache.org/jaxrs" >>> xsi:schemaLocation=" >>> http://www.springframework.org/schema/beans >>> http://www.springframework.org/schema/beans/spring-beans.xsd >>> http://cxf.apache.org/jaxrs >>> http://cxf.apache.org/schemas/jaxrs.xsd >>> "> >>> >>> >>> >>> >>> >> resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" /> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Please help. >>> >>> Thanks >>> Padma >>> >>> -- >>> View this message in context: >>> http://old.nabble.com/JAXRS---POST-tp26897610p26897610.html >>> Sent from the cxf-dev mailing list archive at Nabble.com. >>> >> >> >> >> -- >> View this message in context: >> http://old.nabble.com/JAXRS---POST-tp26897610p26904019.html >> Sent from the cxf-dev mailing list archive at Nabble.com. >> > > > -- View this message in context: http://old.nabble.com/Re%3A-JAXRS---POST-tp26904409p27009526.html Sent from the cxf-user mailing list archive at Nabble.com.