<?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://10.1.2.122/misc/dsmp.xsd '> 00110100037392 </TransactionID>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<SyncOrderRelationReq xmlns= 'http://10.1.2.122/misc/dsmp.xsd '>
<Version> 1.5.0 </Version>
<MsgType> SyncOrderRelationReq </MsgType>
<Send_Address>
<DeviceType> 0 </DeviceType>
<DeviceID> 0011 </DeviceID>
</Send_Address>
<Dest_Address>
<DeviceType> 400 </DeviceType>
<DeviceID> 0 </DeviceID>
</Dest_Address>
<FeeUser_ID>
<UserIDType> 2 </UserIDType>
<MSISDN> </MSISDN>
<PseudoCode> 00116000000286 </PseudoCode>
</FeeUser_ID>
<DestUser_ID>
<UserIDType> 2 </UserIDType>
<MSISDN> </MSISDN>
<PseudoCode> 00116000000286 </PseudoCode>
</DestUser_ID>
<LinkID> SP </LinkID>
<ActionID> 1 </ActionID>
<ActionReasonID> 1 </ActionReasonID>
<SPID> 900562 </SPID>
<SPServiceID> 04101040 </SPServiceID>
<AccessMode> 5 </AccessMode>
<FeatureStr> </FeatureStr>
</SyncOrderRelationReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
解析:
SAXBuilder builder = new SAXBuilder();
Document doc = null;
StringReader sr = new StringReader(soaptext);
doc = builder.build(sr);
Namespace senv = Namespace.getNamespace( "SOAP-ENV ", "http://schemas.xmlsoap.org/soap/envelope/ ");
Namespace trns = Namespace.getNamespace( "http://10.1.2.122/misc/dsmp.xsd ");
Element root = doc.getRootElement();
Element head = root.getChild( "Header ", senv); // <SOAP-ENV:Header>
Element tid = head.getChild( "TransactionID ", trns); //TransactionID
tidtext = tid.getText();
分享到:
相关推荐
利用DOM4J解析SOAP中的各个元素的值,在SOAP消息的收发中可以有一点借鉴的地方
本人在网上看了很多都不能很好的解析报文,就算解析也很难使用,我上传的这个里面将可以拼接soap,判断soap是否连接成功,返回接口的信息,再将报文解析,再转成java实体使用
mm7解析soap附件例子,mm7解析soap附件例子,mm7解析soap附件例子
SOAP解析,与一般的xml解析不一样,他中间存在报文,解析到就出错了,也就解析不下去,这里举了一个列子,(网络上找了好久都没找到我想要的列子,最后我自己根据例子做了整理做出来的),把数据组合成集合。...
通过dom4j解析xml文件或xml字符串,同时利用dom4j解析soap报文,解析出所需要的字段,使用的相对比较基础,有需要的可以参考一下。
自己在学习中弄得个小例子,仅供学习。
突破jdk与wsdl第三方对xml文本解析领域割据趋势,该脚本既可以支持普通xml解析,也支持soap-xml第三方xml文本的解析; 极大的节省了引入冗余jar资源; 纯底层算法解析,不依赖任何第三方工具包,自主产权维护性强。
对web services的消息,只解析soap消息头,不解析消息体。
webservice 调用实例 解析xml文档。soap协议
Java使用SOAP获取webservice实例解析 具体实例分析说明。
本人测试能成功运行并输出结果。因为项目需要,在myeclipse中测试可行,在eclipse中也已测试。请放心使用。
对基于XML的soap数据格式的完整解析
soap消息解析.rar
易语言soap消息解析源码,soap消息解析,init,eachMethod,getMethodReturnInfo,getMethodInfo,getElementName,IsContinue,invoke,getTargetNamespace,parseError
需要用编写脚本用soap协议,发送报文到服务器,我分别用soap_request函数和web_custom_request函数发送报文,soap_request可以发送,但是web_custom_request不行,而soap_request虽然能发送但是返回的报文不好解析,...
java dom4j 解析xml的例子,可用,另外内涵一个帮助类,其功能是:根据某个java工程中的文件名,获取这个文件在java工程中的绝对路径。解压加载到myeclipse上可用。
芥末一个简单的WSDL解析器。安装Wasabi可通过,并可通过以下方式安装: $ gem install wasabi入门document = Wasabi . document File . read ( "some.wsdl" ) 获取SOAP端点: document . endpoint# => ...
matlab 代码替换
/// Soap协议Post方法 /// /// <param name=uri>WebService地址 /// 传入Soap协议格式数据 /// <returns></returns> public static string SendToReturn(Uri _uri, string _str) { string _returnstr = ;