View Single Post
Old 09-24-2003, 01:28 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
sending an xml request

i'm trying to develop a php script which communicates with UPS via xml.

in the UPS documentation, they give examples of a 'request' and a 'response'

i know how to parse and read a response, but i'm wondering how i go about sending the request.

do i use curl? and if so, what paramter would i send the xml in? do i use a socket?

here is a copy of how they show the xml request should look:
PHP Code:
<?xml version="1.0"?>

<RatingServiceSelectionRequest xml:lang="en-US">
  <Request>
    <TransactionReference>
      <CustomerContext>Rating and Service</CustomerContext>
      <XpciVersion>1.0001</XpciVersion>
    </TransactionReference>
    <RequestAction>Rate</RequestAction>
    <RequestOption>shop</RequestOption>
  </Request>
  <PickupType>
  <Code>01</Code>
  </PickupType>
  <Shipment>
    <Shipper>
      <Address>
    <PostalCode>30076</PostalCode>
      </Address>
    </Shipper>
    <ShipTo>
      <Address>
    <PostalCode>30041</PostalCode>
      </Address>
    </ShipTo>
    <Service>
    <Code>11</Code>
    </Service>
    <Package>
      <PackagingType>
        <Code>02</Code>
        <Description>Package</Description>
      </PackagingType>
      <Description>Rate Shopping</Description>
      <PackageWeight>
        <Weight>33</Weight>
      </PackageWeight>
     </Package>
    <ShipmentServiceOptions/>
  </Shipment>
</RatingServiceSelectionRequest>
__________________
Mike
sde is offline   Reply With Quote