Jump to content

jakester

Members
  • Posts

    3
  • Joined

  • Last visited

jakester's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I got all these XML templates from UPS to post relevant shipping data from our site to UPS's so they can calculate shpping costs then POST it back to us so we can show customers available services and add it to the sale price. I understand the templates well enough, but how do you use the HTTP POST to get the XML to UPS's site? I can't find one example of this anywhere. Then I found some javascript stuff on W3Schools, using the XMLHttpRequest & Microsoft.XMLHTTP objects, but those JS objects won't work in any of my browsers. Please give me a hint. I am pretty good with FORMS and PHP and HTML but new to XML this is the authorization xml you include in the post, the UPS server will separate the two xml <?xml version="1.0"?><AccessRequest xml:lang="en-US"> <AccessLicenseNumber>XXXXXXXXX</AccessLicenseNumber> <UserId>dougword</UserId> <Password>*******</Password></AccessRequest> Here is the template that UPS gives you so they can figure services available: <?xml version="1.0"?><RatingServiceSelectionRequest xml:lang="en-US"> <Request> <TransactionReference> <CustomerContext>Bare Bones Rate Request</CustomerContext> <XpciVersion>1.0</XpciVersion> </TransactionReference> <RequestAction>Rate</RequestAction> <RequestOption>Rate</RequestOption> </Request> <PickupType> <Code>01</Code> </PickupType> <Shipment> <Shipper> <Address> <PostalCode>44129</PostalCode> <CountryCode>US</CountryCode> </Address> </Shipper> <ShipTo> <Address> <PostalCode>44129</PostalCode> <CountryCode>US</CountryCode> </Address> </ShipTo> <ShipFrom> <Address> <PostalCode>32779</PostalCode> <CountryCode>US</CountryCode> </Address> </ShipFrom> <Service> <Code>01</Code> </Service> <Package> <PackagingType> <Code>02</Code> </PackagingType> <Dimensions> <UnitOfMeasurement> <Code>IN</Code> </UnitOfMeasurement> <Length>20</Length> <Width>20</Width> <Height>20</Height> </Dimensions> <PackageWeight> <UnitOfMeasurement> <Code>LBS</Code> </UnitOfMeasurement> <Weight>23</Weight> </PackageWeight> </Package> </Shipment></RatingServiceSelectionRequest>
  2. I got all these XML templates from UPS to post relevant shipping data from our site to UPS's so they can calculate shpping costs thenPOST it back to us so we can add it to the sale price. I understand the templates well enough, but how do you use the HTTP POST to get the XML to UPS's site? I can't find one example of this anywhere. Then I found some javascript stuff on W3Schools, using the XMLHttpRequest & Microsoft.XMLHTTP objects, but those JS objects won't work in any of my browsers. Please give me a hint. I am pretty good with FORMS and PHP and HTML but new to XML this is the authorization xml you include in the post, you inlcude both in the <?xml version="1.0"?><AccessRequest xml:lang="en-US"> <AccessLicenseNumber>XXXXXXXXX</AccessLicenseNumber> <UserId>dougword</UserId> <Password>*******</Password></AccessRequest> Here is the template that UPS gives you: <?xml version="1.0"?><RatingServiceSelectionRequest xml:lang="en-US"> <Request> <TransactionReference> <CustomerContext>Bare Bones Rate Request</CustomerContext> <XpciVersion>1.0</XpciVersion> </TransactionReference> <RequestAction>Rate</RequestAction> <RequestOption>Rate</RequestOption> </Request> <PickupType> <Code>01</Code> </PickupType> <Shipment> <Shipper> <Address> <PostalCode>44129</PostalCode> <CountryCode>US</CountryCode> </Address> </Shipper> <ShipTo> <Address> <PostalCode>44129</PostalCode> <CountryCode>US</CountryCode> </Address> </ShipTo> <ShipFrom> <Address> <PostalCode>32779</PostalCode> <CountryCode>US</CountryCode> </Address> </ShipFrom> <Service> <Code>01</Code> </Service> <Package> <PackagingType> <Code>02</Code> </PackagingType> <Dimensions> <UnitOfMeasurement> <Code>IN</Code> </UnitOfMeasurement> <Length>20</Length> <Width>20</Width> <Height>20</Height> </Dimensions> <PackageWeight> <UnitOfMeasurement> <Code>LBS</Code> </UnitOfMeasurement> <Weight>23</Weight> </PackageWeight> </Package> </Shipment></RatingServiceSelectionRequest>
×
×
  • Create New...