SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Receive XML Response from UPS

    hey all, i am trying to implement a ups shipping calculator in my website and i have been busting my head against the wall for the past 3 hours...

    i have put together the xml request, sent it, and received a response, but the response is huge and all i need is 5 measly characters.

    the xml response i receive is:
    Code:
    <?xml version="1.0"?>
    
    <RatingServiceSelectionResponse>
    	<Response>
    		<ResponseStatusCode>1</ResponseStatusCode>
    		<ResponseStatusDescription>Success</ResponseStatusDescription>
    	</Response>
    
    	<RatedShipment>
    		<Service>
    			<Code>01</Code>
    		</Service>
    		<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
    		<RatedShipmentWarning>Ship To Address Classification is changed from Commercial to Residential</RatedShipmentWarning>
    		<BillingWeight>
    			<UnitOfMeasurement>
    				<Code>LBS</Code>
    			</UnitOfMeasurement>
    			<Weight>1.0</Weight>
    		</BillingWeight>
    
    		<TransportationCharges>
    			<CurrencyCode></CurrencyCode>
    			<MonetaryValue>23.00</MonetaryValue>
    		</TransportationCharges>
    
    		<ServiceOptionsCharges><CurrencyCode></CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges>
    		<TotalCharges><CurrencyCode></CurrencyCode><MonetaryValue>23.00</MonetaryValue></TotalCharges>
    
    		<GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
    		<ScheduledDeliveryTime>10:30 A.M.</ScheduledDeliveryTime>
    		<RatedPackage>
    			<TransportationCharges><CurrencyCode></CurrencyCode><MonetaryValue>23.00</MonetaryValue></TransportationCharges>
    			<ServiceOptionsCharges><CurrencyCode></CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges>
    			<TotalCharges><CurrencyCode></CurrencyCode><MonetaryValue>23.00</MonetaryValue></TotalCharges>
    			<Weight>0.5</Weight>
    			<BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>1.0</Weight></BillingWeight>
    		</RatedPackage>
    	</RatedShipment>
    </RatingServiceSelectionResponse>
    and all i need is the MonetaryValue node withing the TotalCharges node.

    any help would be great!

  2. #2
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no response?

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,181
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    How are you getting the response, SOAP?

    Does the API allow for different requests or must you get the "huge response"?

    I guessing you mean the "shipment" and not the individual "package"s?

    Code XML:
    <RatingServiceSelectionResponse>
    	<RatedShipment>
    		<TotalCharges>
    			<MonetaryValue>23.00</MonetaryValue>
    		<RatedPackage>
    			<TotalCharges>
    				<MonetaryValue>23.00</MonetaryValue>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •