Here is an example assuming following is the schema.
<xs:element name="EchoName" type="xsmt:EchoStructType"/>
<xs:complexType name="EchoStructType">
<xs:sequence>
<xs:element name="FirstName" type="xs:string"/>
<xs:element name="MiddleName" type="xs:string"/>
<xs:element name="LastName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
The following is how the request (the payload) will be,
<ns1:EchoName xmlns:ns1="http://example.org/message-test/xsd">
<ns1:FirstName>myfirst</ns1:FirstName>
<ns1:MiddleName>mymiddle</ns1:MiddleName>
<ns1:LastName>mylast</ns1:LastName>
</ns1:EchoName>
Thanks,
Keith.
On 7/4/07, Raghu Upadhyayula <[EMAIL PROTECTED]> wrote:
Thanks Anne.
How do you submit a request having complex types with a POST? Can you
show me for the login method sample with User object containing username &
password?
Thanks
Raghu
------------------------------
*From:* Anne Thomas Manes [mailto:[EMAIL PROTECTED]
*Sent:* Tuesday, July 03, 2007 2:41 PM
*To:* [email protected]
*Subject:* Re: Axis2 & rest
You can submit a resource representation (containing complex types) using
PUT or POST.
But Jeff is correct that you cannot submit a complex query parameter via
URL encoding.
Also note that encoding a password as a query parameter in a URL (per
Raghu's example) violates just about every security best practice
imaginable.
And this time I'll bite my tongue and not rant about the inappropriateness
of turning a method into a resource.
Anne
On 7/3/07, *Walker**, Jeff *<[EMAIL PROTECTED]> wrote:
You don't pass complex types in REST web services. Period.
It's all about those Query parameters, the name-value pairs following
the '?' and separated by the '&'.
REST services is all about manipulating resources, not passing complex
types.
If you want to send complex types, then you need the so-called 'big' web
services technologies like SOAP/WSDL.
-jeff
-----Original Message-----
From: Raghu Upadhyayula [mailto: [EMAIL PROTECTED]
Sent: Tuesday, July 03, 2007 3:45 PM
To: [email protected]
Subject: RE: Axis2 & rest
Hi Zakaria,
For the methods with simple parameters you use it like this....
Say I have a webservice MyService with login method and username
& password parameters, then the rest URL will look like this.
http://localhost/axis2/services/MyService/login?username=raghu&password=
xxx
But I'm not sure how to call it if the parameter is a complex
type, like if my login method takes in a User object which has username
& password as members of the User object, then I'm not sure how to call
that.
Thanks
Raghu
-----Original Message-----
From: zakaria ghandour [mailto: [EMAIL PROTECTED]
Sent: Tuesday, July 03, 2007 9:10 AM
To: [email protected]
Subject: Re: Axis2 & rest
Hi,
axis2/services/{service name}/{Operation name}
can you tel me how to call ws as rest if there is parameters ??
thanks
--
View this message in context:
http://www.nabble.com/Axis2---rest-tf4018616.html#a11414842
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/