On Sat, Dec 12, 2009 at 02:56, <[email protected]> wrote:
>
> Thank you for your answer. I try to collect all information.
>
Thanks. With this I should be able to at least point you somewhat towards
finding a solution.
- The first thing that immediately jumps out at me is that the server is
sending back what could be a valid response (it's a bunch of JavaScript) and
yet the response it's sending should therefore have been 200, not 303. It
looks to me like the server is intending to send back a 200 and its response
but for some reason is setting the result code to 303. A result code of 303
is a "failure" indication as far as qooxdoo is concerned. The "failed"
handler should be called.
- The second request you state is a GET, and yet it has POST data. Why do
you believe it's a GET? That second request succeeds (status 200) and
returns data, again, that looks like JavaScript.
- There is no code in qx.io.remote.*, AFAIR, to do any retransmissions, so
that second request is almost certainly being made by your code, not by some
automatic action within qooxdoo.
- The value you pass as the third parameter to the Request constructor is
the expected response type, and determines what qooxdoo does with the
response before handing the response to the user. If you expect JavaScript
to be returned, presumably you want that code to be eval()'ed. You should
then pass "text/javascript" as the expected response type. What you get
back, then, from response.getContent() would be the result of eval()'ing
that JavaScript code... i.e. typically the value of the last expression in
the code. Alternatively, if you just want to retrieve the text of the
JavaScript that was returned in the result, you could use "text/plain" as
the third parameter to the constructor, in which case no processing will be
done on the result.
Hopefully that gives you some pointers on where to look. The first thing I'd
look into is why the server is returning a 303 seemingly improperly.
Cheers,
Derrell
> The code I use:
>
>
> -----------------------------------------------------------------------------------
>
> sendXMLHTTPRequest : function( pRequestData, pContext )
> {
> // Storing context map
> this.__context = pContext;
>
> var isAsynchron = pContext['asynchron'] != 'false';
>
>
> // Callback function specification
> if (pContext['callback'] == 'undefined')
> this.__xhReqCallbackFunctionHolder = this.__xhReqEmptyCallbackFunction;
> else
> this.__xhReqCallbackFunctionHolder = pContext['callback'];
>
> if (pContext['callbackError'] == 'undefined')
> this.__xhReqCallBackFunctionErrorHandlerFunctionHolder =
> this.__xhReqDefaultErrorHandlerFunction;
> else
> this.__xhReqCallbackFunctionHolder = pContext['callbackError'];
>
> // Building message body
> var parameters="--BOUNDARY-12345\n";
> parameters += "Content-Disposition: form-data; name=\"FORM_ID\"\n\n";
> parameters += edemo.EventusUtils.getInstance().getFormId() +"\n\n";
> parameters += "--BOUNDARY-12345\n";
> parameters += "Content-Disposition: form-data; name=\"xml_data\"\n\n";
> parameters += pRequestData+"\n\n";
> parameters += "--BOUNDARY-12345--\n";
>
>
> var resultMIME = edemo.AjaxTools.DEFAULT_MIME;
> if ( pContext['resultMIME'] != 'undefined' ) resultMIME =
> pContext['resultMIME'];
>
> // Creating HTTPRequest (for testing I use wired-in address)
> this.__xhReq = new qx.io.remote.Request( '
> https://195.228.146.232/cgi-bin/evisapi.dll?XMLHTTPREQUEST', 'POST',
> resultMIME );
> this.__xhReq.setAsynchronous(isAsynchron);
> this.__xhReq.setProhibitCaching(false);
> this.__xhReq.setRequestHeader("Content-Type", "multipart/form-data;
> boundary=BOUNDARY-12345; charset=UTF-8");
> this.__xhReq.setData( parameters );
> this.__xhReq.addListener("failed", this.test );
> this.__xhReq.addListener("completed", function(e) {
> this.test(e);
> if (this.__xhReqInternalCallbackFunction != null)
> this.__xhReqInternalCallbackFunction();
> } );
> this.__xhReq.send();
>
> if ( !isAsynchron )
> {
> if (this.__xhReqInternalCallbackFunction != null)
> this.__xhReqInternalCallbackFunction();
>
> return (this.__xhReq.status == 200);
> }
>
> return true;
>
> },
>
>
> -----------------------------------------------------------------------------------
>
> The evisapi.dll is our web server module (called dll only for convenience,
> because it is available both to IIS on Windows and apache on Unix-like OS),
>
> now we use Apache). It keeps the connection between the client and the AS.
>
>
> Additionally, DEFAULT_MIME is 'text/plain', but I also tried
> application/xml for other message, and I ran into an error (see my other
> post about it).
>
> I call this function by the following statement:
>
>
> -----------------------------------------------------------------------------------
>
> hrq.sendXMLHTTPRequest( '<QD_FETCH_TEST_TEXT table="'+ tableCode +'"/>', {
> asynchron : false
> } );
>
>
> -----------------------------------------------------------------------------------
> *
> *
> *Here is the Firebug info for the POST request:*
>
>
> *Status:*
> 303 See Other 45ms
>
> *Response headers:*
>
> DateSat, 12 Dec 2009 08:49:23 GMTServerApache/2.2.9 (Debian)
> PHP/5.2.6-1+lenny3 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8gPragma
> no-cache Set-Cookie
> EVISAPI_DLL=49B7.BFDCD858.4B235913;path=/cgi-bin/evisapi.dllLocation
> /cgi-bin/evisapi.dll/?REAL_RESP=1Content-Length87 Keep-Alivetimeout=15,
> max=100ConnectionKeep-AliveContent-Typetext/html
>
>
> *Request headers:*
> Host 195.228.146.232User-AgentMozilla/5.0 (Windows; U; Windows NT 5.1; hu;
> rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5Accept
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Languagehu-hu,hu;q=0.8,en-us;q=0.5,en;q=0.3Accept-Encoding
> gzip,deflateAccept-CharsetISO-8859-2,utf-8;q=0.7,*;q=0.7 Keep-Alive300
> Connectionkeep-aliveContent-Typemultipart/form-data;
> boundary=BOUNDARY-12345; charset=UTF-8 Referer
> https://195.228.146.232/files/app/fullframe/index.htmlContent-Length 219
> Cookie***AuthorizationBasic aWZsb3c6dC5yYWIsYW4tdF82MCE=Pragmano-cache
> Cache-Controlno-cache
>
> *Post:*
> --BOUNDARY-12345
>
> Content-Disposition: form-data; name="FORM_ID"
>
>
> tmpform_7682.2:1
>
>
> --BOUNDARY-12345
>
> Content-Disposition: form-data; name="xml_data"
>
>
> <QD_FETCH_TEST_TEXT table="AD_SYSTEM_PARAMETER"/>
>
>
> --BOUNDARY-12345--
>
>
> *Response:*
> var eqColumnCount = 4;
>
> var eqColumnNameList = [ 'SYSTEM_PARAMETER_CODE', 'PARAMETER_VALUE', 'EID',
> 'ETS' ];
>
> var eqColumnTypeList = [ 'string', 'string', 'string', 'string' ];
>
> var eqData = [
>
> ['LNPS_CARRY_SURE', '1', '710000.563', '710000.563'],
>
> ['LNPS_PATIENT_TIME', '1', '710000.564', '710000.564'],
>
> ['LNPS_AGAIN_PSM', '2', '710000.565', '710000.565'],
>
> ['LNPS_ONDEMAND', 'FALSE', '710000.566', '710000.16532957'],
>
> ['FILEIO_PATH', 'FILEIO_PATH', '710000.567', '710000.6631320'],
>
> ['FLOW_RELEASE_CODE', 'EVENTUS_R3', '710000.568', '710000.568'],
>
> ['LICENCE_FIXED', '3000', '710000.569', '710000.11155099'],
>
> ['LICENCE_FLOATING', '20', '710000.570', '710000.570'],
>
> ['RT_TASK_ROLE_CACHE_UPDATE_TICKET_ID', '0', '710000.571',
> '110070.35482846'],
>
> ['DEFAULT_LANGUAGE', 'Hungarian', '710000.572', '710000.32615107']
>
> ];
>
>
>
> *Here is the Firebug info for the GET request:*
>
>
> *Status:*
> 200 OK 51ms
>
> *Response headers:*
> DateSat, 12 Dec 2009 08:49:23 GMT ServerApache/2.2.9 (Debian)
> PHP/5.2.6-1+lenny3 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g
> Accept-RangesnoneContent-Length 838Keep-Alivetimeout=15, max=99Connection
> Keep-AliveContent-Typetext/html
>
> *Request headers:*
> Host195.228.146.232User-AgentMozilla/5.0 (Windows; U; Windows NT 5.1; hu;
> rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 Accept
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Languagehu-hu,hu;q=0.8,en-us;q=0.5,en;q=0.3Accept-Encoding
> gzip,deflateAccept-CharsetISO-8859-2,utf-8;q=0.7,*;q=0.7Keep-Alive300
> Connectionkeep-alive Referer
> https://195.228.146.232/files/app/fullframe/index.htmlCookie ****
> AuthorizationBasic aWZsb3c6dC5yYWIsYW4tdF82MCE=Pragmano-cacheCache-Control
> no-cache
>
> *Post:*
> --BOUNDARY-12345
>
> Content-Disposition: form-data; name="FORM_ID"
>
>
> tmpform_7682.2:1
>
>
> --BOUNDARY-12345
>
> Content-Disposition: form-data; name="xml_data"
>
>
> <QD_FETCH_TEST_TEXT table="AD_SYSTEM_PARAMETER"/>
>
>
> --BOUNDARY-12345--
>
>
> *Response:*
> var eqColumnCount = 4;
>
> var eqColumnNameList = [ 'SYSTEM_PARAMETER_CODE', 'PARAMETER_VALUE', 'EID',
> 'ETS' ];
>
> var eqColumnTypeList = [ 'string', 'string', 'string', 'string' ];
>
> var eqData = [
>
> ['LNPS_CARRY_SURE', '1', '710000.563', '710000.563'],
>
> ['LNPS_PATIENT_TIME', '1', '710000.564', '710000.564'],
>
> ['LNPS_AGAIN_PSM', '2', '710000.565', '710000.565'],
>
> ['LNPS_ONDEMAND', 'FALSE', '710000.566', '710000.16532957'],
>
> ['FILEIO_PATH', 'FILEIO_PATH', '710000.567', '710000.6631320'],
>
> ['FLOW_RELEASE_CODE', 'EVENTUS_R3', '710000.568', '710000.568'],
>
> ['LICENCE_FIXED', '3000', '710000.569', '710000.11155099'],
>
> ['LICENCE_FLOATING', '20', '710000.570', '710000.570'],
>
> ['RT_TASK_ROLE_CACHE_UPDATE_TICKET_ID', '0', '710000.571',
> '110070.35482846'],
>
> ['DEFAULT_LANGUAGE', 'Hungarian', '710000.572', '710000.32615107']
>
> ];
>
>
> -----------------------------------------------------------------------------------
>
> If you would like, I could present our low-level solution which works.
>
> Thank you for your help!
>
> Balage
>
>
>
> ________________________________
> From: Derrell Lipman <[email protected]>
> To: qooxdoo Development <[email protected]>
> Sent: Fri, December 11, 2009 5:54:06 PM
> Subject: Re: [qooxdoo-devel] XMLHttpRequest and POST messages and
> notification
>
>
> On Fri, Dec 11, 2009 at 11:31, <[email protected]> wrote:
>
> >
> >Hi!
> >
> >>I've got ahead with the qx.io.remote.Request problem. In the archives I
> >>find information that even when I send my request as POST,
> >>the result comes as GET. I found that for each of my request, there is
> >>two message entry appears in the firebug log:
> >
> >>- the original POST message, which seemingly contains the correct answer,
> but has a status code of 303 (See Other)
> >>- an interesting GET message, which has an OK (200) result code.
> >
> >>However, the event handler assigned to the Request object isn't called.
> (Neither the "completed", nor the "failed".)
> >
> >>To the whole picture, we use a propriety web-server component (which
> keeps the connection with our AS), so
> >>I am not entirely free to juggle with GET/POST messages. :-(
> >
> >>Is there a way to use the POST message and hook on the completement
> trigger?
> >
>
> POST requests work fine. Why don't you post a code snippet and maybe we can
> tell you what you're doing wrong. Also, if you could post the details of the
> initial POST, its reply with 303, the subsequent GET, and it's 200 reply as
> seen in FireBug's "Net" tab, that would probably be useful.
>
> Derrell
>
>
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
>
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel