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

http_url_post_raw encoding Issue

   Hi Scott,

   I am using http_url_post_raw. It works like a charm.

   The input to the server is in XML. During our testing we came across a
   scenario where the XML data had and "&" char for an element

   And we got the error response from the target Server as

   <ERROR DESCRIPTION>Unable to parse input XML entity reference names
   can  not start with character &apos; &apos; (position: START_TAG seen
   ...&lt;VALUE&gt;GENERAL &amp; ... @1:2497)</ERROR DESCRIPTION>

   I thought by using WEBFORM_setPtr & WEBFORM_postData the data gets
   converted to URL encoded data. But it did not convert my "&" char to
   &amp;. Is there any reason behind this or am I doing something wrong
   here. Below is my code for Ur reference:

               form = WEBFORM_open();
               WEBFORM_setPtr(form: 'instring': %addr(@XML_Input) :
                              %len(%trimR(@XML_Input)) );
               WEBFORM_postData(form: postData: postDataSize );
               // Post data and get document
               rc = http_url_post_raw(%trim(@ServerName)
                         : postData
                         : postDataSize
                         : 1
                         : %paddr('RECEIVEDATA')
                         : @HTTPPostTimeout
                         : *OMIT
                         : %trim(@URLEncodApp) );
               if rc <> 1;
                 DS_HTTP_StatusData.HTTPErrDesc = 'HTTP Post Failed. ' +
                 DS_HTTP_StatusData.ReturnCd    = HTTPPostFailed;
                 callp Translate(retlen: retdata: 'QTCPEBC');
                 DS_HTTP_StatusData.XML_Response = %trim(retdata);

   Please let me know.

   Thanks for your help.

This is the FTPAPI mailing list.  To unsubscribe, please go to: