'add xml string or text in soap body without using documentFactory? is it possible?
String payload = "<GetAccountList xmlns='http://example.com'><AccountId>wadjqweh-38ur2f</AccountId></GetAccountList>";
lets say this is may string payload and want to add it inside soap body element, I dont see any options!!
Note: I have used this method. it is working but giving me some problem while building my application.
private static Document convertStringToDocument(String xmlStr) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder;
try {
factory.setNamespaceAware(true);
builder = factory.newDocumentBuilder();
Document doc = builder.parse(new InputSource(new StringReader(xmlStr)));
return doc;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
