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

RE: HTTPAPI - EXAMPLE1 - Send returns error #55



I was able to get this to work perfectly from an internal website so my next step is to put in a request to allow me to punch out to an external site.  I will follow up once I have results.
Thanks again for the help.
My confusion was that the initial send worked and when the second send failed I didn't realize that the connection was being shut down internally.

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mike Krebs
Sent: Friday, August 24, 2012 3:52 PM
To: HTTPAPI and FTPAPI Projects
Subject: RE: HTTPAPI - EXAMPLE1 - Send returns error #55

I used the same pdf you did and it downloaded flawlessly.

You are still on V5R4. Are you current on all PTFs?

Scott replied to a similar issue in 2005 but the OP never followed up on what the solution was. Scott indicated lots of problems could cause blockwrite errors including bad physical equipment to malfunctioning servers. 

My second guess is some firewall issue. Can you ping out from the IBMi? And yes, we know that doesn't prove much but it proves something. If it works, at least part of the mystery is revealed. Try pinging both by name and by IP.

Do any of the other examples work (some don't work for anyone but many do)?

Do you have an internal website you can download something from? Does that work?

Try it and let us know results. 

As far as how we handled the firewall, I just had our network admin make a hole for the IBMi to go out on 80 and 443 (and some other stuff so other things work - like ping and ftp for example). Avoided the whole getting through the firewall issue directly.


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Anderson, Alan (Non-Employee)
Sent: Friday, August 24, 2012 1:27 PM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: HTTPAPI - EXAMPLE1 - Send returns error #55

Hello,
I am just beginning to test HTTPAPI on our system.  I'm hoping to use it in some development.  So THANK YOU for this utility (also for the JDBC which is working great!).
However, I am not getting off to a great start as I am getting an error with the EXAMPLE1 program.  I modified it to pick up a PDF from IBM just to get another sample but the results are the same as when I try to download from scottklement.com.  I put the HTTPAPIR4 service program in debug to track it down and it is  where the do_oper procedure calls SendReq.  It is on the second call with CRLF in the buffer :

                         eval      wwReqChain = CRLF
     c                   eval      rc = SendReq( peComm
     c                                         : %addr(wwReqChain)+VARPREF
     c                                         : %len(wwReqChain)
     c                                         : peTimeout )
     c                   if        rc < 1
     c                   return    rc
     c                   end

It is returning a -1.  The first call above this code with the full request chain seems to work as it is returning the buffer length successfully.  Just breaks when it sends CRLF.
Looking at the documentation on the send() api that this ultimately drills down to kind of tells me that most of the errors get mapped to the one (broken pipe) I am receiving.  So I was wondering if anyone else has experienced this and can help me out.  Here's my debug log:

HTTPAPI Ver 1.24 released 2012-01-23
OS/400 Ver V5R4M0

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
http_url_get(): 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: sxx.xxxxx.com
DNS server found: 16n.nnn.4n.3
DNS server found: 17n.1n8.5n.1nn
DNS server found: 1nn.nn1.nn.1nn
http_persist_get(): entered
http_persist_req(GET) entered.
http_long_ParseURL(): entered
do_oper(GET): entered
There are 0 cookies in the cache
GET /infocenter/iseries/v6r1m0/topic/rzakj/rzakj.pdf HTTP/1.1
Host: publib.boulder.ibm.com
User-Agent: http-api/1.24

SetError() #55: blockwrite: send: Broken pipe.
http_close(): entered

Thanks in advance.
Alan Anderson
P.S. I x'd and n'd out the IP and domains.

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------