问题描述
我正在循环调用Web服务,并将参数从DB传递到Web服务。所有Web服务调用都在循环中得到响应。这是我的响应XML节点[Siebel response] [1] [1]:
我现有的代码是
<!-- language: lang-js -->
for(db=0;db.length;db++) // db loop
{
//call webservice and get below is **employeeData is multiple soap webservice response** xml that is attached in the picture.
var soapEnv = new Namespace("SOAP-ENV","http://schemas.xmlsoap.org/soap/envelope/");
var rpc = new Namespace("http://siebel.com/asi/");
var siebelMessage = **employeeData**.soapEnv::Body.rpc::STEMIServiceRequestThinRefreshResponse.SiebelMessage;
default xml namespace = "http://www.siebel.com/xml/STE%20MI%20Service%20Request%20Thin%20Refresh";
var employee = siebelMessage.ListOfSteMIServiceRequestThinRefresh.ListOfServiceRequest["ServiceRequest"];
for each(var rootNodeVal in employee) {
// do parsing but it executes only the first response and exits any advice
}
}
1楼
从Siebel角度来看,ListOfServiceRequest的字面是零(一个)或多个ServiceRequests的列表。 和
for each(var rootNodeVal in employee)
在这种情况下不正确,因为每个rootNodeVal = ServiceRequest。
考虑for (var i =0; i < count; i++){ ListOfServiceRequest[i] .... }
公共循环(例如)