0

我成功地将字符串和 int 发送到肥皂,但不是 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的新手。请帮助我提前感谢

4

1 回答 1

0

使用以下方法将其转换为 xml 并以这种方式调用它: Document document = XMLfromString(Str);

然后以这种方式解析它

NodeList node = document.getElementsByTagName("firsttag") 并发送

公共文档 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;

}
于 2013-02-26T10:52:14.437 回答