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

Re: Post with a parameter



This would be my guess as well, except that I'd uset WEBFORM_setPtr() 
for an XML document.   (WEBFORM_setVar is simpler, but is limited to 256 
bytes for it's value...  setPtr has no such limit.)

Mike Krebs wrote:
> My guess is that you need to encode the XML as form data ... See EXAMPLE4 in 1.24beta6
> 
> My guess would be something like this...
> 
> 
> ...build xml request without RQXML= (setvar does this for you) ...
> 
> eval      Form = WEBFORM_open                    
> callp     WEBFORM_SetVar(Form: 'RQXML': RQXML )
> callp     WEBFORM_postData( Form : myPointer  
>                                  : dataSize )
> eval      rc = http_url_post(                      
>            'https://mercury.shplandmark.com/api/api.php'
>           : myPointer                              
>           : dataSize                               
>           : '/tmp/testpost.html'                   
>           : HTTP_TIMEOUT                           
>           : HTTP_USERAGENT                         
>           : 'application/x-www-form-urlencoded' )
> 
> callp     cmd('DSPF ''/tmp/testpost.html''': 200)  
> callp     WEBFORM_close(Form)
> 
> This will put the reply into /tmp/testpost.html which will be displayed on your screen. When you see that you are getting valid data returned, you can proceed to try processing the return data.
> 
>  
> 
>> -----Original Message-----
>> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-
>> bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Vicki Seaberg
>> Sent: Friday, December 11, 2009 10:37 AM
>> To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
>> Subject: Post with a parameter
>>
>> Hello All,
>>
>>
>>
>> I have blindly but successfully implemented several applications using
>> Scott's HTTPAPI programs.  They work beautifully.  Now I am trying to
>> communicate with a new vendor who is asking me to include "a parameter
>> RQXML=<your xml document> with the regular POST method to their HTTPS
>> URL".  I am lost in understanding what is meant by defining a variable
>> named "RQXML" to define the xml string.  My vendor says they will not
>> be
>> able to capture the XML string without the RQXML variable.  I have no
>> idea how to do this.  I have already tried a variety of things with no
>> success.  A code snippet of my latest attempt is as follows:
>>
>>
>>
>> ......previous code that loads the "postdata" field....
>>
>> postdata += '</Items>' + '</ShipRequest>';
>>
>> RQXML = 'RQXML=' + %trim(postdata);
>>
>>
>>
>> rc = http_url_post_xml ('https://mercury.shiplandmark.com/api/api.php'
>>
>>                                              : %addr(RQXML) + 2
>>
>>                                              : %len(RQXML)
>>
>>                                              : %paddr(StartOfElement)
>>
>>                                              : %paddr(EndOfElement)
>>
>>                                              : *NULL );
>>
>>
>>
>> This isn't what my vendor needs and isn't able to offer any guidance.
>> I
>> would really, really appreciate any insight with this.  Thank you so
>> much!!
>>
>> Vicki Seaberg
>>
>> Swanson Health Products
>>
>>
>>
>>
> 
> -----------------------------------------------------------------------
> 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
-----------------------------------------------------------------------