2017-08-14 15 views
0

SOAPリクエストからデータを取得する方法があるかどうか尋ねたいですか?私はこの質問が頻繁に聞かれるかもしれないことを知っているしかし私は私の質問に合った素晴らしい答えを見つけることができません。ここ は私の要求です:soapメッセージから価値を引き出す方法は?

<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> 

私は、タグの「name」と「タイプ」である値「りんご」と「果物」を取得したいです。 Javaでこれを行う方法はありますか?

おかげ

答えて

0

あなたがApache Axisかを使用することができますが、あなたがしたい場合は、すべてのそれらの値を抽出することである場合は、応答を自分でパーサーに代わりJXPathを使用することができます。

関連する問題