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

RE: Success HttpApi on V4R3



Sender: Scott Klement <klemscot@xxxxxxxxxxxx>


Incidentally, for the sake of testing I'll leave this CGI-script available
for tonight:

       http://www.scottklement.com/cgi-bin/test-cgi

It will show you what you're sending to the server...   So you can test
with your web browser, and with your HTTPAPI program, and see the
difference.

For testing with a web browser, I used this HTML file to submit it,
based on what you sent earlier:

<head><title>Test Me</title></head>
<body>
<form action="http://www.scottklement.com/cgi-bin/test-cgi"; method="post">
                        Paste Full Route XML here:
                        <br>
                        <textarea name="varPayload" cols="100" rows="50">
                        </textarea>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>


Then, I cut & paste some XML into that web page, and submit it, and it
shows me how the form is urlencoded...   If you can get HTTPAPI to echo
back the same data, you're set... :)



On Wed, 30 Oct 2002, Scott Klement wrote:
>
> Art,
>
> If you want to put the contents of your XML file into an HTML form
> variable called 'varPayload', there's more to it than simply putting
> 'varPayload=' in front of the data.
>
> You need to 'encode' that data so that it would be a valid URL.  What
> they refer to as 'www-form-urlencoded' data.   Doing it that way would
> make it look like it was something you typed into a form on a web page
> and sent.  (Which isn't the same as sending it directly to a web server,
> unfortunately... sigh)
>
> In order to make your data be URL encoded, your XML data will need:
>
>    1) The following characters are used as delimiters or special
>          characters in a URL, and so must be escaped:
>                    ; / ? : @ & = + $ , % < > # "
>
>        To escape these characters, you send a % HEX HEX sequence.
>        For example, %26 would be the escape sequence for a & character
>        because 26 is the ASCII hex value for &, and % denotes that
>        you are inserting an escape sequence.
>
>    2) Spaces must also be escaped, but you can do that simply by
>       translating all spaces to the + symbol.
>
>    3) Although it's not strictly required, I'd strongly recommend also
>       escaping CR and LF with %0A and %0D respectively.
>
> Once you've escaped that data, you can add the varPayload= to the
> front of it.  You don't escape that...  in fact, the reason you escape
> the '=' symbol is so that you can differentiate between variables and
> their values, yet still allow '=' to be part of the value.
>
> Most web forms also have a submit-button at the bottom.  So if that's
> also required, you'd have to add a string like  '&Submit=value' to the
> end of your data.
>
> The '&' symbol signifies a new variable (thats why it's escaped as well)
> the name & value correspond to the HTML form.  If it says
> <input type="submit" name="LetsGo" value="Chunky Monkey"> then you'd
> add the string &LetsGo=Chunky+Monkey to the end of your data to indicate
> the submit button :)
>
> Keep in mind that this isn't, strictly speaking, part of the POST
> operation.  It's just the way web forms are submitted to HTTP servers,
> not the way 'any' data is submitted to HTTP servers...
>
> Have fun :)
>
>
> On Wed, 30 Oct 2002, Art Tostaine, Jr. wrote:
> >
> > Scott:
> >
> > Thanks for the ideas.  I will probably try to hijack the API's.
> >
> > The Post is supposed to call a "program" called Populate on their system, and I am supposed to invoke method "varPayload"
> >
> > They want me to send this URL:
> >
> > http://xxx.xxx.xxx.xxx/Integration/Integration.asmx/Populate
> >
> > and I have this in my STMF:
> >
> > "varPayload=<?xml version="1.0" encoding="utf-8" ?>
> > <RouteRequest xmlns="http://206.188.52.206/Integration/RoutePopulateRequest.xsd";>
> >  <Partner>
> >   <CustomerID>Gilbert</CustomerID>
> >   <CustomerUID>Art</CustomerUID>
> >   <CustomerPWD>Art</CustomerPWD>
> >   <Version>1.0</Version>
> >   <Type>GIS</Type>
> >   <Source>Gilbert</Source>
> >
> > etc, etc, etc.
>

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------