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

Re: Help with HTTP API



Yes, I have no garbage in the  httpapi_debug file, but I go DSPJOBLOG and I got
   DSPLY  HTTP/1.1 500 Internal Server Error
 ? *N                                       
   DSPLY  HTTP/1.1 500 Internal Server Error
 ? *N                                       
 
attached is the httpapi_debug file.


 
On 2/10/06, Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:
Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


I wonder if it's an iconv() problem?  As a test, can you try the
following?

a) Open up the CONFIG_H source member in LIBHTTP/QRPGLESRC

b) Look for the following code:

  /undefine HTTP_USE_TABLES
  /if defined(HTTP_USE_TABLES)
D HTTP_TOEBC      C                   CONST('QTCPEBC')
D HTTP_TOASC      C                   CONST('QTCPASC')
  /else
D HTTP_EBCDIC     C                   CONST(0)
D HTTP_ASCII      C                   CONST(367)
  /endif

c) Change "/undefine" to "/define" so that the first line of the above
code now reads as follows:

  /define HTTP_USE_TABLES

d) Save your changes to the CONFIG_H source member.

e) Type the following commands to recompile HTTPAPI:

     CHGCURLIB CURLIB(LIBHTTP)
     CALL INSTALL

f) Now try calling your program again.  Does this eliminate all of the
"garbage" characters that were in your httpapi_debug.txt file?

---
Scott Klement   http://www.scottklement.com

On Fri, 10 Feb 2006, Jeffreehy Talavera wrote:

> Thanks Scott,
>
> That was very helpfull, but I still getin the same error from the server
> attached the httpapi_debug file.
>
> Jeff.
>
>
> On 2/10/06, Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:
>>
>> Sender: Scott Klement < sk@xxxxxxxxxxxxxxxx>
>>
>>
>>> the Development iSeries that I'm working on in, is on V4R4M0 , I got an
>>> error with  the /free ...... /end-free stuff.
>>> Do I have to use diferent code no?
>>
>> I don't have access to a computer that's as far out of date as V4R4, so I
>> don't know exactly what needs to be changed.  I think all you'll need to
>> do is convert it to fixed format.
>>
>> Here's a fixed format version of the same program:
>>
>>      H dftactgrp(*no) bnddir('LIBHTTP/HTTPAPI')
>>
>>       /copy libhttp/qrpglesrc,httpapi_h
>>
>>      D cmd             pr                  extpgm('QCMDEXC')
>>      D  command                     200A   const
>>      D  length                       15P 5 const
>>
>>      D rc              s             10I 0
>>      D msg             s             52A
>>      D Enc             s                   like(HTTP_URL_ENCODER)
>>      D data            s               *
>>      D size            s             10I 0
>>
>>      C                   eval      *inlr = *On
>>
>>      C                   eval      Enc = http_url_encoder_new
>>      c                   callp     http_url_encoder_addvar_s(
>>      c                                Enc  : 'sUsuario': 'bancon')
>>      c                   callp     http_url_encoder_addvar_s(
>>      c                                Enc  : 'cClave': 'bancon')
>>      c                   callp     http_url_encoder_addvar_s(
>>      c                                Enc  : 'iNumeroDeCliente': '2356')
>>
>>      c                   callp     http_url_encoder_getptr(
>>      c                                Enc  : data : size )
>>
>>      c                   eval      rc = http_url_post(
>>      c                                 ' http://200.30.178.70'
>>      c                               + '/service.asmx'
>>      c                               + '/BuscarClientePorNumeroCliente'
>>      c                               : data
>>      c                               : size
>>      c                               : '/tmp/httptest.html' )
>>
>>      c                   callp     http_url_encoder_free(enc)
>>
>>      c                   if        rc <> 1
>>      c                   eval      msg = http_error
>>      c                   dsply                   msg
>>      c                   return
>>      c                   endif
>>
>>      c                   callp     cmd('DSPF ''/tmp/httptest.html''': 200)
>>      c                   return
>>
>>
>> Please compare the original program with this one so you can see how easy
>> it was to convert from free format to fixed format.  Almost all of the
>> examples you'll see posted in the future will be in free format, so
>> understanding how to convert between them will be a good thing to know.
>>
>>
>> -----------------------------------------------------------------------
>> This is the FTPAPI mailing list.  To unsubsribe from the list send mail
>> to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
>> -----------------------------------------------------------------------
>>
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------

HTTPAPI Ver 1.13.1 released 2006-01-03

New tables set, ASCII=QTCPASC. EBCDIC=QTCPEBC
http_url_post(): entered
http_persist_open(): entered
http_long_ParseURL(): entered
http_persist_post(): entered
http_long_ParseURL(): entered
do_post(): entered
POST /service.asmx/BuscarClientePorNumeroCliente HTTP/1.1
Host: 200.30.178.70
User-Agent: http-api/1.14
Content-Type: text/xml
Expect: 100-continue
Content-Length: 51


recvresp(): entered
HTTP/1.1 100 Continue
Via: 1.1 SISTEMATICASPS


SetError() ¬13: HTTP/1.1 100 Continue
senddoc(): entered
sUsuario=bancon&cClave=bancon&iNumeroDeCliente=2356

recvresp(): entered
HTTP/1.1 500 Internal Server Error
Via: 1.1 SISTEMATICASPS
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 221
Date: Sat, 11 Feb 2006 01:06:14 GMT
Content-Type: text/plain; charset=utf-8
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
MicrosoftOfficeWebServer: 5.0_Pub
X-AspNet-Version: 2.0.50727
Cache-Control: private


SetError() ¬13: HTTP/1.1 500 Internal Server Error
recvdoc parms: identity 221
recvdoc(): entered
SetError() ¬0:
System.InvalidOperationException: Request format is invalid: text/xml.
   at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
   at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

SetError() ¬13: HTTP/1.1 500 Internal Server Error
http_close(): entered