[FX.php List] Re: UPS XML tools

Alex Gates alex at gandrpublishing.com
Fri Mar 23 09:00:45 MDT 2007


Hi John-

I made a calculated field with the proper UPS XML format and
concatenated my variables.
Then I made a POST request with FileMaker using the Troi URL plugin.
(This works without the WebViewer.)
Finally I parsed my returned XML with the position() and middle()
functions.

It works for what I needed - but later I did manage to get the same
result with php and cURL on my Apache test server - I'm sure that will
come in handy down the road.

This method using the Troi URL plugin does exactly what I needed it to
do - and it saves me the hassle of messing around with cURL on IIS.

For the archives:
If anyone wants to use this method, be sure to construct the "pickup
date" properly - (YYYYMMDD) - 

Date:  Year ( Get ( CurrentDate ) ) & Month & Day

Month:  Case (Month ( Get ( CurrentDate ) ) < 10;"0"&Month ( Get (
CurrentDate ) ) ;Month ( Get ( CurrentDate ) ))
Day:   Case (Day ( Get ( CurrentDate ) ) < 10;"0"&Day ( Get (
CurrentDate ) ) ;Day ( Get ( CurrentDate ) ))

Alex 

 
-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of John Lannon
Sent: Friday, March 23, 2007 9:37 AM
To: fx.php_list at mail.iviking.org
Subject: [FX.php List] Re: UPS XML tools

Alex,

*** Not an advertisement ***
NRG software offers an integrated Filemaker solution (NRG Package
Toolkit for UPS) that interfaces with UPS XML Tools. Considering the
cost and time associated with rolling your own, this toolkit may be well
worth checking out ($300 for a single license, I believe). Last I
checked, it used a Java plug-in to communicate with UPS. 
*** End of Not an advertisement ***

That being said, doing it yourself can be useful and informative. If
only FMI would allow us POST requests... Alas, you're likely on the
right track with the php-based web service.  

Theoretically, basic rates and services should be pretty straight
forward. Send a GET request to your php script with the relevant data
(zip codes, weight, etc), parse the data, construct an XML string that
conforms to UPS standards and use php's cURL functionality to submit the
request. At that point, you should be able output UPS's XML response.
Parsing the XML can be done with any of php XML libraries. This is very
simple with PHP5+. 

A few questions:
1) Which version of php are you using? 
2) Are you using command line PHP?
3) Are you the Web Viewer to submit the request to your php script? 
4) Have you acquired the UPS XML Tools documentation and conformed to
their XML standards when submitting your POST request? 

There's a lot that can go wrong, but you can definitely make it work.

John




More information about the FX.php_List mailing list