TeleFlow Forums
http://teleflow.org/phpbb/

HTTP Get and XML Fetc
http://teleflow.org/phpbb/viewtopic.php?f=16&t=379
Page 1 of 1

Author:  rgranados [ Tue Jul 11, 2006 12:42 pm ]
Post subject: 

I'm using the HTTP resource control, It access a web services with the Get command(Http request type). For example: <a href="http://127.0.0.1/WS/GetName?Id=1 " target="_new">http://127.0.0.1/WS/GetName?Id=1 </a><br>After that step I performed a XML Load. They both finalized sucessfully. But when I performed the XML Fetch, it shows this error "Warning: Node has no attributes FAILURE". <br>For example, if the xml is: <br><?xml version="1.0" encoding="utf-8" ?> <br><RESPONSE> <br> <NAME>Card Balance</NAME> <br></RESPONSE> <br>How can I fill the XML Fetch control to obtain the name data. I have tried: <br>---------------------------- <br>XML_HANDLE=022 <br>NODE= RESPONSE->NAME <br>VARIABLE TO REC DATA= @LCLNAME <br>--------------------------- <br>XML_HANDLE=022 <br>RESPONSE->NAME AS LCLNAME <br>--------------------------- <br>XML_HANDLE=022 <br>NODE= RESPONSE <br>NAME AS LCLNAME <br>--------------------------- <br>The problem is that they failed. How can I store the result in the LCLNAME variable? <br> <br>Thanks

Author:  Chris [ Tue Jul 11, 2006 2:11 pm ]
Post subject: 

The first of your fetch examples was correct. This is actually a problem with the XML Fetch step. <br> <br>This issue (Failure due to empty attributes field) will be fixed in an upcoming release of TeleFlow. <br> <br>In the meantime, you have two possible workarounds: <br> <br>1) You can create some false attributes in the node you are fetching, and retrieve them. <br>Sample XML for this: <br><?xml version="1.0" encoding="utf-8" ?> <br><RESPONSE> <br><NAME UNUSED="UNUSED">Card Balance</NAME> <br></RESPONSE> <br> <br>Attributes field: UNUSED <br> <br>This will create a variable called @UNUSED, but will work. <br> <br>2) Put "UNUSED" in the attributes field. This will cause the step to go down the FAIL path when it tries to retrieve the attribute that isn't in the XML document. You can route the FAIL (bomb) path of the XML fetch to a Compare step. Use that compare to see if the node was empty. If it is empty, assume the fetch failed for some reason other than the attribute problem, or that the node was indeed empty. If it is populated with data, this simply means the step failed because of the missing attribute. You should create the empty local or global variable to receive the node data prior to the XML Fetch.

Author:  Chris [ Wed Aug 09, 2006 10:39 am ]
Post subject: 

The current release version of TeleFlow addresses this issue. <br> <br>You can now have an empty attributes field, and still run the XML Fetch to retrieve the nodes you are looking for.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/