我成功地将字符串和int发送到soap而不是xml SOAPAction:
"iReceiver/XPL-CIMS-iReceiver-RecordIssuesData"
<?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>
<XPL-CIMS-iReceiver-RecordIssuesData xmlns="iReceiver">
<A_iStaffDId>int</A_iStaffDId>
<A_strGUID>string</A_strGUID>
<dsIssues>
<xsd:schema>schema</xsd:schema>xml</dsIssues>
</XPL-CIMS-iReceiver-RecordIssuesData>
</soap:Body>
</soap:Envelope>
我是stackoverflow的新手。请帮助我提前谢谢
答案 0 :(得分:0)
使用以下方法将其转换为xml并以这种方式调用它: 文档文档= XMLfromString(Str);
然后以这种方式解析
NodeList node = document.getElementsByTagName(&#34; firsttag&#34;)并发送
public Document XMLfromString(String v){
Document doc = null;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(v));
doc = db.parse(is);
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
System.out.println("Wrong XML file structure: " + e.getMessage());
return null;
} catch (IOException e) {
e.printStackTrace();
}
return doc;
}