When you look at the content of address in the actual xml returned, is
it null? If so, that is the problem. CF can not handle nulls returned
from a COM object. SelectSingleNode() returns null if the element is
blank.

-- 
 jon
 mailto:[EMAIL PROTECTED]

Thursday, February 20, 2003, 5:51:06 PM, you wrote:
A> Hello All,
A> I am trying to implement the USPS API tool on our website. It requires that we 
parse an XML string that is returned back to us via an http get call. 

A> I think everything is ok up to the point where i have to parse the result. I get 
the following error:

A> ---0---0---0---0---0---0---0---0---0---0---0
A> Error Occurred While Processing Request
A> Error Diagnostic Information
A> An unexpected system error was detected. (Error code is 1)

A> This type of error will most likely occur when the server running ColdFusion is low 
on memory and/or system resources.
A> If you continue to experience this error in a reproducible fashion you should 
contact Allaire technical support.

A> The error occurred while processing an element with a general identifier of 
(#address#), occupying document position (39:13) to (39:21).
A> ---0---0---0---0---0---0---0---0---0---0---0
A> I have checked my system (localhost) and am having no performance and/or memory 
issues. The error goes away as soon as i comment out the cfoutput line that tries to 
display the variable #address#.
A> line 39 is where i am trying to cfoutput the address field. This is the line 
immediately after i am done parsing the xml code with the "SelectSingleNode" method.

A> The code i'm using is as follows:
A> ---0---0---0---0---0---0---0---0---0---0---0

A> <cfset
A> 
xmlbody="API=Verify&XML=<AddressValidateRequest%20USERID='224VITAC8247'%20PASSWORD='359IO45RF129'><Address%20ID='0'><Address1></Address1><Address2>6406%20Ivy%20Lane</Address2><City>Greenbelt</City><State>MD</State><Zip5></Zip5><Zip4></Zip4></Address></AddressValidateRequest>">

A> <cfset server="http://testing.shippingapis.com/ShippingAPITest.dll?";>
A> <cfhttp url="#server##xmlbody#" method="GET"></cfhttp>

A> <cfoutput>
A> #trim(cfhttp.filecontent)#
A> </cfoutput>

A> <CFOBJECT action="CREATE" type="COM" class="Microsoft.XMLDOM" name="objXML">

A> <cfset objXML.loadXML(cfhttp.filecontent)>

A> <CFSET ElementList = objXML.getElementsByTagName("AddressValidateResponse")>

A> <cfset counter=0>

A> <CFLOOP COLLECTION="#ElementList#" Item="AddressValidateResponse">
A>         <cfset counter = counter+1>
A>      <CFSET address = AddressValidateResponse.SelectSingleNode("Address2")> 
A>      <CFSET city = AddressValidateResponse.SelectSingleNode("City")>
A>          <CFSET state= AddressValidateResponse.SelectSingleNode("State")>
A>          <CFSET zip5 = AddressValidateResponse.SelectSingleNode("Zip5")>
A>          <CFSET zip4 = AddressValidateResponse.SelectSingleNode("Zip4")>
A>          <cfoutput>#address#</cfoutput>
A>          <!--- <cfoutput>#counter# - #address# - #city#</cfoutput> --->
A> </CFLOOP> 

A> <cfoutput>
A> counter=#counter#
A> </cfoutput>

A> ---0---0---0---0---0---0---0---0---0---0---0


A> Any ideas or thoughs on why this may be happening will be greatly appreciated!

A> Thanks

A> Andres
A> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to