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

Post XML data & expecting XML file in return



   Gentlemen,


   I am trying to send a block of XML-formatted data (1500 bytes on
   average) that includes all the user, password, client ID, etc., and
   request data that was created in a previous program. The response will
   be an XML file that will be parsed for information and passed back to
   the calling program  Forms were not used in this program, unlike the
   currently running HTTPAPI RPGLE code.  I am getting ' MSG = 'HTTP/1.1
   500 Internal Server Error', but am not getting this error with another
   application using http_url_post.


   XMLDATA is the input field passed into the program and String is a
   variable length field to be sent to the remote URL.  Below is a screen
   shot of the beginning of the XML data:

   cid:image002.jpg@01CD76E4.826FD2C0


   Below is the RPGLE code that I am trying to run:

   // Setup input string from XMLDATA --------

    String = %trimr(XMLDATA);

    Eval StrLen = %Len(String);


    //  The http_url_post() function does an HTTP POST operation

    //  sending any data at the pointer (%addr) of String.


    //  The results, in this case, are saved to the IFS in Filename

    //  like '/Temp/M0023546.xml' which is M + Policy.


    x = %scan ('<requestID>': String);

    Policy = %Subst(String : (x + 11) : 7);

    Filename = '/Temp/M' + Policy + '.xml';


    rc = http_url_post('https://qpconfirma.qualityplanning.com/+

                        Service/QPConfirm.asmx/ProcessRequestv2'

                        : %addr(String) + 2

                        : StrLen

                        : Filename

                        : HTTP_TIMEOUT

                        : HTTP_USERAGENT

                        : 'application/x-www-form-urlencoded');


        if rc <> 1;

           msg = http_error;

           dsply msg;

        else;

           exsr Parse_XML;

        endif;


   The message I get is:

   MSG = 'HTTP/1.1 500 Internal Server Error


   Any suggestions?


   Thanks, Worth Holmes

   (817) 938-3889



   Worth Holmes
   IT Application Dev Lead
   Kemper Services Group
   8360 LBJ Freeway, Suite 400, Dallas, TX 75243
   972.690.5500 x1656 / 817.938.3889 Cell
   903.561.1838 Fax
   wholmes1@xxxxxxxxxx
   [1]kemper.com



   CONFIDENTIALITY NOTICE: This communication may contain confidential
   information intended only for the addressee(s). If you received this
   communication in error, please notify the sender and delete it from
   your system.

References

   1. http://kemper.com/

JPEG image

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