Forum Discussion

Hariharan's avatar
Hariharan
New Contributor
12 years ago

POST Request with XML inputs

Hi All,

How can i send POST method (request) with xml inputs (as like below),

<participant>
<description>sample</description>
<system>sample</system>
<id>test</id>
<timezone>ACT</timezone>
</participant>

and its application type (Accept type) should be application/xml;
Tried with all the type such as (HEADER, QUERY, TEMPLATE and PLAIN) but no luck.

Thanks,
Hari
  • nmrao's avatar
    nmrao
    Icon for Champion Level 2 rankChampion Level 2
    what is happening currently when the request is POST'ed with http headers by including application type. Are you sure, no other http headers are required or missing?
  • Hariharan's avatar
    Hariharan
    New Contributor
    Rao,

    Thanks for replay,

    Getting this exception while POST the request - "org.springframework.http.converter.HttpMessageNotReadableException: Could not unmarshal to[class com.server.domain.Participant]: null; nested exception is javax.xml.bind.UnmarshalException - with linked exception: [org.xml.sax.SAXParseException: Premature end of file.]"

    I've included Authentication header with preemptive type and i'm sure that no other headers are needed for this request.

    Able to POST the request successfully without any issues using RestClient firefox plugin.

    Thanks,
    Hari
  • slabarbara's avatar
    slabarbara
    New Contributor
    I believe this is a similar problem I am experiencing when sending a JSON object in a POST. Only occurs in SoapUI. Works with all other tools
  • nmrao's avatar
    nmrao
    Icon for Champion Level 2 rankChampion Level 2
    Sorry for the delay Hari.

    Have you noticed Raw request sent by soapui and compare with post request you doing thru ff plugin. Any thing differs?