macromedia.coldfusion.advanced_techniques
[Top] [All Lists]

Re: Complex data type help sought

Subject: Re: Complex data type help sought
From: "wltiii"
Date: Tue, 26 Feb 2008 22:43:26 +0000 UTC
Newsgroups: macromedia.coldfusion.advanced_techniques

It is an xml struct, apparently, at least the function IsXml returns YES. I 
have been trying for hours, with no luck, at parsing the response, however. The 
SOAP response, of course, is the same as shown before. So, perhaps, you can 
spot something in my code that prevents my being able to successfully use the 
XmlSearch function, or to properly display results, or whatever it is I am 
doing wrong. I've attached my latest code (a snippet of what has been 
previously shown), and the results. The [b]TYPE[/b] should have two 
occurrences, as far as I can see. So, the having the results from the CFDUMP 
state [i]array [empty][/i] is confusing. Being empty, that explains why the 
reference to [b]type[1][/b] returns [i]The element at position 1 cannot be 
found[/i]. I just don't understand why it should be empty. Something wrong with 
my search? Something wrong with my subsequent reference to type?

 ----------------------------------------------------
 my code snippet
 ----------------------------------------------------
             OUT = ws.Z_YXG_SIMPLE_INPUT_TEST(#myArray#, 2, "This is a test.");
             req = getSOAPRequest(ws);
             resp = getSOAPResponse(ws);
             XMLText = ToString(resp);
         </cfscript>
                <cfset mydoc = XmlParse(XMLText)>
                <cfset type = XmlSearch(mydoc, 
"/soap-env:Envelope/soap-env:Body/Z_YXG_SIMPLE_INPUT_TESTResponse/BAPIRET2/item/
TYPE")>
                <cfdump var="#type#">
                <cfoutput>
                        <br>Is it well formed XML text? #IsXML(XMLText)#
                        <br>type=[#type[1].XmlValue#]

 ----------------------------------------------------
 my results
 ----------------------------------------------------
 array [empty] 

 Is it well formed XML text? YES 
 type=[ 
 The element at position 1 cannot be found.


<Prev in Thread] Current Thread [Next in Thread>