【问题标题】:javascript loop and calling soap webservicejavascript循环和调用soap webservice
【发布时间】:2019-07-06 21:48:06
【问题描述】:

我正在循环调用 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】:

    从 Siebel 方面看,ListOfServiceRequest 是零(一个)或多个服务请求的字面列表。 还有

    for each(var rootNodeVal in employee)
    

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

    【讨论】:

      猜你喜欢
      • 2016-11-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-25
      • 2023-04-10
      • 2016-08-16
      • 1970-01-01
      相关资源
      最近更新 更多