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:
<wsdl:message name="addMember">
<wsdl:part element="tns:clientUsername"
name="clientUsername"></wsdl:part>
<wsdl:part element="tns:clientPassword"
name="clientPassword"></wsdl:part>
<wsdl:part element="tns:member" name="member"></wsdl:part>
</wsdl:message>
where "member" is defined as:
<xs:complexType name="member">
<xs:complexContent>
<xs:extension base="tns:object">
<xs:sequence>
<xs:element minOccurs="0" name="emailAddress"
type="xs:string"/>
<xs:element minOccurs="0" name="firstName" type="xs:string"/>
<xs:element minOccurs="0" name="lastName" type="xs:string"/
<xs:element maxOccurs="unbounded" minOccurs="0"
name="categoryList" nillable="true" type="tns:memberCategory"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
and the items in "categoryList" are defined as:
<xs:complexType name="memberCategory">
<xs:complexContent>
<xs:extension base="tns:object">
<xs:sequence>
<xs:element minOccurs="0" name="name" type="xs:string"/>
<xs:element name="category" type="tns:category"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
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>
> <wsdl:message name="addMember">
> <wsdl:part element="tns:clientUsername"
> name="clientUsername"></wsdl:part>
> <wsdl:part element="tns:clientPassword"
> name="clientPassword"></wsdl:part>
> <wsdl:part element="tns:member" name="member"></wsdl:part>
> </wsdl:message>
> </pre>
> <p>where "member" is defined as:</p><pre>
> <xs:complexType name="member">
> <xs:complexContent>
> <xs:extension base="tns:object">
> <xs:sequence>
> <xs:element minOccurs="0" name="emailAddress"
> type="xs:string"/>
> <xs:element minOccurs="0" name="firstName"
> type="xs:string"/>
> <xs:element minOccurs="0" name="lastName" type="xs:string"/
> <xs:element maxOccurs="unbounded" minOccurs="0"
> name="categoryList" nillable="true" type="tns:memberCategory"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType></pre>
> <p>and the items in "categoryList" are defined as:</p><pre>
> <xs:complexType name="memberCategory">
> <xs:complexContent>
> <xs:extension base="tns:object">
> <xs:sequence>
> <xs:element minOccurs="0" name="name" type="xs:string"/>
> <xs:element name="category" type="tns:category"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType></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>
> <wsdl:message name="addMember">
> <wsdl:part element="tns:clientUsername"
> name="clientUsername"></wsdl:part>
> <wsdl:part element="tns:clientPassword"
> name="clientPassword"></wsdl:part>
> <wsdl:part element="tns:member" name="member"></wsdl:part>
> </wsdl:message>
> </pre>
> <p>where "member" is defined as:</p><pre>
> <xs:complexType name="member">
> <xs:complexContent>
> <xs:extension base="tns:object">
> <xs:sequence>
> <xs:element minOccurs="0" name="emailAddress"
> type="xs:string"/>
> <xs:element minOccurs="0" name="firstName"
> type="xs:string"/>
> <xs:element minOccurs="0" name="lastName" type="xs:string"/
> <xs:element maxOccurs="unbounded" minOccurs="0"
> name="categoryList" nillable="true" type="tns:memberCategory"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType></pre>
> <p>and the items in "categoryList" are defined as:</p><pre>
> <xs:complexType name="memberCategory">
> <xs:complexContent>
> <xs:extension base="tns:object">
> <xs:sequence>
> <xs:element minOccurs="0" name="name" type="xs:string"/>
> <xs:element name="category" type="tns:category"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType></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.