日期:2014-05-20 浏览次数:20603 次
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body><ACIC_MessageBrokerService xmlns="http://www.ACIC.MessageBrokerService.com/"> <ServiceID>0428000001</ServiceID> <obj> <anyType xsi:type="xsd:string">par1</anyType> <anyType xsi:type="xsd:int">0</anyType> <anyType xsi:type="xsd:boolean">true</anyType> </obj></ACIC_MessageBrokerService> </soap:Body> </soap:Envelope>
Element obj = root.element("Body").element("ACIC_MessageBrokerService").element("obj"); List<Element> types = obj.elements("anyType"); for (Element elem : types) { System.out.println(elem.getName() + ": " + elem.getText()); }