Issue with SOAP xml generated by WebserviceTemplate's API
Hello All
I am developing a client to send the XML request to webservice using spring webservice client API. I am using following code:
String xml = createXML();
StringSource objToXMLSource = new StringSource(xml);
Writer xmlToObj = new StringWriter();
StreamResult responseResult = new StreamResult(xmlToObj);
webServiceTemplate.sendSourceAndReceiveToResult(ob jToXMLSource, responseResult);
XML is: <SIMPLRequest xmlns="http://simpl.web.gs.com/simpl/schemas"><RequestIssues><SourceIdentifier>SAD</SourceIdentifier><RequestType>core</RequestType><Exclude>Non-Issue</Exclude></RequestIssues></SIMPLRequest>
In logs I am seeing that following SOAP xml, which is not correct, is formed out of above xml:
Received request [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:SIMPLRequest http://simpl.web.gs.com/simpl/schemas="http://simpl.web.gs.com/simpl/schemas" xmlns:ns1="http://simpl.web.gs.com/simpl/schemas"><ns1:RequestIssues><ns1:SourceIdentifier> SAD</ns1:SourceIdentifier><ns1:RequestType>core</ns1:RequestType><ns1:Exclude>Non-Issue</ns1:Exclude></ns1:RequestIssues></ns1:SIMPLRequest></soapenv:Body></soapenv:Envelope>]
Please tell me why the portion highlighted in bold is forming and how to avoid it. Please respond ASAP.
Thanks
Harish Kumar