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

Problem with http_url_post_xml



   Dear Scott.
   We appeal to you to solve a problem we have, and would be immensely
   grateful if you can help us.

   We are working on V5R4M0. We use your valuable API HTTPAPI for the
   consumption of web services. So far we have had no problem; we simply
   use http_url_post_xml with %paddr(Incoming) and everything is correct.

   We have now a new need leaving the result in the IFS. The return from
   the consumed webservice is a string value, which contains data
   formatted in XML, and its size is greater than 65,535 caracterres.
   http_url_post_xml leaves in the IFS all the information, but the
   character "<" is converted into "&lt" even though it is enclosed by a
   "<! [CDATA [...]]". This does not happen when consuming the same web
   service via SOAPUI.

   We looked for a solution on the internet and found the following link:
   [1]http://www.scottklement.com/httpapi/bankrout.txt, and based on the
   example we tried to solve our problem. Everything is perfect, but when
   looking at the result of the PARSE, it has only 65,535 characters.
   While looking for the solution we tried a procedure similar to the
   SaveEmbed example, called GetInnerDoc, but the result was the same. We
   did another test using your excample, called BANKROUT, using the
   procedure called GetInnerDoc and entering a new change:

   D Element_Val_t ds qualified
   D based(Template)
   D buf *
   D len 10i 0

   With the above DS we redefined variable "Value" of procedure
   GetInnerDoc, and then we found this problem in the procedure:

   D writeConst PR 10I 0 ExtProc('write')
   D fildes 10i 0 value
   D buf 65535A const options(*varsize)
   D bytes 10u 0

   Variable buf is 65,535. We tried to redefine it based on DS
   Element_Val_t, but when we perfom this:

   CALLP Write (fd:% addr (value.buf) value.lon), the system sends a
   message indicating that "The receiver is to small to hold the result".

   Continuing with our experiments we defined the following variable: S
   10i 0 D lenW, initialy set to 190,000. Then we performed this
   instruction: CALLP Write (fd:% addr (value.buf) lenW). When looking at
   the IFS file, we see the right size, but the data is truncated to
   65,535 characters.

   The question that remains is: what we are doing wrong? (meaning, why
   the function http_parse_xml_stmf() which uses procedure SaveEmbed, or
   function http_url_post_xml which uses procedure GetInnerDoc, don't
   generate data bigger that 655,35 characters?)

   We thank you a lot for your help, and for your HTTPAPI.

   Best regards,



   Jaime E. Villa Torres

   Gerente de Tecnología

   Its Solutions Ltda

   Calle 81 No 11 - 68 Of 614

   Tel (57 1) 6180767 - 6180807

References

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