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

Rif: Re: Rif: Re: Problem with POST on a REST web service



   Thanks again, i follow the example4 , now i have problem  with the
   translation between EBCDIC and ASCII.
   I try to use the procedure HTTP_setCCSIDs(1252:0);   where 1252 is the
   ccsid for windows latino 1 and this is the result :
   HTTPAPI Ver 1.29 released 2015-02-23
   NTLM Ver 1.4.0 released 2014-12-22
   OS/400 Ver V7R1M0
   New iconv() objects set, PostRem=1252. PostLoc=0. ProtRem=819.
   ProtLoc=0
   http_url_post(): entered
   http_persist_open(): entered
   http_long_ParseURL(): entered
   DNS resolver retrans: 2
   DNS resolver retry  : 2
   DNS resolver options: x'00000136'
   DNS default domain: FRANZINI.IT
   DNS server found: 8.8.8.8
   DNS server found: 192.168.0.199
   DNS server found: 192.168.0.203
   Nagle's algorithm (TCP_NODELAY) disabled.
   http_persist_post(): entered
   http_persist_req(POST) entered.
   http_long_ParseURL(): entered
   http_long_ParseURL(): entered
   do_oper(POST): entered
   There are 0 cookies in the cache
   POST /personal/ws/offerte_in.php HTTP/1.1
   Host: develop.ferritalia.it
   User-Agent: http-api/1.29
   Content-Type: application/x-www-form-urlencoded
   Content-Length: 368
   senddoc(): entered
   XML=%3Craccolta%3E%3Cdoc_id%3E2015-OFF-0006544%3C%2Fdoc_id%3E%3Ctotale_
   righe%3E0002%3C%2Ftotale_righe%3E%3Cnote%3E%3C%2Fnote%3E%3Criga+num+rig
   a%3D%221%22%3E%3Ccod_art%3E96814%3C%2Fcod_art%3E%3Cqta%3E5%2C00%3C%2Fqt
   a%3E%3C%2Friga%3E%3Criga+num+riga%3D%222%22%3E%3Ccod_art%3E96815%3C%2Fc
   od_art%3E%3Cqta%3E5%2C00%3C%2Fqta%3E%3C%2Friga%3E++++++++++++++++++%3C%
   2Fraccolta%3E
   recvresp(): entered
   HTTP/1.1 200 OK
   Content-Type: text/xml
   Server: Microsoft-IIS/7.5
   X-Powered-By: PHP/5.4.15
   Date: Wed, 30 Sep 2015 13:47:55 GMT
   Content-Length: 98
   SetError() £13: HTTP/1.1 200 OK
   recvresp(): end with 200
   recvdoc parms: identity 98
   header_load_cookies() entered
   recvdoc(): entered
   SetError() £0:
   <?xml version="1.0"?>
   <return><message>Errore l'offerta non
   esiste.</message><xml></xml></return>
   http_close(): entered
   The translation result is  %3C instead < and %3E instead >.
   I try also to use the program indicated in RPGIV Socket tutorial
   Chapter3  QDCXLATE in this way callp     Translate(lun:xml:'QTCPASC')
   but the result it is worst than before.
   this is my code
    /free
     http_debug(*ON);
     HTTP_setCCSIDs(1252:0);
     url= 'http://develop.ferritalia.it/personal/ws/offerte_in.php';

     XML  =
       '<raccolta>'                                      +
       '<doc_id>2015-OFF-0006544</doc_id>'                          +
          '<totale_righe>0002</totale_righe>'                       +
      '<note></note>'                                                +
      '<riga num riga="1">'                                          +
      '<cod_art>96814</cod_art>'                                     +
      '<qta>5,00</qta>'                                              +
      '</riga>'                                                      +
      '<riga num riga="2">'                                          +
      '<cod_art>96815</cod_art>'                                     +
      '<qta>5,00</qta>'                                              +
      '</riga>                  '                                    +
      '</raccolta>';

                       eval      lun=%len(%trimr(xml));
                       eval      Form = WEBFORM_open;
                            WEBFORM_SetPtr(Form
                                               :'XML'
                                               :%addr(xml:*data)
                                               :lun);
                            WEBFORM_postData( Form : myPointer
                                                        : dataSize );

    /end-free
   c                   eval      rc = http_url_post(

   c                              url

   c                             : myPointer

   c                             : dataSize

   c                             : '/tmp/testpost.html'

   c                             : HTTP_TIMEOUT

   c                             : HTTP_USERAGENT

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



   I think that if i solve also this problem i will be near to the
   solution.
   Thanks again to all of you!!!!

   Scott Klement <sk@xxxxxxxxxxxxxxxx>
   Inviato da: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx

   29/09/2015 20:23
   Per favore, rispondere a HTTPAPI and FTPAPI Projects

           Per:        HTTPAPI and FTPAPI Projects
   <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>,
           Cc:
           Oggetto:        Re: Rif: Re: Problem with POST on a REST web
   service

   Take a look at the SoapUI screenshot you provided.   For those who
   missed it, you can see it here:
   [1]http://www.scottklement.com/archives/ftpapi/201509/msg00079.html
   Notice the "Post QueryString" checkbox is checked, and the data is NOT
   provided in the box beneath 'media type' like it would normally be, but
   instead is provided in a form variable named 'xml'.
   HTTP provides two ways of sending application data from the client to
   the server.
   1) Query-string.  This works on all HTTP types (GET, POST, PUT, DELETE,
   etc) but is limited in length.  A query string is sent as part of the
   URL.
   2) Request document.  This works only with HTTP POST and PUT, but has
   no
   length limitation.  Unlike query string, it is not part of the URL.
   After the URL and headers are sent, a document is sent. (Basically,
   it's
   a file upload.)  The file can be any size -- potentially even terabytes
   long.
   The way you have SoapUI configured, you are sending your XML as a query
   string.  Under the covers, SoapUI is doing this:
   POST /personal/ws/offerte_in.php?xml=your-xml-data-is-here HTTP/1.1
   Host: portale.ferritalia.it
   Content-Length: 0
   (no request document sent)
   The way you're using HTTPAPI, however, you're sending it like this:
   POST /personal/ws/offerte_in.php HTTP/1.1
   Host: portale.ferritalia.it
   Content-Length: 167
   167-bytes-of-xml-data-is-here
   If your web service is looking for data in the query string (everything
   after the ? in a URL is the 'query string') and you're sending it as
   the
   request document, then it won't see any data and will fail.  If the web
   service can accept data in the request document, it is a better way to
   send it -- it's more efficient and has far fewer limitations.  However,
   if the web service doesn't support it in the request document, then you
   need to change your HTTPAPI code to send it using the query string.
   To use query string in HTTPAPI, you would use the "webforms" routines
   to
   encode the XML data into a form variable named 'xml', and then add the
   encoded data onto the URL.
   On 9/29/2015 11:42 AM, federico.forsi@xxxxxxxxxxx wrote:
   >     Thanks to everyboy, sorry, Scott but i don't understand. I
   perform the
   >     request using SoapUI like query string.  It is possible to do the
   same
   >     with HTTPAPI and, if it is possible, wuold you be so kind to show
   me
   >     one example ?
   >     .
   >     Please sorry , but i am not expert with this kind of programs.
   >     Thank to all
   >     Federico
   >
   -----------------------------------------------------------------------
   This is the FTPAPI mailing list.  To unsubscribe, please go to:
   [2]http://www.scottklement.com/mailman/listinfo/ftpapi
   -----------------------------------------------------------------------
   I dati da lei conferiti sono trattati elettronicamente e manualmente
   dagli incaricati e comunicati a terzi per la gestione dell' attivita'
   economica e per l' invio di materiale pubblicitario; un eventuale
   rifiuto al trattamento non consente la sua corretta esecuzione. Ha
   diritto di accesso ai suoi dati ed altri diritti, come da art. 7 -
   D.Lgs.196/03.
   L' informativa privacy, ai sensi e per gli effetti di cui all'art. 13
   del D.lgs 196/03, e' consultabile all' indirizzo web
   [3]www.franzini.it/informativa.htm.
   The informations provided will be processed manually and electronically
   by the data manager and will be disclosed to third parties for the
   management of economic and sending promotional materials; any refusal
   to treatment does not allow its proper implementation. You have access
   to these datas and other rights in accordance with art. 7 -
   D.Lgs.196/03. The privacy policy, in accordance with and for purposes
   of Art. 13 of Legislative Decree 196/03, is available at website
   [4]www.franzini.it/informativa.htm.
   Le informazioni contenute nella presente comunicazione e i relativi
   allegati possono essere riservate e sono, comunque, destinate
   esclusivamente alle persone o alla Societ� sopraindicati. La
   diffusione, distribuzione e/o copiatura del documento trasmesso da
   parte di qualsiasi soggetto diverso dal destinatario è proibita, sia
   ai sensi dell�t. 616 c.p. , che ai sensi del D.Lgs. n. 196/2003. Se
   avete ricevuto questo messaggio per errore, vi preghiamo di
   distruggerlo e di informarci immediatamente per telefono allo
   0522.929411 o inviando un messaggio all�dirizzo e-mail
   [5]mbox@xxxxxxxxxxx . Inoltre, il messaggio da Voi ricevuto è di
   natura non personale e le risposte al presente, potranno essere
   conosciute nell�ganizzazione di appartenenza del mittente.
   The information in this e-mail (which includes any files transmitted
   with it) is confidential and may also be legally privileged. It is
   intended for the addressee only. Access to this e-mail by anyone else
   is unauthorised. It is not to be relied upon by any person other than
   the addressee, except with our prior written approval. If no such
   approval is given, we will not accept any liability (in negligence or
   otherwise) arising from any third party acting, or refraining from
   acting on such information. Unauthorised recipients are required to
   maintain confidentiality. If you have received this e-mail in error
   please notify us immediately, destroy any copies and delete it from
   your computer system. Any use, dissemination, forwarding, printing or
   copying of this e-mail is prohibited. Copyright in this e-mail and any
   document created by us will be and remain vested in us and will not be
   transferred to you. We assert the right to be identified as the author
   of and to object to any misuses of the contents of this e-mail or such
   documents.

References

   1. http://www.scottklement.com/archives/ftpapi/201509/msg00079.html
   2. http://www.scottklement.com/mailman/listinfo/ftpapi
   3. http://www.franzini.it/informativa.htm
   4. http://www.franzini.it/informativa.htm
   5. mailto:mbox@xxxxxxxxxxx
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------