How does one return a different status than 200 wi - WeOnlyDo Discussion board

How does one return a different status than 200 wi (wodWebServer / wodWebServer.NET)

by tpearson, Saturday, September 19, 2009, 20:18 (5326 days ago)

In my testing I have 2 different ISAPI providers I'm working with. One has plenty of documentation and informs me I should return the header with all of my processes. (i.e. HTTP/1.0 200 OK
Content-Type: text/html

)

Setting this up with an IIS server everything looks as it should.

Using the wodWebServer it sends the everything back to the browser.

I'm not finding any documentation on how to implement the PHP ISAPI dll.

Re: How does one return a different status than 20

by wodDamir, Saturday, September 19, 2009, 21:36 (5326 days ago) @ tpearson

Hi,

Did you try instructions from our Help file?

You can find them here:

http://www.weonlydo.com/WebServer/Help/Running_PHP_as_ISAPI.html

The tutorial there explains how to load and use PHP as ISAPI.

Can you please try that?

Regards,
Damba

Re: How does one return a different status than 20

by tpearson, Saturday, September 19, 2009, 21:53 (5326 days ago) @ wodDamir

I have the ISAPI working in the the WeOnlyDo server and IIS.

I need to return a different status than 200. That help page does not explain how to accomplish that.

Re: How does one return a different status than 20

by wodDamir, Saturday, September 19, 2009, 22:04 (5326 days ago) @ tpearson

Hi,

Sorry for the misunderstanding. In your first post, you mentioned you can't find any documentation on how to implement PHP ISAPI.

However, did you perhaps try setting Response.StatusCode to some other value?

Regards,
Damba

Re: How does one return a different status than 20

by tpearson, Saturday, September 19, 2009, 22:14 (5326 days ago) @ wodDamir

I don't have access to the user.response object inside the isapi process. It completes on its own. When a specific need is required, I'd like to handle it in the ISAPI, not be stuck in my single thread, as I'm using the com object in a single threaded language.

Using ISAPI has proven that I can pound the server without blocks but a long process.

Re: How does one return a different status than 20

by wodDamir, Sunday, September 20, 2009, 16:06 (5325 days ago) @ tpearson

Hi,

I see what you mean. I'll have to check with our programmers if this is something we can do, since the execution of php is given to isapi module, and is no longer under our control.

I.e. the ISAPI module is who generates the appropriate headers etc.

However, as mentioned, I'll see if we can do anything related to this and we will inform you as soon as we know more on this.

Regards,
Damba

Re: How does one return a different status than 20

by tpearson, Sunday, September 20, 2009, 20:13 (5325 days ago) @ wodDamir

OK, there is some difference between the two ISAPI implementations.

I'm unable to get the PHP5ISAPI to correctly handle the header output.

Where I'm seeing different results from information returned directly by the FOXISAPI and what I build. The header I'm directed to put into my response is not being forwarded by either the IIS server or the wodWebServerCom. The status page returned by the FOXISAPI to the IIS server does not show the header, wodWebServerCom shows the header.

Further testing has also shown the header I am putting into the IIS and wodWebServerCom are not being used. Both IIS and wodWebServerCom return a status of 200 to the MSXML2.XMLHTTP object. Seeing that the headers are not used in IIS, I will need to program my receiving end to accept calls from both, so the question I originally asked is no longer a valid request.

I would like to see why the status pages are different. Also, why does the StatusCode of the MSXML2.XMLHTTP object return different text from the two servers.

Here's an example of my results
[code]
oxml.open( get , http://{iissever}/isapi/foxisapi.dll/pcserver11.wodcom.testerror , .F.)
oxml.send()
?oxml.status,oxml.statusText <-- 200 OK
?oxml.responseText <-- <html><body><h1>Error #400</h1>Bad Request</body></html>

oxml.open( get , http://{wodWebServerCom}/testerror , .F.)
oxml.send()
?oxml.status,oxml.statusText <-- 200 Not Found
?oxml.responseText <-- <html><body><h1>Error #400</h1>Bad Request</body></html>
[/code]

What is being returned by my process which is called by the foxisapi.dll follows:
[code]
HTTP/1.0 400 Bad Request
content-type: text/html

<html><body><h1>Error #400</h1>Bad Request</body></html>
[/code]

Re: How does one return a different status than 20

by wodDamir, Sunday, September 20, 2009, 23:59 (5325 days ago) @ tpearson

Hi,

Is there any chance you could provide us a sample/instructions on how exactly to duplicate the problem you are experiencing?

If so, you can send any information/sample to techsupport@weonlydo.com

It would really help us if we could duplicate the same issue on our side, since it's hard to say what could cause different responses without actually seeing what is happening.

Regards,
Damba

Re: How does one return a different status than 20

by tpearson, Monday, September 21, 2009, 19:47 (5324 days ago) @ wodDamir

I spoke with someone that writes PHP code a lot more often then I do, and he corrected me on my test script to use the Header() function. IIS correctly returns the status of 400, the wodWebServerCom does not.

I will be putting together instructions on how to reproduce this testing world, and emailing it in. May I attach some binary executable files with this email? I'll be sure to zip them.

Thanks,

Re: How does one return a different status than 20

by wodDamir, Monday, September 21, 2009, 19:59 (5324 days ago) @ tpearson

Hi,

Yes, ofcourse. However, please try to keep is less then 2MB if possible.

Also, please rename the zip to _ip or some other unknown extension in order to pass possible virus checks etc.

Regards,
Damba