javascript循环和调用soap webservice

问题描述 投票:0回答:1

我在循环中调用Web服务并将参数从DB传递到Web服务。所有Web服务调用都在循环中获得响应。这是我的响应XML节点[Siebel响应] [1] [1]: https://i.stack.imgur.com/TRCE2.png

我现有的代码是

<!-- 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
}

}
javascript loops soap xml-parsing
1个回答
0
投票

从Siebel端,ListOfServiceRequest是一个零(一个)或更多ServiceRequests列表。和

for each(var rootNodeVal in employee)

在这种情况下不正确,因为每个rootNodeVal = ServiceRequest。考虑共同循环(例如)for (var i =0; i < count; i++){ ListOfServiceRequest[i] .... }

© www.soinside.com 2019 - 2024. All rights reserved.