You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Brad Harper <br...@gmail.com> on 2007/08/01 17:49:28 UTC

Re: Rest GET params coming in null...

I've debugged this down far enough to see that the GetModel object is being
interpreted correctly, but the id param is never bound to this object.  Any
thoughts?

On 7/31/07, Brad Harper <br...@gmail.com> wrote:
>
> My get (all) requests (/services/rest/productTypes) are working.  They
> return xml like this...
>
> <ns1:getProductTypesResponse>
>     <ProductTypes>
>      <description>Paper</description>
>      <id>10</id>
>     </ProductTypes>
>     <ProductTypes>
>      <description>Canvas</description>
>      <id>11</id>
>     </ProductTypes>
> </ns1:getProductTypesResponse>
>
> My get individual requests (/services/rest/productTypes/1) are failing
> because the id property of the GetModel object is null.
>
> Any ideas?   Code/config below....
>
> config:
> <bean id="RestServiceImpl" class="
> com.gdservices.service.thirdparty.RestServiceImpl">
>         <property name="daoFactory">
>             <ref bean="hibernateDAOFactory"/>
>         </property>
>     </bean>
>     <!-- REST -->
>     <jaxws:endpoint
>       id="restRest"
>       implementor="#RestServiceImpl"
>       address="/rest"
>       bindingUri=" http://apache.org/cxf/binding/http">
>             <jaxws:serviceFactory>
>                 <bean class="
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
>                       <property name="wrapped" value="true" />
>                     </bean>
>             </jaxws:serviceFactory>
>     </jaxws:endpoint>
>
> Service:
>
> @WebService(
>         targetNamespace = " http://restService.service.gdservices.com/"
> )
> public interface RestService {
>
>     @Get
>     @HttpResource(location="/productTypes")
>     @WebResult(name = "ProductTypes")
>     public List<TpMetaData> getProductTypes() throws ServiceException;
>
>     @Get
>     @HttpResource(location="/productTypes/{id}")
>     public TpMetaData getProductType(@WebParam(name = "GetModel")GetModel
> getModel) throws ServiceException ;
> }
>
>
> Param Object:
> @XmlRootElement(name = "GetModel")
> public class GetModel {
>     private long id;
>
>
>     public long getId() {
>         return id;
>     }
>
>     public void setId(long id) {
>         this.id = id;
>     }
> }
>

Re: Rest GET params coming in null...

Posted by Mansour Raad <mr...@esri.com>.
>>>>

>>>> <property name="wrapped" value="false" />


On Aug 1, 2007, at 2:01 PM, Brad Harper wrote:

> Is that done with an annotation?
>
> On 8/1/07, Mansour Raad <mr...@esri.com> wrote:
>>
>> Just a shot in the dark here....could setting wrapped to false help ?
>> Mansour
>> :-)
>>
>> On Aug 1, 2007, at 11:49 AM, Brad Harper wrote:
>>
>>> I've debugged this down far enough to see that the GetModel object
>>> is being
>>> interpreted correctly, but the id param is never bound to this
>>> object.  Any
>>> thoughts?
>>>
>>> On 7/31/07, Brad Harper <br...@gmail.com> wrote:
>>>>
>>>> My get (all) requests (/services/rest/productTypes) are working.
>>>> They
>>>> return xml like this...
>>>>
>>>> <ns1:getProductTypesResponse>
>>>>     <ProductTypes>
>>>>      <description>Paper</description>
>>>>      <id>10</id>
>>>>     </ProductTypes>
>>>>     <ProductTypes>
>>>>      <description>Canvas</description>
>>>>      <id>11</id>
>>>>     </ProductTypes>
>>>> </ns1:getProductTypesResponse>
>>>>
>>>> My get individual requests (/services/rest/productTypes/1) are
>>>> failing
>>>> because the id property of the GetModel object is null.
>>>>
>>>> Any ideas?   Code/config below....
>>>>
>>>> config:
>>>> <bean id="RestServiceImpl" class="
>>>> com.gdservices.service.thirdparty.RestServiceImpl">
>>>>         <property name="daoFactory">
>>>>             <ref bean="hibernateDAOFactory"/>
>>>>         </property>
>>>>     </bean>
>>>>     <!-- REST -->
>>>>     <jaxws:endpoint
>>>>       id="restRest"
>>>>       implementor="#RestServiceImpl"
>>>>       address="/rest"
>>>>       bindingUri=" http://apache.org/cxf/binding/http">
>>>>             <jaxws:serviceFactory>
>>>>                 <bean class="
>>>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
>>>>                       <property name="wrapped" value="true" />
>>>>                     </bean>
>>>>             </jaxws:serviceFactory>
>>>>     </jaxws:endpoint>
>>>>
>>>> Service:
>>>>
>>>> @WebService(
>>>>         targetNamespace = " http://
>>>> restService.service.gdservices.com/"
>>>> )
>>>> public interface RestService {
>>>>
>>>>     @Get
>>>>     @HttpResource(location="/productTypes")
>>>>     @WebResult(name = "ProductTypes")
>>>>     public List<TpMetaData> getProductTypes() throws
>>>> ServiceException;
>>>>
>>>>     @Get
>>>>     @HttpResource(location="/productTypes/{id}")
>>>>     public TpMetaData getProductType(@WebParam(name = "GetModel")
>>>> GetModel
>>>> getModel) throws ServiceException ;
>>>> }
>>>>
>>>>
>>>> Param Object:
>>>> @XmlRootElement(name = "GetModel")
>>>> public class GetModel {
>>>>     private long id;
>>>>
>>>>
>>>>     public long getId() {
>>>>         return id;
>>>>     }
>>>>
>>>>     public void setId(long id) {
>>>>         this.id = id;
>>>>     }
>>>> }
>>>>
>>
>> Mansour
>> :-)
>>
>>
>>
>>

Mansour
:-)




Re: Rest GET params coming in null...

Posted by Mansour Raad <mr...@esri.com>.
Check out http://cwiki.apache.org/CXF20DOC/http-binding.html and the  
bottom it explains the difference.
Sure why "technically" it makes a difference.

Mansour
:-)

On Aug 1, 2007, at 2:26 PM, Brad Harper wrote:

> That worked actually.  Unfortunately, I don't understand  
> technically why....
>
> -bh
>
> On 8/1/07, Mansour Raad <mr...@esri.com> wrote:
>>
>> BTW.....there might be an issue with it....I did try it using the
>> restful_http_binding sample and no go.  Raised a JIRA
>>
>> On Aug 1, 2007, at 2:01 PM, Brad Harper wrote:
>>
>>> Is that done with an annotation?
>>>
>>> On 8/1/07, Mansour Raad <mr...@esri.com> wrote:
>>>>
>>>> Just a shot in the dark here....could setting wrapped to false  
>>>> help ?
>>>> Mansour
>>>> :-)
>>>>
>>>> On Aug 1, 2007, at 11:49 AM, Brad Harper wrote:
>>>>
>>>>> I've debugged this down far enough to see that the GetModel object
>>>>> is being
>>>>> interpreted correctly, but the id param is never bound to this
>>>>> object.  Any
>>>>> thoughts?
>>>>>
>>>>> On 7/31/07, Brad Harper <br...@gmail.com> wrote:
>>>>>>
>>>>>> My get (all) requests (/services/rest/productTypes) are working.
>>>>>> They
>>>>>> return xml like this...
>>>>>>
>>>>>> <ns1:getProductTypesResponse>
>>>>>>     <ProductTypes>
>>>>>>      <description>Paper</description>
>>>>>>      <id>10</id>
>>>>>>     </ProductTypes>
>>>>>>     <ProductTypes>
>>>>>>      <description>Canvas</description>
>>>>>>      <id>11</id>
>>>>>>     </ProductTypes>
>>>>>> </ns1:getProductTypesResponse>
>>>>>>
>>>>>> My get individual requests (/services/rest/productTypes/1) are
>>>>>> failing
>>>>>> because the id property of the GetModel object is null.
>>>>>>
>>>>>> Any ideas?   Code/config below....
>>>>>>
>>>>>> config:
>>>>>> <bean id="RestServiceImpl" class="
>>>>>> com.gdservices.service.thirdparty.RestServiceImpl">
>>>>>>         <property name="daoFactory">
>>>>>>             <ref bean="hibernateDAOFactory"/>
>>>>>>         </property>
>>>>>>     </bean>
>>>>>>     <!-- REST -->
>>>>>>     <jaxws:endpoint
>>>>>>       id="restRest"
>>>>>>       implementor="#RestServiceImpl"
>>>>>>       address="/rest"
>>>>>>       bindingUri=" http://apache.org/cxf/binding/http">
>>>>>>             <jaxws:serviceFactory>
>>>>>>                 <bean class="
>>>>>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
>>>>>>                       <property name="wrapped" value="true" />
>>>>>>                     </bean>
>>>>>>             </jaxws:serviceFactory>
>>>>>>     </jaxws:endpoint>
>>>>>>
>>>>>> Service:
>>>>>>
>>>>>> @WebService(
>>>>>>         targetNamespace = " http://
>>>>>> restService.service.gdservices.com/"
>>>>>> )
>>>>>> public interface RestService {
>>>>>>
>>>>>>     @Get
>>>>>>     @HttpResource(location="/productTypes")
>>>>>>     @WebResult(name = "ProductTypes")
>>>>>>     public List<TpMetaData> getProductTypes() throws
>>>>>> ServiceException;
>>>>>>
>>>>>>     @Get
>>>>>>     @HttpResource(location="/productTypes/{id}")
>>>>>>     public TpMetaData getProductType(@WebParam(name = "GetModel")
>>>>>> GetModel
>>>>>> getModel) throws ServiceException ;
>>>>>> }
>>>>>>
>>>>>>
>>>>>> Param Object:
>>>>>> @XmlRootElement(name = "GetModel")
>>>>>> public class GetModel {
>>>>>>     private long id;
>>>>>>
>>>>>>
>>>>>>     public long getId() {
>>>>>>         return id;
>>>>>>     }
>>>>>>
>>>>>>     public void setId(long id) {
>>>>>>         this.id = id;
>>>>>>     }
>>>>>> }
>>>>>>
>>>>
>>>> Mansour
>>>> :-)
>>>>
>>>>
>>>>
>>>>
>>
>> Mansour
>> :-)
>>
>>
>>
>>

Mansour
:-)




Re: Rest GET params coming in null...

Posted by Brad Harper <br...@gmail.com>.
That worked actually.  Unfortunately, I don't understand technically why....

-bh

On 8/1/07, Mansour Raad <mr...@esri.com> wrote:
>
> BTW.....there might be an issue with it....I did try it using the
> restful_http_binding sample and no go.  Raised a JIRA
>
> On Aug 1, 2007, at 2:01 PM, Brad Harper wrote:
>
> > Is that done with an annotation?
> >
> > On 8/1/07, Mansour Raad <mr...@esri.com> wrote:
> >>
> >> Just a shot in the dark here....could setting wrapped to false help ?
> >> Mansour
> >> :-)
> >>
> >> On Aug 1, 2007, at 11:49 AM, Brad Harper wrote:
> >>
> >>> I've debugged this down far enough to see that the GetModel object
> >>> is being
> >>> interpreted correctly, but the id param is never bound to this
> >>> object.  Any
> >>> thoughts?
> >>>
> >>> On 7/31/07, Brad Harper <br...@gmail.com> wrote:
> >>>>
> >>>> My get (all) requests (/services/rest/productTypes) are working.
> >>>> They
> >>>> return xml like this...
> >>>>
> >>>> <ns1:getProductTypesResponse>
> >>>>     <ProductTypes>
> >>>>      <description>Paper</description>
> >>>>      <id>10</id>
> >>>>     </ProductTypes>
> >>>>     <ProductTypes>
> >>>>      <description>Canvas</description>
> >>>>      <id>11</id>
> >>>>     </ProductTypes>
> >>>> </ns1:getProductTypesResponse>
> >>>>
> >>>> My get individual requests (/services/rest/productTypes/1) are
> >>>> failing
> >>>> because the id property of the GetModel object is null.
> >>>>
> >>>> Any ideas?   Code/config below....
> >>>>
> >>>> config:
> >>>> <bean id="RestServiceImpl" class="
> >>>> com.gdservices.service.thirdparty.RestServiceImpl">
> >>>>         <property name="daoFactory">
> >>>>             <ref bean="hibernateDAOFactory"/>
> >>>>         </property>
> >>>>     </bean>
> >>>>     <!-- REST -->
> >>>>     <jaxws:endpoint
> >>>>       id="restRest"
> >>>>       implementor="#RestServiceImpl"
> >>>>       address="/rest"
> >>>>       bindingUri=" http://apache.org/cxf/binding/http">
> >>>>             <jaxws:serviceFactory>
> >>>>                 <bean class="
> >>>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
> >>>>                       <property name="wrapped" value="true" />
> >>>>                     </bean>
> >>>>             </jaxws:serviceFactory>
> >>>>     </jaxws:endpoint>
> >>>>
> >>>> Service:
> >>>>
> >>>> @WebService(
> >>>>         targetNamespace = " http://
> >>>> restService.service.gdservices.com/"
> >>>> )
> >>>> public interface RestService {
> >>>>
> >>>>     @Get
> >>>>     @HttpResource(location="/productTypes")
> >>>>     @WebResult(name = "ProductTypes")
> >>>>     public List<TpMetaData> getProductTypes() throws
> >>>> ServiceException;
> >>>>
> >>>>     @Get
> >>>>     @HttpResource(location="/productTypes/{id}")
> >>>>     public TpMetaData getProductType(@WebParam(name = "GetModel")
> >>>> GetModel
> >>>> getModel) throws ServiceException ;
> >>>> }
> >>>>
> >>>>
> >>>> Param Object:
> >>>> @XmlRootElement(name = "GetModel")
> >>>> public class GetModel {
> >>>>     private long id;
> >>>>
> >>>>
> >>>>     public long getId() {
> >>>>         return id;
> >>>>     }
> >>>>
> >>>>     public void setId(long id) {
> >>>>         this.id = id;
> >>>>     }
> >>>> }
> >>>>
> >>
> >> Mansour
> >> :-)
> >>
> >>
> >>
> >>
>
> Mansour
> :-)
>
>
>
>

Re: Rest GET params coming in null...

Posted by Mansour Raad <mr...@esri.com>.
BTW.....there might be an issue with it....I did try it using the  
restful_http_binding sample and no go.  Raised a JIRA

On Aug 1, 2007, at 2:01 PM, Brad Harper wrote:

> Is that done with an annotation?
>
> On 8/1/07, Mansour Raad <mr...@esri.com> wrote:
>>
>> Just a shot in the dark here....could setting wrapped to false help ?
>> Mansour
>> :-)
>>
>> On Aug 1, 2007, at 11:49 AM, Brad Harper wrote:
>>
>>> I've debugged this down far enough to see that the GetModel object
>>> is being
>>> interpreted correctly, but the id param is never bound to this
>>> object.  Any
>>> thoughts?
>>>
>>> On 7/31/07, Brad Harper <br...@gmail.com> wrote:
>>>>
>>>> My get (all) requests (/services/rest/productTypes) are working.
>>>> They
>>>> return xml like this...
>>>>
>>>> <ns1:getProductTypesResponse>
>>>>     <ProductTypes>
>>>>      <description>Paper</description>
>>>>      <id>10</id>
>>>>     </ProductTypes>
>>>>     <ProductTypes>
>>>>      <description>Canvas</description>
>>>>      <id>11</id>
>>>>     </ProductTypes>
>>>> </ns1:getProductTypesResponse>
>>>>
>>>> My get individual requests (/services/rest/productTypes/1) are
>>>> failing
>>>> because the id property of the GetModel object is null.
>>>>
>>>> Any ideas?   Code/config below....
>>>>
>>>> config:
>>>> <bean id="RestServiceImpl" class="
>>>> com.gdservices.service.thirdparty.RestServiceImpl">
>>>>         <property name="daoFactory">
>>>>             <ref bean="hibernateDAOFactory"/>
>>>>         </property>
>>>>     </bean>
>>>>     <!-- REST -->
>>>>     <jaxws:endpoint
>>>>       id="restRest"
>>>>       implementor="#RestServiceImpl"
>>>>       address="/rest"
>>>>       bindingUri=" http://apache.org/cxf/binding/http">
>>>>             <jaxws:serviceFactory>
>>>>                 <bean class="
>>>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
>>>>                       <property name="wrapped" value="true" />
>>>>                     </bean>
>>>>             </jaxws:serviceFactory>
>>>>     </jaxws:endpoint>
>>>>
>>>> Service:
>>>>
>>>> @WebService(
>>>>         targetNamespace = " http://
>>>> restService.service.gdservices.com/"
>>>> )
>>>> public interface RestService {
>>>>
>>>>     @Get
>>>>     @HttpResource(location="/productTypes")
>>>>     @WebResult(name = "ProductTypes")
>>>>     public List<TpMetaData> getProductTypes() throws
>>>> ServiceException;
>>>>
>>>>     @Get
>>>>     @HttpResource(location="/productTypes/{id}")
>>>>     public TpMetaData getProductType(@WebParam(name = "GetModel")
>>>> GetModel
>>>> getModel) throws ServiceException ;
>>>> }
>>>>
>>>>
>>>> Param Object:
>>>> @XmlRootElement(name = "GetModel")
>>>> public class GetModel {
>>>>     private long id;
>>>>
>>>>
>>>>     public long getId() {
>>>>         return id;
>>>>     }
>>>>
>>>>     public void setId(long id) {
>>>>         this.id = id;
>>>>     }
>>>> }
>>>>
>>
>> Mansour
>> :-)
>>
>>
>>
>>

Mansour
:-)




Re: Rest GET params coming in null...

Posted by Brad Harper <br...@gmail.com>.
Is that done with an annotation?

On 8/1/07, Mansour Raad <mr...@esri.com> wrote:
>
> Just a shot in the dark here....could setting wrapped to false help ?
> Mansour
> :-)
>
> On Aug 1, 2007, at 11:49 AM, Brad Harper wrote:
>
> > I've debugged this down far enough to see that the GetModel object
> > is being
> > interpreted correctly, but the id param is never bound to this
> > object.  Any
> > thoughts?
> >
> > On 7/31/07, Brad Harper <br...@gmail.com> wrote:
> >>
> >> My get (all) requests (/services/rest/productTypes) are working.
> >> They
> >> return xml like this...
> >>
> >> <ns1:getProductTypesResponse>
> >>     <ProductTypes>
> >>      <description>Paper</description>
> >>      <id>10</id>
> >>     </ProductTypes>
> >>     <ProductTypes>
> >>      <description>Canvas</description>
> >>      <id>11</id>
> >>     </ProductTypes>
> >> </ns1:getProductTypesResponse>
> >>
> >> My get individual requests (/services/rest/productTypes/1) are
> >> failing
> >> because the id property of the GetModel object is null.
> >>
> >> Any ideas?   Code/config below....
> >>
> >> config:
> >> <bean id="RestServiceImpl" class="
> >> com.gdservices.service.thirdparty.RestServiceImpl">
> >>         <property name="daoFactory">
> >>             <ref bean="hibernateDAOFactory"/>
> >>         </property>
> >>     </bean>
> >>     <!-- REST -->
> >>     <jaxws:endpoint
> >>       id="restRest"
> >>       implementor="#RestServiceImpl"
> >>       address="/rest"
> >>       bindingUri=" http://apache.org/cxf/binding/http">
> >>             <jaxws:serviceFactory>
> >>                 <bean class="
> >> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
> >>                       <property name="wrapped" value="true" />
> >>                     </bean>
> >>             </jaxws:serviceFactory>
> >>     </jaxws:endpoint>
> >>
> >> Service:
> >>
> >> @WebService(
> >>         targetNamespace = " http://
> >> restService.service.gdservices.com/"
> >> )
> >> public interface RestService {
> >>
> >>     @Get
> >>     @HttpResource(location="/productTypes")
> >>     @WebResult(name = "ProductTypes")
> >>     public List<TpMetaData> getProductTypes() throws
> >> ServiceException;
> >>
> >>     @Get
> >>     @HttpResource(location="/productTypes/{id}")
> >>     public TpMetaData getProductType(@WebParam(name = "GetModel")
> >> GetModel
> >> getModel) throws ServiceException ;
> >> }
> >>
> >>
> >> Param Object:
> >> @XmlRootElement(name = "GetModel")
> >> public class GetModel {
> >>     private long id;
> >>
> >>
> >>     public long getId() {
> >>         return id;
> >>     }
> >>
> >>     public void setId(long id) {
> >>         this.id = id;
> >>     }
> >> }
> >>
>
> Mansour
> :-)
>
>
>
>

Re: Rest GET params coming in null...

Posted by Mansour Raad <mr...@esri.com>.
Just a shot in the dark here....could setting wrapped to false help ?
Mansour
:-)

On Aug 1, 2007, at 11:49 AM, Brad Harper wrote:

> I've debugged this down far enough to see that the GetModel object  
> is being
> interpreted correctly, but the id param is never bound to this  
> object.  Any
> thoughts?
>
> On 7/31/07, Brad Harper <br...@gmail.com> wrote:
>>
>> My get (all) requests (/services/rest/productTypes) are working.   
>> They
>> return xml like this...
>>
>> <ns1:getProductTypesResponse>
>>     <ProductTypes>
>>      <description>Paper</description>
>>      <id>10</id>
>>     </ProductTypes>
>>     <ProductTypes>
>>      <description>Canvas</description>
>>      <id>11</id>
>>     </ProductTypes>
>> </ns1:getProductTypesResponse>
>>
>> My get individual requests (/services/rest/productTypes/1) are  
>> failing
>> because the id property of the GetModel object is null.
>>
>> Any ideas?   Code/config below....
>>
>> config:
>> <bean id="RestServiceImpl" class="
>> com.gdservices.service.thirdparty.RestServiceImpl">
>>         <property name="daoFactory">
>>             <ref bean="hibernateDAOFactory"/>
>>         </property>
>>     </bean>
>>     <!-- REST -->
>>     <jaxws:endpoint
>>       id="restRest"
>>       implementor="#RestServiceImpl"
>>       address="/rest"
>>       bindingUri=" http://apache.org/cxf/binding/http">
>>             <jaxws:serviceFactory>
>>                 <bean class="
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
>>                       <property name="wrapped" value="true" />
>>                     </bean>
>>             </jaxws:serviceFactory>
>>     </jaxws:endpoint>
>>
>> Service:
>>
>> @WebService(
>>         targetNamespace = " http:// 
>> restService.service.gdservices.com/"
>> )
>> public interface RestService {
>>
>>     @Get
>>     @HttpResource(location="/productTypes")
>>     @WebResult(name = "ProductTypes")
>>     public List<TpMetaData> getProductTypes() throws  
>> ServiceException;
>>
>>     @Get
>>     @HttpResource(location="/productTypes/{id}")
>>     public TpMetaData getProductType(@WebParam(name = "GetModel") 
>> GetModel
>> getModel) throws ServiceException ;
>> }
>>
>>
>> Param Object:
>> @XmlRootElement(name = "GetModel")
>> public class GetModel {
>>     private long id;
>>
>>
>>     public long getId() {
>>         return id;
>>     }
>>
>>     public void setId(long id) {
>>         this.id = id;
>>     }
>> }
>>

Mansour
:-)