Return-Path: Delivered-To: apmail-incubator-cxf-issues-archive@locus.apache.org Received: (qmail 40429 invoked from network); 27 Mar 2008 17:03:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Mar 2008 17:03:57 -0000 Received: (qmail 65277 invoked by uid 500); 27 Mar 2008 17:03:56 -0000 Delivered-To: apmail-incubator-cxf-issues-archive@incubator.apache.org Received: (qmail 65258 invoked by uid 500); 27 Mar 2008 17:03:56 -0000 Mailing-List: contact cxf-issues-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-issues@incubator.apache.org Received: (qmail 65222 invoked by uid 99); 27 Mar 2008 17:03:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2008 10:03:56 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.79.199.57] (HELO server.dankulp.com) (64.79.199.57) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2008 17:03:13 +0000 Received: by server.dankulp.com (Postfix, from userid 5000) id 32C74197C502; Thu, 27 Mar 2008 13:03:24 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter.XXXXWmDHnQ Received: from [192.168.1.105] (c-24-147-10-180.hsd1.ma.comcast.net [24.147.10.180]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTP id 43DED197C4AA; Thu, 27 Mar 2008 13:03:23 -0400 (EDT) From: Daniel Kulp To: cxf-user@incubator.apache.org Subject: Re: re[jira] stful uri binding value not set to input parameter bean property Date: Thu, 27 Mar 2008 13:03:21 -0400 User-Agent: KMail/1.9.7 Cc: "Sergey Beryozkin" , cxf-issues@incubator.apache.org References: <16183429.post@talk.nabble.com> <16324508.post@talk.nabble.com> <012301c8900f$39216c20$e002050a@IONAGLOBAL.COM> In-Reply-To: <012301c8900f$39216c20$e002050a@IONAGLOBAL.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803271303.21742.dkulp@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=0.4 required=3.0 tests=BAYES_00,RCVD_IN_PBL, RCVD_IN_SORBS_DUL,RDNS_DYNAMIC,TW_CX,TW_XR autolearn=no version=3.2.4 Yea, Jettison issue. There was a discussion about this on the jettison list: http://archive.jettison.codehaus.org/dev/27326848.1205101828701.JavaMail.haus-jira%40codehaus01.managed.contegix.com and JIRA: http://jira.codehaus.org/browse/JETTISON-36 Dan On Thursday 27 March 2008, Sergey Beryozkin wrote: > Hi Tam > > I'm afraid I don't know what the issue is here. Looks like it's either > the problem of missing some JAXB annotation... or more likely the > problem of Jettison... > > Does someone know, is it possible to fix this issue at the JAXB level > ? Cheers, Sergey > > > Hi Sergey > > > > I have run into another problem! I am making a GET request to a > > service and it is returning me some JSON content. The content I am > > getting is: {"telephoneNo":{"code":161,"number":2382907}} > > the content I want is: > > {"telephoneNo":{"code":"0161","number":"2382907"}} > > I have tried adding an @XmlElement(type = String.class) annotation > > to the Field of the Object returned by the service but that makes no > > difference. If I add a non numeric char to the code field value > > ("0161S") the value is returned in quotes, so it looks like it is > > determining the value type from the value rather than the Field or > > annotation?! Is this a bug or is there something I'm not setting > > somewhere? > > > > Cheers, Tam > > > > Sergey Beryozkin wrote: > >> Hi Tam > >> > >>> Thanks for that, I have now got it up and running. You also have > >>> to add the > >>> @XmlRootElement annotation to the object returned by the service > >>> otherwise > >>> you get a NullPointerException. > >> > >> The exception is quite poor all-right at the moment. In this case > >> and exception saying no MessageBodyWriter was found has to be > >> generated. I actually have a minor patch I did on weekends to > >> improve on some of the things in this area, including the support > >> for a standard > >> WebApplicationException. > >> > >>> > Is it possible to specify the @ProduceMime type in the Spring > >>> > context > >>> > >>> file. > >> > >> You can do > >> @GET > >> @ProduceMime("application/xml", "application/json") > >> > >> and then, depending on the value of the Accept type the approproate > >> MessageBodyWriter will be selected. You can also debug the formats > >> like this : > >> GET /yourResource?_contentType=application/xml > >> or > >> GET /yourResource?_contentType=xml > >> > >> etc, with "xml" in this case defaulting to application/xml. More > >> shortcuts like 'xml' can be easily added to a system query handler > >> dealing with this query... > >> > >> Cheers, Sergey > >> > >>> Hi Sergey > >>> > >>> Thanks for that, I have now got it up and running. You also have > >>> to add the > >>> @XmlRootElement annotation to the object returned by the service > >>> otherwise > >>> you get a NullPointerException. > >>> Is it possible to specify the @ProduceMime type in the Spring > >>> context file. > >>> At the moment if i want a service to return different mime types > >>> it seems like i need multiple implementations of the method with > >>> different annotations. > >>> > >>> Cheers, Tam > >>> > >>> Sergey Beryozkin wrote: > >>>> Hi Tam, > >>>> > >>>> I'm sorry, but I've never got to updating the documentaion but > >>>> I've created a JIRA to have the docs updated asap, I'll try to > >>>> update them in the next few days... > >>>> In meantime have a look please at a basic jaxrs demo, the only > >>>> difference > >>>> with what the documentation says is that > >>>> different annotations are used, for ex @GET instead of > >>>> @HttpMethod("Get"), > >>>> @Path instead of @UriTemplate and @PathParam instead of > >>>> @UriParam... > >>>> > >>>> Cheers, Sergey > >>>> > >>>> ----- Original Message ----- > >>>> From: "tam.sayers" > >>>> To: > >>>> Sent: Tuesday, March 25, 2008 11:05 AM > >>>> Subject: Re: re[jira] stful uri binding value not set to input > >>>> parameter bean property > >>>> > >>>>> Hi Sergey > >>>>> > >>>>> Thanks for the reply. The version of the jax-rs implementation > >>>>> in the apache-cxf-2.1-incubator-20080321.032844-42.zip seems to > >>>>> be different than > >>>>> the one described in > >>>>> http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html. > >>>>> Do you know if there is any documentation anywhere for the newer > >>>>> version? > >>>>> > >>>>> Tam > >>>>> > >>>>> Sergey Beryozkin wrote: > >>>>>> Hi > >>>>>> > >>>>>> Please try the same with the current JAX-RS implementation in > >>>>>> CXF. I'm not qute sure why this does not work for the CXF HTTP > >>>>>> binding, but one > >>>>>> thing is that > >>>>>> this binding can be considered depecated...unless someone can > >>>>>> confirm they're going to mantain it... > >>>>>> > >>>>>> Cheers, Sergey > >>>>>> > >>>>>>> I have tried calling the following service using the cxf 2.0.4 > >>>>>>> and 2.1 > >>>>>>> code > >>>>>>> and when using both the accountNumber is not set to the > >>>>>>> GetForAccount bean. > >>>>>>> When debugging through the code I can see that > >>>>>>> the values are being read from the URL and an XML element is > >>>>>>> being generated > >>>>>>> in the form: > >>>>>>> > >>>>>>> > >>>>>>> ab123 > >>>>>>> > >>>>>>> > >>>>>>> This is then added to the message but never gets set to the > >>>>>>> GetForAccount > >>>>>>> bean. Does anybody know why the property is not being set? > >>>>>>> > >>>>>>> Service definition: > >>>>>>> > >>>>>>> @WebService(targetNamespace = > >>>>>>> "http://uk.co.jdwilliams/account") public interface > >>>>>>> AccountTelephoneNumberService { > >>>>>>> @Get > >>>>>>> @HttpResource(location = "/telnos/{accountNumber}") > >>>>>>> @WebResult(name = "telephoneNo") > >>>>>>> TelephoneNumberTO getTelephoneForAccount(GetForAccount > >>>>>>> getForAccount); > >>>>>>> } > >>>>>>> > >>>>>>> input bean: > >>>>>>> > >>>>>>> public class GetForAccount { > >>>>>>> private String accountNumber; > >>>>>>> > >>>>>>> /** > >>>>>>> * @return the accountNumber > >>>>>>> */ > >>>>>>> public String getAccountNumber() { > >>>>>>> return accountNumber; > >>>>>>> } > >>>>>>> > >>>>>>> /** > >>>>>>> * @param accountNumber the accountNumber to set > >>>>>>> */ > >>>>>>> public void setAccountNumber(String accountNumber) { > >>>>>>> this.accountNumber = accountNumber; > >>>>>>> } > >>>>>>> } > >>>>>>> > >>>>>>> Spring bean definition: > >>>>>>> > >>>>>>> >>>>>>> implementor="#accountTelephoneNumberService" > >>>>>>> address="/xml/account" > >>>>>>> bindingUri="http://apache.org/cxf/binding/http"> > >>>>>>> > >>>>>>> >>>>>>> class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> -- > >>>>>>> View this message in context: > >>>>>>> http://www.nabble.com/restful-uri-binding-value-not-set-to-inp > >>>>>>>ut-parameter-bean-property-tp16183429p16183429.html Sent from > >>>>>>> the cxf-issues mailing list archive at Nabble.com. > >>>>>> > >>>>>> ---------------------------- > >>>>>> IONA Technologies PLC (registered in Ireland) > >>>>>> Registered Number: 171387 > >>>>>> Registered Address: The IONA Building, Shelbourne Road, Dublin > >>>>>> 4, Ireland > >>>>> > >>>>> -- > >>>>> View this message in context: > >>>>> http://www.nabble.com/restful-uri-binding-value-not-set-to-input > >>>>>-parameter-bean-property-tp16183429p16273694.html Sent from the > >>>>> cxf-issues mailing list archive at Nabble.com. > >>>> > >>>> ---------------------------- > >>>> IONA Technologies PLC (registered in Ireland) > >>>> Registered Number: 171387 > >>>> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, > >>>> Ireland > >>> > >>> -- > >>> View this message in context: > >>> http://www.nabble.com/restful-uri-binding-value-not-set-to-input-p > >>>arameter-bean-property-tp16183429p16298037.html Sent from the > >>> cxf-issues mailing list archive at Nabble.com. > >> > >> ---------------------------- > >> IONA Technologies PLC (registered in Ireland) > >> Registered Number: 171387 > >> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, > >> Ireland > > > > -- > > View this message in context: > > http://www.nabble.com/restful-uri-binding-value-not-set-to-input-par > >ameter-bean-property-tp16183429p16324508.html Sent from the > > cxf-issues mailing list archive at Nabble.com. > > ---------------------------- > IONA Technologies PLC (registered in Ireland) > Registered Number: 171387 > Registered Address: The IONA Building, Shelbourne Road, Dublin 4, > Ireland -- J. Daniel Kulp Principal Engineer, IONA dkulp@apache.org http://www.dankulp.com/blog