[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which HTTPAPI method is best?



Hi Alvin,

If you're already familiar with SOAP requests with HTTPAPI, using a REST 
service like the one you described shouldn't be too tough.

1) You'll format your parameters (the QCFROM, QCTO, etc stuff) using the
    'WebForms' tools included with HTTPAPI.  There's an example of this
    in EXAMPLE14 of the old HTTPAPI (1.23).

2) Do a test run using http_url_get() and save the result to a stream
    file. This'll give you an idea what the returned XML looks like.

3) Ultimately, you'll probably use http_url_get_xml(). This will invoke
    the same XML parser that (I presume) you're already using for SOAP.
    You'll obviously have to adjust the tags that you hunt for when
    parsing the response... but that should be easy if you're already
    doing the same sort of thing for SOAP.

Good luck


On 4/9/2010 5:16 PM, Alvin Strasburger wrote:
>
>     We have been using HTTPAPI to send and receive XML and soap requests
>     for some time now.  We now need to connect to several freight carriers
>     with a URL string and receive an XML reply.  An example is:
>
>      http://www.estes-express.com/cgi-dta/qun100.mbr/output?QCFROM=23860&Q
>     CTO=98032&Q
>
>     CCL1=50.0&QCSWT1=1000&QCCL2=50.0&QCSWT2=100&QCCL3=50.0&QCSWT3=150&QC
>
>     CL4=77.5&QCSWT4=150&QCCL5=60.0&QCSWT5=100&QCCL6=&QCSWT6=&QCDWP=S&QC
>
>     DTRM=P&QCDAC1=HAZ&QCDAC2=&QCDAC3=&format=xml&user_name=##&password=$$&
>     Q
>
>     CACT=1234567
>
>
>     Which example program best describes how to do this and parse the
>     return without storing the reply in the IFS?
>
>
>     Alvin
>
>     Alvin Strasburger
>
>     Printgear Sportswear
>
>     Phone    803-744-2310
>
>     Toll Free 800-763-7763
>
>     [1]mailto:alvins@xxxxxxxxxxxxx
>
>     [2]www.printgear.com
>
> References
>
>     1. mailto:alvins@xxxxxxxxxxxxx
>     2. http://www.printgear.com/
>
>
>
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------