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

Re: Post vs Post_raw



I ran a packet sniffer on the parent company's GUI servlet (a newly created servlet, which displays the input parameters and then sends the data to the correct place., the URL is http://10.254.20.184/DataToDw/DataToDwServlet (same as in the http_url_post_raw function line)
 
Here is the line based text data that came from the packet sniffer software:
 
msg=iSeriesTest&host=10.254.20.213&channel=DEVEAI01&queue=INBOUND&manager=
 
(the last character in the string is the equal sign after the manager parameter).  The msg is the data that gets put into the parent company's database and the other 4 parameters tell the servlet where to put the data.
 
We changed the data string variable so that it is equivalent to this string: 
c                   eval      data='' +
c                              '&host=10.254.20.213' +
c                              '&channel=DEVAI01' +
c                              '&queue=INBOUND' + 
c                              '&manager='
c*
c                       Eval      rc = http_url_post_raw(                   
c                                    'HTTP://10.254.20.184/' +              
c                                    'DataToDw/DataToDwServlet':           
c                                   %addr(Data):%len(%trimr(data)):           
c                                   1:%paddr('INCOMING'))  
 
 and then reran with the same results:
DSPLY  recvdoc: saveproc: Not all data was written!      
 
Re-ran the program in debug and displayed the data variable that is used in the http_url_post_raw RPG line:
 
DATA =""
           ....5...10...15...20...25...30...35...40...45...50...55...60      
      1   'msg=iSeriesTest&host=10.254.20.213&channel=DEVAI01&queue=INB'
    61   'OUND&manager=                                                 '      
 
 It appears that the HTTP API is sending the same url-encoded string to the servlet that the GUI does, do you agree?  If so, do you have any other suggestions as to what we can try next? 
 
BTW, The parent company IT apps people are 100% sure that the new servlet's post function will work, if sent the correct parameters (even though the servlet's java developer is no longer with them and they don't have documentation to prove it works).  One of the client's Java developer is in the process of creating a program that will do a programatic post to the servlet.  If this runs then it will verify that the servlet post works when initiated by a program (instead of the GUI). That test program may not be ready for a day or two, and since he has not done this kind of thing before it might not ready for a while.
 
Again thanks for the support, it's much appreciated.

-------------- Original message --------------

> Sender: Scott Klement
>
>

> Scott wrote:

>
> My guess is that you're not encoding the data that you're sending to the
> servlet in the manner that it expects you to. This is causing the servlet
> to crash or get "hung up" so that it stops receiving data from you.
>
> Then, HTTPAPI complains that the server won't receive all of the data that
> you're trying to send.
>
>
>>>> What suggestions do you have to resolve this issue?
>

> Scott wrote: 

>There are many different ways to encode the parameters that you're trying
> to send to the server. Just because my server expects a string like
> parm1=value1&parm2=value2&parm3=value3 doesn't mean that your servlet
> does. It may be expecting a SOAP document, or some other XML document, or
> it may be expecting something else entirely.
>
> I'd run a packet sniffer (www.ethereal.com has a good, free one) to find
> out exactly what your test program sends to the server, then make sure
> that HTTPAPI sends the same thing.
>