简体   繁体   English

如何从肥皂信息中获得价值?

[英]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? 有什么办法可以在Java中做到这一点吗?

Thanks 谢谢

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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