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

Re: Help with HTTP API



As I can see I'm sending Content-Type: text/xml  and I think that I have to send
Content-Type: application/x-www-form-urlencoded , how can I change that?
 
Thanks.
 
Jeff


 
On 2/10/06, Jeffreehy Talavera <jeffreehy@xxxxxxxxx> wrote:
I forgot to include the httptest.html file, this is the contents of if:
 
System.InvalidOperationException: Request format is invalid: text/xml. at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

 
On 2/10/06, Jeffreehy Talavera <jeffreehy@xxxxxxxxx > wrote:
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
-----------------------------------------------------------------------