SOAP包解释
SOAPMessage soapMsg = soapMessage;
SOAPPart soapPart = null;
SOAPEnvelope soapEnvelope = null;
SOAPHeader soapHeader = null;
SOAPBody soapBody = null;
soapPart = soapMsg.getSOAPPart();
soapEnvelope = soapPart.getEnvelope();
soapHeader = soapEnvelope.getHeader();
soapBody = soapEnvelope.getBody();
我用java.util.Iterator iter = soapBody.getChildElements();
SOAPBodyElement ele = (SOAPBodyElement)iter.next();//这一行报CastClassException
请问怎么样解释以下文档的,希望给出原码
<?xml version="1.0" encoding="utf-8" ?>
- <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
- <SOAP-ENV:Header>
<TransactionID xmlns="http://www.monternet.com/dsmp/schemas/">110000000001</TransactionID>
</SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <SyncOrderRelationReq xmlns="12345.com">
<Version>1.5.0</Version>
<MsgType>SyncOrderRelationReq</MsgType>
- <Send_Address xmlns="abc.com">
<DeviceType>201</DeviceType>
<DeviceID>SZ12345</DeviceID>
</Send_Address>
- <Dest_Address>
<DeviceType>11</DeviceType>
<DeviceID>BJ88888</DeviceID>
</Dest_Address>
- <FeeUser_ID>
<UserIDType>1</UserIDType>
<MSISDN>13651412464</MSISDN>
<PseudoCode>011</PseudoCode>
</FeeUser_ID>
- <DestUser_ID>
<UserIDType>2</UserIDType>
<MSISDN>13662667675</MSISDN>
<PseudoCode>012</PseudoCode>
</DestUser_ID>
<LinkID>ForLulu</LinkID>
<ActionID>2</ActionID>
<ActionReasonID>7</ActionReasonID>
<SPID>900513</SPID>
<SPServiceID>06040004</SPServiceID>
<AccessMode>3</AccessMode>
<FeatureStr>news</FeatureStr>
</SyncOrderRelationReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
问题点数:100、回复次数:5Top
1 楼kisspy(风之行)回复于 2005-04-14 17:25:06 得分 0
顶上去Top
2 楼usabcd(9号公路上的3名共军)回复于 2005-04-14 21:59:07 得分 50
为什么不用RPC方式,那样会很省事,不用这么辛苦。
Top
3 楼kisspy(风之行)回复于 2005-04-15 17:29:52 得分 0
RPC方式,试试看Top
4 楼skyct(绝缘)回复于 2005-04-18 21:26:31 得分 50
SOAPBodyElement ele = (SOAPBodyElement)iter.next();
这一行改成:
SOAPElement ele = (SOAPElement) iter.next();Top
5 楼kisspy(风之行)回复于 2005-04-25 14:41:42 得分 0
搞定了Top




