1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

XML - ASP - UPS - Help

Discussion in 'C#' started by mopacfan, May 19, 2004.

  1. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #21
    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.
     
    mopacfan, Aug 17, 2004 IP
  2. mcdar

    mcdar Peon

    Messages:
    1,831
    Likes Received:
    110
    Best Answers:
    0
    Trophy Points:
    0
    #22
    To get Tracking Number:

    Set NodeList = mydoc.documentElement.selectNodes("Package")

    Response.Write NodeList.Item(x).selectSingleNode("TrackingNumber").Text

    Caryl
     
    mcdar, Aug 18, 2004 IP
  3. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #23
    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.
     
    mopacfan, Aug 18, 2004 IP
  4. RoLYroLLs

    RoLYroLLs Guest

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #24
    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.
     
    RoLYroLLs, Sep 6, 2004 IP
  5. europebell

    europebell Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #25
    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
     
    europebell, Mar 25, 2005 IP
  6. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #26
    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
     
    mopacfan, Mar 25, 2005 IP
  7. riziko

    riziko Peon

    Messages:
    189
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #27
    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
     
    riziko, Mar 26, 2005 IP
  8. bmw

    bmw Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #28
    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, May 24, 2005 IP
  9. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #29
    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, May 24, 2005 IP
  10. bmw

    bmw Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #30
    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
     
    bmw, May 25, 2005 IP
  11. youngoz

    youngoz Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #31
    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:)
     
    youngoz, Jun 22, 2005 IP
  12. fauzia

    fauzia Guest

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #32
    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 ??.
     
    fauzia, Jul 5, 2005 IP
  13. boyice

    boyice Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #33
    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?
     
    boyice, Jun 10, 2006 IP
  14. sanjit

    sanjit Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #34
    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
     
    sanjit, Feb 2, 2007 IP