McDar, If it the response did not have the nested elements, I think it would be pretty easy to get the element by the id and then display the data. Because nested two or three levels down, I can't figure out how to get down to activity elements, get their data and then hit the next activity element.
To get Tracking Number: Set NodeList = mydoc.documentElement.selectNodes("Package") Response.Write NodeList.Item(x).selectSingleNode("TrackingNumber").Text Caryl
I don't think I'm making much sense. If you look at the xml that's returned, I need to be able to loop through the <activity details> and display the data under each.
Hey mopacfan. I do understand what you want. the problem was I couldn't get the same response, so I can develop some code to parse thru the xml results. I am currently still trying to work on getting results, Thanks to jongalloway, I at least got some real XML results, only now I get: <?xml version="1.0" ?> - <TrackResponse> - <Response> - <TransactionReference> <CustomerContext>Example 1</CustomerContext> <XpciVersion>1.0001</XpciVersion> </TransactionReference> <ResponseStatusCode>0</ResponseStatusCode> <ResponseStatusDescription>Failure</ResponseStatusDescription> - <Error> <ErrorSeverity>Hard</ErrorSeverity> <ErrorCode>151044</ErrorCode> <ErrorDescription>No tracking information available</ErrorDescription> </Error> </Response> </TrackResponse> Code (markup): Will keep trying and will post here when I find or write parsing code for this. Hope you would do the same if you find or write it before me.
Hello mopacfan, are you still looking for help with your XML tracking? I Work for the Ebusiness department by ups and have writen my own codes for almost all the ÚPS Xml Tools if you still need help drop me a line. heres a link to my demo. http://www.bell-edv.com/portal/upstracking/tracking.asp Best regards Stephen J. Bell
Thank you very much for your generous offer. I did, in fact, get the xml application working. After doing much reading and taking an intermediate xml class, I was able to figure out how to parse the xml file and display the results. My code has been in use now for several months. However, I will keep your url bookmarked just in case I need to do something a little more advanced. Thanks again, Michael
Hey guys we are talking ASP not PHP. I recommend using XSL. It is a formatting language used to format XML documents for output. You can output to HTML, XML or text. So you could write an XSL stylesheet like this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/> <xsl:template match="/"> <html><title>test</title> <body> <xsl:apply-templates select="TrackResponse/Shipment/Package/Activity"/> </body> </html> </xsl:template> <xsl:template match="Activity"> <p>Location: <xsl:value-of select="ActivityLocation/Description"/><p> <!-- output more fields here --> </xsl:template> </xsl:stylesheet> Code (markup): Then call the Transform method and pass the XSL and the XML documents. Ross
hello, I would like to create asp page that gets shipping rates from UPS website. I need to send package (size, weight, zip, country...etc) information from checkout page and receive shipping rates options and let customer select the rate. Finally, shipping cpst will be added to total. I have looked at UPS online tools and documents. I am new to xml. I do not know where to start. Thanks
bmw, I can probably help point you in the right direction. Send me your code for which you want to program against and I'll see what I can do. Mopacfan
mopacfan, I do not have specific code. I have sample codes from ups online tools. But I do not know where to start. I need to know how I can put all codes together as asp page. I have looked at mcdar's code. It is getting specific rate types. But I need to put these fields from form fields. I am trying to do: take information from form fields (package size and weight, zip, city, state...etc), send UPS to request shipping rate, receive results, let user select shipping typwe/rate, and this rate will be added to billing amount. if you or someone used ups tools before, please guide me to put all together. Thanks a lot. BMW
Has anyone got the UPS Rates and Service to work under ASP.NET?? If you can you please sent me the block of codes or give me an Example. Thanks
i tried Caryl code(posted on 06-08-2004) on localhost with net facility. i got error message "msxml3.dll: server not found on line 14. Kindly give a little supporting comments . I am working on ASP page.I need to track shippment of UPS. From the specs i got ,i have to send an XML_request to the ups.com/xml/track and i will get reponse in xml-doc again. If i am true ,kindly confirm me if the code Caryl posted on 06-08-2004 will help me or not?If no.Then i would like to get what changs i have to do in code. If yes then resolve the cause of error message "server not found". It is important to mention that i am testing my code from localhost. Do i need MSXML to install? or i need to upload the trial page ??.
Hi, I just start to touch UPS API with ASP/XML too. I already test everything and it runs pretty well accroding to the code in this topic. You can add My msn boyice@hotmail.com, We can talk about it if you still not solute it. For Other cool guy/gal: I have last question for userid/password/XML accessnumber of UPS. The userid/password is my account of UPS.com?
Am using PHP 4.0. I am trying to integrate UPS with my shopping cart for calculating shipping cost. Can anyone tell me how am i to do it. thanks