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

AW: Lost CRLF



Murphey,

You may also consider to change the WS_OPER source member. It is the template that is used by the generator to produce the web service stub for a given web service operation:

   // Authenticate pre-emptively, if configured
   if (%(var:portName+_Port_isAuthenticatePreemptively;75;'...')());
      %(var:portName+_Port_authenticatePreemptively;75;'...')();
   endif;

   HTTP_XmlStripCRLF(*OFF); // do not strip CRLFs
   
   dou (not HttpResponse_isAuthenticationError(http_rc));
      // Get document from server and handle http redirects
      // See also: WSDL2R88.HttpResponse_isRedirect()
      dou (not HttpResponse_isRedirect(http_rc));
         http_DebugLog_appendText(
         '** ' + %char(%timestamp()) + ': Sending request to server');

         http_rc =
            http_url_post_raw2(
               url
               : hInpStream
               : %paddr('WSDL2R85_MessageContext_InputStream_read')

This way HTTP_XmlStripCRLF() is automatically added to each new web service stub.

Thomas.


-----Ursprüngliche Nachricht-----
Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Scott Klement
Gesendet: Samstag, 9. April 2016 19:01
An: HTTPAPI and FTPAPI Projects
Betreff: Re: Lost CRLF

Murphey,

HTTPAPI removes CR and LF characters from XML documents by default. As Chris suggested, you can change that behavior by calling HTTP_XmlStripCRLF(*OFF).

I am not familiar with the code generated by WSDL2RPG.  You can look at where it calls http_url_post_xml(), and just place the above code before that.

Good luck!


On 4/8/2016 9:01 AM, murphey wrote:
>     Hello Chris,
>
>     I don't see this XmlStripCRLF is used in the generated source, nor in
>     de compiler list,
>     other then the prototype in the HTTPAPI_H copy member
>
>
>     I'm affraid that my kowledge is not good enough to understand the way
>     the modules are linked together.
>
>
>     Can you give me some help/hints ?
>
>
>
>     Hayden, Chris schreef op 08-04-2016 13:46:
>
>        From the HTTPAI source members
>        // Note:  http_XmlStripCRLF(*ON/*OFF) controls whether or not
>        //        the XML parser removes CR and LF characters from the
>        //        Xml data that's passed to your 'Incoming' procedure.
>        Examples:
>        http_XmlStripCRLF(*ON);
>        http_XmlStripCRLF(*OFF);
>        source member HTTPAPI_H
>        * http_XmlStripCRLF(): Enable stripping of CRLF characters
>        *
>        *     peEnable = (input) *ON to strip, *OFF to leave them in.
>        *                        (they are stripped by default)
>        *
>        * Note: To simplify your XML string manipulations, HTTPAPI
>        *       strips CRLF characters from the response.  If you would
>        *       prefer that they are left in the response, call this
>        *       routine with a parameter of *OFF.
>        [1][1]www.pilotpen.us
>        Chris Hayden - Sr. Systems Analyst
>        Office: (904) 645-9999 ext.1252
>        Mobile: 904-654-4089
>        Pilot Corporation of America
>        3855 Regent Blvd, Jacksonville, Florida 32224 United States
>        This email and any files transmitted with it are confidential and
>        intended solely for the use of the individual or entity to whom they
>        are addressed. If you have received this email in error please
>     notify
>        the system manager. This message contains confidential information
>     and
>        is intended only for the individual named. If you are not the named
>        addressee you should not disseminate, distribute or copy this
>     e-mail.
>        Please notify the sender immediately by e-mail if you have received
>        this e-mail by mistake and delete this e-mail from your system. If
>     you
>        are not the intended recipient you are notified that disclosing,
>        copying, distributing or taking any action in reliance on the
>     contents
>        of this information is strictly prohibited.
>        -----Original Message-----
>        From: [2]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>        [[2]mailto:[3]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
>     murphey
>        Sent: Friday, April 08, 2016 6:37 AM
>        To: HTTPAPI and FTPAPI Projects <[4]ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
>        Subject: Lost CRLF
>        Hi,
>        I currently started to use the WSDL2RPG tool, to consume
>     webservices.
>        As far as I can see is that tool using the LIBHTTP api's
>        The generated RPG is running great, but in one of my respons field
>     an
>        CRLF character is removed.
>        When I run the same WS:
>                 * via the web page the html response is "Address<br>City"
>                 * via SoapUI teg response is "Address_CRLF_City"
>                 * via the RPG program the two fields are not seperated
>        "AddressCity"
>        What do I have to change in the LIBHTTP tool, or what do I have to
>        include, to get the field seperation back?
>        Thanks,
>        Theo
>     References
>        1. [5]http://www.pilotpen.us/
>        2. mailto:[6]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>
>     -----------------------------------------------------------------------
>     This is the FTPAPI mailing list.  To unsubscribe, please go to:
>     [7]http://www.scottklement.com/mailman/listinfo/ftpapi
>     
> ----------------------------------------------------------------------
> -
>
> References
>
>     1. http://www.pilotpen.us/
>     2. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>     3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>     4. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
>     5. http://www.pilotpen.us/
>     6. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>     7. 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
> ----------------------------------------------------------------------
> -
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2016.0.7497 / Virus Database: 4545/11993 - Release Date: 
> 04/09/16

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender.

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