Hi,
Just looking at the types section in your WSDL it looks like you
cannot use application/x-www-form-urlencoded
contentType for this request. The reason is this. Taking the addEntry
operation as an example.
<xs:complexType name="Entry">
<xs:sequence>
<xs:element minOccurs="0" name="city" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="id" nillable="true" type="xs:int"/>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="postalCode" nillable="true"
type="xs:string"/>
<xs:element minOccurs="0" name="state" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="street" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="addEntry">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="entry" nillable="true"
type="ns0:Entry"/>
</xs:sequence>
</xs:complexType>
</xs:element>
As you can see addEntry element contains another complex type within it.
Hence the parameters at the serverside cannot produce the required SOAP
message that Axis2 needs. This will work perfectly with application/xml on a
post though. Can you try to codegenerate a stub using the -pn
AddressBookServiceSOAP11port_http option. That should work out of the box
and you dont have to worry about creating the contents using OMElements.
Please let me know if you need further help.
Thanks,
Keith.
On 10/8/07, Takanori Suzuki <[EMAIL PROTECTED]> wrote:
>
> Thanks Deepal,
> I send the source of service and client.
>
> Please check that.
>
> But, I have another two question.
>
> ------------------------------------------------------------
> 1) Request parameters aren't URL encoded at HTTP POST.
>
> If the REST request is send by HTTP GET/DELETE,
> the parameters are URL encoded.
>
> But, if the REST request is send by HTTP POST/PUT,
> the parameters are not URL encoded.
>
> I look at the source of AbstractHTTPSender#populateCommonProperties,
> and XFormURLEncodedFormatter#getBytes.
>
> Why ?
> I thought that it is better which parameters are encoded at HTTP
> POST/PUT.
>
>
> ------------------------------------------------------------
> 2) Session management at sendRobust.
>
> If I use ServiceClient#sendRobust,
> the session can't be managed.
>
> When the http response is "Accepted(Status 202)",
> the http header "Set-Cookie" is ignore.
>
> I look at the source of HTTPSender#handleResponse.
>
> I want to be managed session at using ServiceClient#sendRobust.
>
>
> Please help me.
>
> Takanori
>
> 07/10/08 に Deepal jayasinghe<[EMAIL PROTECTED]> さんは書きました:
> > Hi Takanori ,
> >
> > Can you please send us the full source code then I may be able to look
> > at that.
> >
> > Thanks
> > Deepal
> > > Hi, I use Axis2 1.3.
> > >
> > > If I'd like to create a POJO-based RESTFul serivce,
> > > but the service isn't received the JavaBean.
> > >
> > > ex)
> > > service
> > > ------------------------------------------------------------
> > > public class AddressBookService {
> > >
> > > private Map<Integer, Entry> entries = new TreeMap<Integer,
> Entry>();
> > >
> > > public void addEntry(Entry entry) {
> > > this.entries.put(entry.getId(), entry);
> > > }
> > > }
> > >
> > > REST request(POST)
> > > ------------------------------------------------------------
> > > POST /s2axis2-examples/services/AddressBookService/addEntry HTTP/1.1
> > > Content-Type: application/x-www-form-urlencoded;
> > > charset=UTF-8;action="urn:addEntry";
> > > Cookie: JSESSIONID=FE93DF26AE10A5D1C336AA27089E9020;
> Path=/s2axis2-examples
> > > SOAPAction: urn:addEntry
> > > User-Agent: Axis2
> > > Host: 127.0.0.1:8088
> > > Transfer-Encoding: chunked
> > >
> > > 88
> > >
> id=1&name=Abby%20Cadabby%20:%201&street=Sesame%20Street%20:%201&city=Sesame%20City%20:%201&state=Sesame%20State%20:%201&postalCode=123-1
> > > 0
> > >
> > >
> > > When the service is received 'Entry',
> > > It is always null.
> > >
> > > I make the request as GET and POST request,
> > > but the result is same.
> > >
> > >
> > > Please tell me how to create a POJO-based RESTFul serivce.
> > >
> > >
> > > Takanori.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> > --
> > Thanks,
> > Deepal
> > ................................................................
> > "The highest tower is built one brick at a time"
> >
> >
> > ---------------------------------------------------------------------
> > 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/