[FX.php List] Re: UPS XML tools

Chris Hansen chris at iViking.org
Fri Mar 23 16:41:38 MDT 2007


On a somewhat related note, folks that are interested in this sort of  
thing (which is likely if you're on this list =) might check out  
SmartPill.  Granted, it's got its weak spots like any other FileMaker  
plug-in -- for one, PHP is a bit nicer to use outside of FileMaker  
(and free).  That said, consider this:

* you could use cURL to make your post request

* you can use PHP's XML and string functions to parse the return

* there's likely already PHP code out there (like that Alex mentions  
below...) to do just this

* all of the above and lots of other great stuff is possible with a  
single plug-in

If you haven't had a look, head over to www.scodigo.com.  (And in all  
honesty, yes, I am affiliated with the company, but no, I wasn't  
involved in the programming of the software.)  Best,

--Chris Hansen
   FileMaker 8 Certified Developer
   FileMaker 7 Certified Developer
   Creator of FX.php
   "The best way from FileMaker to the Web."
   www.iViking.org


On Mar 23, 2007, at 9:00 AM, Alex Gates wrote:

> 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
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>



More information about the FX.php_List mailing list