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

RE: Help with HTTP API



You shouldn’t need to have the code in there for “data”.  This is the HTTP header that you can encode using http_url_post.

 

Keep the “eval data1” in your code but try this http_url_post:

rc = http_url_POST('http://200.30.178.70/'          

                 + 'service.asmx/BuscarCliente' 

                 + 'PorNumeroCliente'                       

                 : %addr(data1)                         

                 : %len(%trimr(data1))                  

                 : '/tmp/httptest.html'                  

                 : HTTP_TIMEOUT                        

                 : HTTP_USERAGENT                      

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

 

You don’t have to pass in “data” from your code.

 


From: owner-ftpapi@xxxxxxxxxxxxx [mailto:owner-ftpapi@xxxxxxxxxxxxx] On Behalf Of Jeffreehy Talavera
Sent: Friday, February 10, 2006 12:39 PM
To: FTP API Forum
Subject: Help with HTTP API

 

Hi,

 

I'm trying to acces a Web Service from the iSeries using the HTTPAPI, what I need is to send the following request to the server:

 

POST /service.asmx/BuscarClientePorNumeroCliente HTTP/1.1
Host: 200.30.178.70
Content-Type: application/x-www-form-urlencoded
Content-Length: 51

sUsuario=bancon&cClave=banconNumeroDeCliente=2356

I modified the EXAMPLE4 UPS Tracking to do this, but I'm getin the error :HTTP/1.1 400 Bad Request ( The data is invalid.  )

this is the contents of the httpappi_debug file on the Iseries.


%
%ˆ££—m¤™"m—–¢£M]z@…•£…™…„
%ˆ££—m—…™¢‰¢£m–—…•M]z@…•£…™…„
%ˆ££—m"–•‡mׁ™¢…äÙÓM]z@…•£…™…„
%ˆ££—m—…™¢‰¢£m—–¢£M]z@…•£…™…„
%ˆ££—m"–•‡mׁ™¢…äÙÓM]z@…•£…™…„
%„–m—–¢£M]z@…•£…™…„
%×Öâã@a¢…™¥‰ƒ…K¢"§a¤¢ƒ™Ã"‰…•£…×–™Õ¤"…™–Ã"‰…•£…@Èãã×añKñ
%È–¢£z@òððKóðKñ÷øK÷ð
%䢅™`Á‡…•£z@ˆ££—`—‰añKñô
%Ö•£…•£`㨗…z@£…§£a§""
%ŧ—…ƒ£z@ñðð`ƒ–•£‰ •¤…
%Ö•£…•£`Ó…•‡£ˆz@õñ
%
%
™…ƒ¥™…¢—M]z@…•£…™…„
%Ⅳř™–™M]@iôóz@Ö""ãÃ×m™…„z@Õ–@ñðð`Ö•£‰•¤…@M…™™–™@‰‡•–™…„]
%¢…•„„–ƒM]z@…•£…™…„
%×Öâã@a¢…™¥‰ƒ…K¢"§a¤¢ƒ™Ã"‰…•£…×–™Õ¤"…™–Ã"‰…•£…@Èã

™…ƒ¥™…¢—M]z@…•£…™…„
%HTTP/1.1 400 Bad Request ( The data is invalid.  )
Via: 1.1 SISTEMATICASPS
Connection: close
Proxy-Connection: close
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 1946 


Ⅳř™–™M]@iñóz@HTTP/1.1 400 Bad Request ( The data is invalid.  )
%ˆ££—mƒ"–¢…M]z@…•£…™…„
%

 

attached is the code that I'm using from the EXAMPLE4,

Thank & Regards,

 

Jeffr Talavera