簡體   English   中英

javascript循環並調用soap webservice

[英]javascript loop and calling soap webservice

我正在循環調用Web服務,並將參數從DB傳遞到Web服務。所有Web服務調用都在循環中得到響應。這是我的響應XML節點[Siebel response] [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
}

}

從Siebel角度來看,ListOfServiceRequest的字面是零(一個)或多個ServiceRequests的列表。

for each(var rootNodeVal in employee)

在這種情況下不正確,因為每個rootNodeVal = ServiceRequest。 考慮for (var i =0; i < count; i++){ ListOfServiceRequest[i] .... }公共循環(例如)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM