您好我有把這個SOAP請求的java程序:從xml soap響應中獲取值?
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:gs="http://talosdigital.com/buyer">
<soapenv:Header/>
<soapenv:Body>
<gs:createBuyerRequest>
<gs:name>Carlos</gs:name>
<gs:lastname>henao</gs:lastname>
</gs:createBuyerRequest>
</soapenv:Body>
</soapenv:Envelope>
,我得到這樣的響應:
SOAPMessage soapResponse = soapConection.call(soapMessage, Properties.URL);
soapResponse.writeTo(System.out);
當我打印顯示此:
<SOAP-ENV:Envelope>
<SOAP-ENV:Header />
<SOAP-ENV:Body>
<ns2:createBuyerResponse>
<ns2:id>8</ns2:id>
<ns2:response>Buyer Created</ns2:response>
</ns2:createBuyerResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
我怎樣才能在java中獲得id值(是一個整數值)。