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:

<?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!

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?

<RatingServiceSelectionResponse>
	<RatedShipment>
		<TotalCharges>
			<MonetaryValue>23.00</MonetaryValue>
		<RatedPackage>
			<TotalCharges>
				<MonetaryValue>23.00</MonetaryValue>

no response?