Anyone have any experience with PHP / XML and UPS Tracking?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
superwormy
Forum Commoner
Posts: 67
Joined: Fri Oct 04, 2002 9:25 am
Location: CT

Anyone have any experience with PHP / XML and UPS Tracking?

Post by superwormy »

I need some help with it... it won't work. I'm using cURL through shellexec() and I consistently get a 10002 Hard Error returned from the UPS Server. Below is my code...

<?php

$data = "<?xml version=”1.0”?>
<AccessRequest xml:lang=”en-US”>
<AccessLicenseNumber>BB85CFF5389A4B38</AccessLicenseNumber>
<UserId>Superwormy</UserId>
<Password>worm11</Password>
</AccessRequest>
<?xml version=”1.0”?>
<TrackRequest xml:lang=”en-US”>
<Request>
<TransactionReference>
<CustomerContext></CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<RequestAction>Track</RequestAction>
<RequestOption>activity</RequestOption>
</Request>
<ShipmentIdentificationNumber>1Z77X41X0243916602</ShipmentIdentificationNumber>
</TrackRequest>";

$data = urlencode ($data);
$data = str_replace (" ", "", $data);
$date = str_replace ("\n", "", $data);

$command = "curl -d \"" . $data . "\" https://wwwcie.ups.com/ups.app/xml/Track";

$output = shell_exec ($command);

print ($output);

?>


You can see the error message it returns here:

http://superwormy.phpwebhosting.com...e_shellexec.php
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

Image Image
Post Reply