1
我有這樣的響應消息:如何通過名稱調解OMElement?
<message>
<header>
<TransactionID>1</TransactionID>
<Timestamp>2012-05-22 10:10:36</Timestamp>
<OpCode>BOSS_DELETE_USER_SME.CD</OpCode>
<MsgType>RESP</MsgType>
<ReturnCode>1016</ReturnCode>
<ErrorMessage>uif return error message!</ErrorMessage>
</header>
</message>
我需要擴展類轉換RetuenCode「1016」到「0」。如何獲得OMElement「ReturnCode」中介?我的代碼失敗了。
SOAPEnvelope envelope = context.getEnvelope();
SOAPBody soapBody = envelope.getBody();
QName ReturnCode = new QName(null, "ReturnCode");
OMElement response = soapBody.getFirstChildWithName(ReturnCode);
是的,它在SOAP主體。但是如何獲得元素「ReturnCode」。我想通過名稱獲得它,但失敗了。如何在媒體中按名稱獲取元素?你可以幫幫我嗎?非常感謝你。 – luohao
非常感謝。我已經解決了這個問題 – luohao