I am trying to use the exec command to execute curl to post xml to ups and I get the following error :
Error Code = 10002
Error Description = The XML document is well formed but the document is not valid
Error Location = AccessLicenseNumber
I don't think that the AccessLicenseNumber is really the problem since I just copied it directly from the e-mail.
The xml that I have is as follows :
<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
<AccessLicenseNumber>*******</AccessLicenseNumber>
<UserId></UserId>
<Password>****</Password>
</AccessRequest>
<?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>
the code that I use to send it is very simple. It is as follows :
$xmlstring = implode('', file("test.xml"));
exec("curl -d \"$xmlstring\" https://www.ups.com/ups.app/xml/Rate", $arrResponse);
$responsestring = implode('', $arrResponse);
Could someone tell me what I am doing wrong? Thanks.