Howdy all,
Onto FedEx rates now. Which I've gotten to link up and pull info - but I'm trying to select out the rate. Here is what I have for XML. (showing only two services).
Now what I'm doing first is looping through, looking for the Service node name - matching it based on select case - then looking for the associated NetCharge - and adding a handling charge (strChosen).
it is erroring when it matches - in the first case the FEDEX2DAY string. and errors on the line looking for the price.
Gives me an error of.
now, am I calling for the right node combination ? I get the error if I call for the handling surcharge (strChosen) or not.
Thank you.
Stuart
Onto FedEx rates now. Which I've gotten to link up and pull info - but I'm trying to select out the rate. Here is what I have for XML. (showing only two services).
Code:
<Entry>
<Service>PRIORITYOVERNIGHT</Service>
<Packaging>YOURPACKAGING</Packaging>
<DeliveryDate>2006-09-01</DeliveryDate>
<DeliveryDay>FRI</DeliveryDay>
<DestinationStationID>MHT</DestinationStationID>
?
<EstimatedCharges>
<DimWeightUsed>false</DimWeightUsed>
<RateScale>01618</RateScale>
<RateZone>8</RateZone>
<CurrencyCode>USD</CurrencyCode>
<BilledWeight>1.0</BilledWeight>
<DimWeight>0.0</DimWeight>
?
<DiscountedCharges>
<BaseCharge>33.30</BaseCharge>
<TotalDiscount>0.00</TotalDiscount>
<TotalSurcharge>5.33</TotalSurcharge>
<NetCharge>38.63</NetCharge>
<TotalRebate>0.00</TotalRebate>
</DiscountedCharges>
</EstimatedCharges>
<SignatureOption>NONE</SignatureOption>
</Entry>
?
<Entry>
<Service>FEDEX2DAY</Service>
<Packaging>YOURPACKAGING</Packaging>
<DeliveryDate>2006-09-05</DeliveryDate>
<DeliveryDay>TUE</DeliveryDay>
<DestinationStationID>MHT</DestinationStationID>
?
<EstimatedCharges>
<DimWeightUsed>false</DimWeightUsed>
<RateScale>06112</RateScale>
<RateZone>8</RateZone>
<CurrencyCode>USD</CurrencyCode>
<BilledWeight>1.0</BilledWeight>
<DimWeight>0.0</DimWeight>
?
<DiscountedCharges>
<BaseCharge>12.55</BaseCharge>
<TotalDiscount>0.00</TotalDiscount>
<TotalSurcharge>2.01</TotalSurcharge>
<NetCharge>14.56</NetCharge>
<TotalRebate>0.00</TotalRebate>
</DiscountedCharges>
</EstimatedCharges>
<SignatureOption>NONE</SignatureOption>
</Entry>
Now what I'm doing first is looping through, looking for the Service node name - matching it based on select case - then looking for the associated NetCharge - and adding a handling charge (strChosen).
Code:
Set mydoc=Server.CreateObject("Microsoft.xmlDOM")
mydoc.loadxml(strXMLResponse)
IF mydoc.documentElement.nodeName = "Error" then 'top level error
session("svFEDEXSelect")="##"
ELSE
Set NodeList = mydoc.documentElement.selectNodes("Entry")
For strCount = 0 To NodeList.length - 1
Select case NodeList.Item(strCount).selectSingleNode("Service").Text
case "FEDEXEXPRESSSAVER"
Session("svFEDEX1")="FedEx Express Saver (3 day)"
Session("svFEDEXCost1")=(cdbl(NodeList.Item(strCount).selectSingleNode("EstimatedCharges/NetCharge").Text)+cdbl(strChosen))
Session("svFEDEXOrder1")=1
strCount2=strCount2+1
CASE "FEDEX2DAY"
Session("svFEDEX2")="FedEx 2 Day"
Session("svFEDEXCost2")=(cdbl(NodeList.Item(strCount).selectSingleNode("EstimatedCharges/NetCharge").Text)+cdbl(strChosen))
Session("svFEDEXOrder2")=1
strCount2=strCount2+1
CASE "STANDARDOVERNIGHT"
Session("svFEDEX3")="FedEx Standard Overnight"
Session("svFEDEXCost3")=(cdbl(NodeList.Item(strCount).selectSingleNode("Service/EstimatedCharges/NetCharge").Text)+cdbl(strChosen))
Session("svFEDEXOrder3")=1
strCount2=strCount2+1
END SELECT
NEXT
END IF
it is erroring when it matches - in the first case the FEDEX2DAY string. and errors on the line looking for the price.
Gives me an error of.
Code:
Object required: '[object]'
now, am I calling for the right node combination ? I get the error if I call for the handling surcharge (strChosen) or not.
Thank you.
Stuart