I have to make a SOAP POST request as below
POST /sample/demo.asmx HTTP/1.1
Host: www.website.org
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://www.website.org/Method"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Method xmlns="https://www.ourvmc.org/">
<item1>string</item1>
<item2>string</item2>
<item3>string</item3>
<item4>string</item4>
</Method>
</soap:Body>
</soap:Envelope>
I have acheived upto
POST /sample/demo.asmx HTTP/1.1
Host: www.website.org
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://www.website.org/Method"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Method xmlns="http://tempuri.org/"/>
</soap:Body>
</soap:Envelope>
and I have a POJO class with name Method and getter setter for all the item1, item2, item3, item4. I need to convert that POJO to xml format which is
<item1>string</item1>
<item2>string</item2>
<item3>string</item3>
<item4>string</item4>
and then POST it. can any one suggest how to do it ? I have researched but didn't find any useful solution.