简体   繁体   中英

How to get value from soap message?

I want to ask if there are any ways to retrieve data from soap request? I know this question may be asked frequently. However I cannot find a great answer that suit my question. Here is my request:

<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<ns1:getFruit soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <aGetFruitRequest href="#id0"/>
</ns1:getFruit>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:GetFruitRequest">
    <name xsi:type="xsd:string">apple</name>
    <type xsi:type="xsd:string">fruit</type>
</multiRef>
</soapenv:Body>

I want to get the value 'apple' and 'fruit' that is in the tag 'name' and 'type'. Is there any way to do that in java?

Thanks

您可以使用Apache Axis,或者如果要提取所有值,则可以使用JXPath自己解析响应。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM