简体   繁体   English

如何使用ColdFusion访问XML / SOAP中的响应节点?

[英]How to access Response Nodes in XML/SOAP using ColdFusion?

I am using ColdFusion 8. 我正在使用ColdFusion 8。

I am trying to access my SOAP response nodes. 我正在尝试访问我的SOAP响应节点。 I can't seem to access them though. 我似乎无法访问它们。 What I get is an empty array. 我得到的是一个空数组。 My SOAP response looks great. 我的SOAP响应看起来很棒。 I get what I expect. 我得到了我的期望。

You can view the array and the SOAP response here: http://dev.iqcatalogs.com/avcat/myiq/test-11.cfm 您可以在此处查看数组和SOAP响应: http//dev.iqcatalogs.com/avcat/myiq/test-11.cfm

I have used Ben Nadel's blog post as a starting point (http://www.bennadel.com/blog/1809-Making-SOAP-Web-Service-Requests-With-ColdFusion-And-CFHTTP.htm) 我使用Ben Nadel的博客文章作为起点(http://www.bennadel.com/blog/1809-Making-SOAP-Web-Service-Requests-With-ColdFusion-And-CFHTTP.htm)

I am parsing the XML like this: 我正在解析这样的XML:

soapResponse = xmlParse(httpResponse.fileContent);

I am trying to access the nodes like this: 我试图访问这样的节点:

responseNodes = xmlSearch(soapResponse, "//*[ local-name() = 'exhibitorlist' ]");

Some of my XML looks like this: 我的一些XML看起来像这样:

<exhibitorlist boothid="104686">
    <eventid>1</eventid>
    <eventcode>
      <eventname>Infocomm06</eventname>
      <boothnumber>1263</boothnumber>
      <companyid>408</companyid>
      <companynumber>173023</companynumber>
      <companyname>AMETEK Hunter Spring Products</companyname>
    </eventcode>
</exhibitorlist>

When I dump responseNodes, I get an empty array. 当我转储responseNodes时,我得到一个空数组。 I've tried a bunch of things, but nothing seems to get into the array. 我尝试了很多东西,但似乎没有任何东西进入阵列。

Can you help? 你能帮我吗?

have you tried:? 你有没有尝试过:?

responseNodes = xmlSearch(soapResponse, "//ExhibitorList");

It should return all exhibitorlist elements in the document. 它应该返回文档中的所有Exhibitorlist元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM