You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Richard M <rn...@custco.biz> on 2008/09/15 21:07:55 UTC

REST parameter naming

How does one name the parameters in a POST for a object with a list of
embedded objects? I've searched the doc and mailing list but not found an
example.

Here is the message definition from my WSDL:

&lt;wsdl:message name="addMember"&gt;
  &lt;wsdl:part element="tns:clientUsername"
name="clientUsername"&gt;&lt;/wsdl:part&gt;
  &lt;wsdl:part element="tns:clientPassword"
name="clientPassword"&gt;&lt;/wsdl:part&gt;
  &lt;wsdl:part element="tns:member" name="member"&gt;&lt;/wsdl:part&gt;
&lt;/wsdl:message&gt;

where "member" is defined as:

&lt;xs:complexType name="member"&gt;
  &lt;xs:complexContent&gt;
    &lt;xs:extension base="tns:object"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" name="emailAddress"
type="xs:string"/&gt;
        &lt;xs:element minOccurs="0" name="firstName" type="xs:string"/&gt;
        &lt;xs:element minOccurs="0" name="lastName" type="xs:string"/
        &lt;xs:element maxOccurs="unbounded" minOccurs="0"
name="categoryList" nillable="true" type="tns:memberCategory"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:extension&gt;
  &lt;/xs:complexContent&gt;
&lt;/xs:complexType&gt;

and the items in "categoryList" are defined as:

&lt;xs:complexType name="memberCategory"&gt;
  &lt;xs:complexContent&gt;
    &lt;xs:extension base="tns:object"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" name="name" type="xs:string"/&gt;
        &lt;xs:element name="category" type="tns:category"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:extension&gt;
  &lt;/xs:complexContent&gt;
&lt;/xs:complexType&gt;

The "memberCategory" objects typically only have the "name" attribute
supplied (its used as a reference to look up the actual category in the
database).


Here is what I thought would work, but does not appear to so far (I get the
wrong number of parameters error):

member.emailAddress=user@localhost.com
member.firstName=James
member.lastName=Smith
member.categoryList[0].name=TestCat1
member.categoryList[1].name=TestCat2


Where can I find info on how the parameters from a POST are parsed by CXF?


Thanks in advance - Richard

-- 
View this message in context: http://www.nabble.com/REST-parameter-naming-tp19499156p19499156.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: REST parameter naming

Posted by Richard M <rn...@custco.biz>.
Oops - I'm using CXF 2.0.2. Would upgrading to 2.1.1 help on this?


Richard M wrote:
> 
> <p>How does one name the parameters in a POST for a object with a list of
> embedded objects? I've searched the doc and mailing list but not found an
> example.<p>
> <p>Here is the message definition from my WSDL:</p><pre>
> &lt;wsdl:message name="addMember"&gt;
>   &lt;wsdl:part element="tns:clientUsername"
> name="clientUsername"&gt;&lt;/wsdl:part&gt;
>   &lt;wsdl:part element="tns:clientPassword"
> name="clientPassword"&gt;&lt;/wsdl:part&gt;
>   &lt;wsdl:part element="tns:member" name="member"&gt;&lt;/wsdl:part&gt;
> &lt;/wsdl:message&gt;
> </pre>
> <p>where "member" is defined as:</p><pre>
> &lt;xs:complexType name="member"&gt;
>   &lt;xs:complexContent&gt;
>     &lt;xs:extension base="tns:object"&gt;
>       &lt;xs:sequence&gt;
>         &lt;xs:element minOccurs="0" name="emailAddress"
> type="xs:string"/&gt;
>         &lt;xs:element minOccurs="0" name="firstName"
> type="xs:string"/&gt;
>         &lt;xs:element minOccurs="0" name="lastName" type="xs:string"/
>         &lt;xs:element maxOccurs="unbounded" minOccurs="0"
> name="categoryList" nillable="true" type="tns:memberCategory"/&gt;
>       &lt;/xs:sequence&gt;
>     &lt;/xs:extension&gt;
>   &lt;/xs:complexContent&gt;
> &lt;/xs:complexType&gt;</pre>
> <p>and the items in "categoryList" are defined as:</p><pre>
> &lt;xs:complexType name="memberCategory"&gt;
>   &lt;xs:complexContent&gt;
>     &lt;xs:extension base="tns:object"&gt;
>       &lt;xs:sequence&gt;
>         &lt;xs:element minOccurs="0" name="name" type="xs:string"/&gt;
>         &lt;xs:element name="category" type="tns:category"/&gt;
>       &lt;/xs:sequence&gt;
>     &lt;/xs:extension&gt;
>   &lt;/xs:complexContent&gt;
> &lt;/xs:complexType&gt;</pre>
> <p>The "memberCategory" objects typically only have the "name" attribute
> supplied (its used as a reference to look up the actual category in the
> database).</p>
> 
> <p>Here is what I thought would work, but does not appear to so far (I get
> the wrong number of parameters error):<p><ul>
> <li>member.emailAddress=user@localhost.com</li>
> <li>member.firstName=James</li>
> <li>member.lastName=Smith</li>
> <li>member.categoryList[0].name=TestCat1</li>
> <li>member.categoryList[1].name=TestCat2</li>
> </ul>
> 
> <p>Where can I find info on how the parameters from a POST are parsed by
> CXF?</p>
> 
> <p>Thanks in advance - Richard</p>
> 

-- 
View this message in context: http://www.nabble.com/REST-parameter-naming-tp19499156p19499178.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: REST parameter naming

Posted by Richard M <rn...@custco.biz>.
Bump. Can anyone give me a hint on where can I find info on how the
parameters from a POST are parsed by CXF or what naming conventions are used
for embedded arrays/lists?


Richard M wrote:
> 
> <p>How does one name the parameters in a POST for a object with a list of
> embedded objects? I've searched the doc and mailing list but not found an
> example.<p>
> <p>Here is the message definition from my WSDL:</p><pre>
> &lt;wsdl:message name="addMember"&gt;
>   &lt;wsdl:part element="tns:clientUsername"
> name="clientUsername"&gt;&lt;/wsdl:part&gt;
>   &lt;wsdl:part element="tns:clientPassword"
> name="clientPassword"&gt;&lt;/wsdl:part&gt;
>   &lt;wsdl:part element="tns:member" name="member"&gt;&lt;/wsdl:part&gt;
> &lt;/wsdl:message&gt;
> </pre>
> <p>where "member" is defined as:</p><pre>
> &lt;xs:complexType name="member"&gt;
>   &lt;xs:complexContent&gt;
>     &lt;xs:extension base="tns:object"&gt;
>       &lt;xs:sequence&gt;
>         &lt;xs:element minOccurs="0" name="emailAddress"
> type="xs:string"/&gt;
>         &lt;xs:element minOccurs="0" name="firstName"
> type="xs:string"/&gt;
>         &lt;xs:element minOccurs="0" name="lastName" type="xs:string"/
>         &lt;xs:element maxOccurs="unbounded" minOccurs="0"
> name="categoryList" nillable="true" type="tns:memberCategory"/&gt;
>       &lt;/xs:sequence&gt;
>     &lt;/xs:extension&gt;
>   &lt;/xs:complexContent&gt;
> &lt;/xs:complexType&gt;</pre>
> <p>and the items in "categoryList" are defined as:</p><pre>
> &lt;xs:complexType name="memberCategory"&gt;
>   &lt;xs:complexContent&gt;
>     &lt;xs:extension base="tns:object"&gt;
>       &lt;xs:sequence&gt;
>         &lt;xs:element minOccurs="0" name="name" type="xs:string"/&gt;
>         &lt;xs:element name="category" type="tns:category"/&gt;
>       &lt;/xs:sequence&gt;
>     &lt;/xs:extension&gt;
>   &lt;/xs:complexContent&gt;
> &lt;/xs:complexType&gt;</pre>
> <p>The "memberCategory" objects typically only have the "name" attribute
> supplied (its used as a reference to look up the actual category in the
> database).</p>
> 
> <p>Here is what I thought would work, but does not appear to so far (I get
> the wrong number of parameters error):<p><ul>
> <li>member.emailAddress=user@localhost.com</li>
> <li>member.firstName=James</li>
> <li>member.lastName=Smith</li>
> <li>member.categoryList[0].name=TestCat1</li>
> <li>member.categoryList[1].name=TestCat2</li>
> </ul>
> 
> <p>Where can I find info on how the parameters from a POST are parsed by
> CXF?</p>
> 
> <p>Thanks in advance - Richard</p>
> 

-- 
View this message in context: http://www.nabble.com/REST-parameter-naming-tp19499156p19505131.html
Sent from the cxf-user mailing list archive at Nabble.com.