日期:2014-05-16 浏览次数:20367 次
Ext.define('Ext.data.soap.Reader', {
extend: 'Ext.data.reader.Xml',
alias: 'reader.soap',
getData: function(data) {
var envelope = data.documentElement,
// we can't always assume that the Body element's namespace prefix is "soap",
// but we can assume that it is the same as the envelope's namespace prefix
prefix = envelope.prefix;
return Ext.DomQuery.selectNode(prefix +'|Body', data);
}
});
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<fjs1:GetDepartmentDataResponse xmlns:fjs1="http://www.digiwin.com.cn/tiptop/TIPTOPServiceGateWay">
<fjs1:response>
<fjs1:element>
<fjs1:gem01>00010</fjs1:gem01>
<fjs1:gem02>大陆10</fjs1:gem02>
<fjs1:gemacti>Y</fjs1:gemacti>
</fjs1:element>
<fjs1:element>
<fjs1:gem01>00011</fjs1:gem01>
<fjs1:gem02>大陆11</fjs1:gem02>
<fjs1:gemacti>Y</fjs1:gemacti>
</fjs1:element>
<fjs1:element>
<fjs1:gem01>00012</fjs1:gem01>
<fjs1:gem02>大陸12</fjs1:gem02>
<fjs1:gemacti>Y</fjs1:gemacti>
</fjs1:element>
<fjs1:element>
<fjs1:gem01>001</fjs1:gem01>
<fjs1:gem02>管理部</fjs1:gem02>
<fjs1:gemacti>N</fjs1:gemacti>
</fjs1:element>
<fjs1:element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"></fjs1:element>
</fjs1:response>
</fjs1:GetDepartmentDataResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<m:GetBlendersResponse xmlns:m="http://example.com/">
<m:Blender>
<m:id>1</m:id>
<m:name>Total Blender Classic WildSide</m:name>
<m:price>454.95</m:price>
</m:Blender>
<m:Blender>