× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I knew it was something stupid. I added that Content-Length and forgot to
add the line breaks back... DOH!

--
Mike Wills
http://mikewills.info
P: (507) 933-0880 | Skype: koldark


On Mon, Dec 7, 2009 at 3:43 PM, Aaron Bartell <aaronbartell@xxxxxxxxx>wrote:

You need two new lines after your headers so the client knows when the
headers stop and the content starts.

Change this line of code to be like this:

WriteResponse('Content-Length: ' + %char(%len(p_UsrSpcData)) + x'1515');

For that matter you don't need to specify a Content-Length because Apache
will add one for you if it notices one wasn't specified.

Aaron Bartell
http://mowyourlawn.com
http://mowyourlawn.com/blog/


On Mon, Dec 7, 2009 at 3:29 PM, Mike <koldark@xxxxxxxxx> wrote:

I am getting a 500 error "Cannon read script output pipe" when trying to
write out my user space through QtmhWrStout. I am so confused here and
Google isn't helping me (I am sure I am not using the right terminology).

D QtmhWrStout PR extproc('QtmhWrStout')
D DtaVar 32767A options(*varsize) const
D DtaVarLen 10I 0 const
D ErrorCode 8000A options(*varsize)

D QtmhWrStoutPtr PR extproc('QtmhWrStout')
D DtaVar * value
D DtaVarLen 10I 0 const
D ErrorCode 8000A options(*varsize)


P*----------------------------
----------------------
P* Procedure name: Main
P* Purpose:
P* Returns:
P*--------------------------------------------------
P Main B
D Main PI

/free

// Read all of the data sent via STDIN into the user space.
QtmhRdStin( p_UsrSpcData
: MAXSPACE
: len
: Kaboom );

// Do stuff here

WriteResponse('Content-Type: application/xml' + cr);
WriteResponse('Content-Length: ' + %char(%len(p_UsrSpcData)));

QtmhWrStoutPtr(p_UsrSpcData:%len(p_UsrSpcData):ErrCode);

return;

/end-free
P Main E


P*--------------------------------------------------
P* Procedure name: WriteResponse
P* Purpose:
P* Returns:
P*--------------------------------------------------
P WriteResponse B
D WriteResponse PI
D buffer 32767A options(*varsize) const

/free

QtmhWrStout(%trim(buffer):%len(%trim(buffer)):ErrCode);

return;

/end-free
P WriteResponse E


Right now I am just trying to bring in an XML document and write it back
out. Just to make sure my code is working.

What am I doing stupid?

--
Mike Wills
http://mikewills.info
P: (507) 933-0880 | Skype: koldark
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.


--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.