The .php file that responds is:
<?php
require_once("config.php");
$request = Data::parse(Request::httpPost());
?>
<?xml version="1.0"?>
<fxlresponse>
<?php
$response = "";
if (User::login($request->get("name"), $request->get("password")))
{
$response .= '<error ' . "\n" .
' id="0" /> ' . "\n" .
'<login ' . "\n" .
' session="' . Session::id() . '" ' . "\n" .
' name="' . User::name() . '" ' . "\n" .
' fullname="' . User::fullName() . '" ' . "\n" .
' type="' . User::type() . '" />' . "\n";
}
else
{
$response .= '<error ' . "\n" .
'id="2" />' . "\n";
}
// Send the response
echo $response;
?>
</fxlresponse>
In Firefox, the response is (as printed into a Label):
<fxlresponse> <error id="0"> <login
session="bhs49f0j9hjc2c2nvilftn72j2" name="gfaraj" fullname="George
Faraj" type="1"> </login></error></fxlresponse>
In IE, the response is:
<?xml version="1.0" ?>
- <fxlresponse>
<error id="0" />
<login session="2og11qots5vo5ipojvhg9pa8h5" name="gfaraj"
fullname="George Faraj" type="1" />
</fxlresponse>
Which seems to me to be formatted to "view" this XML. How can I make
this work? Also, notice that '<?xml version="1.0" ?>' is missing from
the FF response.
If it helps, the request to the server is made through a FormPanel that
has the following options:
form.setEncoding(FormPanel.ENCODING_URLENCODED);
form.setMethod(FormPanel.METHOD_POST);
Any help is appreciated. Thanks a lot.
Isn't that a PHP problem? Rather then a GWT problem?
Hasn't anyone attempted to send xml from php to GWT that can give me
some direction?
<?php
header('Content-type: text/xml');
require_once("config.php");
...
Marcos
-----Mensagem original-----
De: Google-We...@googlegroups.com
[mailto:Google-We...@googlegroups.com]Em nome de YUY0x7
Enviada em: quarta-feira, 23 de agosto de 2006 23:44
Para: Google Web Toolkit
Assunto: Parsing XML server responses
text/xml
application/xml
text/plain
text/plain; charset=utf-8
I have no idea what's going on.
class HTTPRequestImplIE6 extends HTTPRequestImpl {
protected native JavaScriptObject doCreateXmlHTTPRequest() /*-{
return new ActiveXObject("Msxml2.XMLHTTP");
}-*/;
}
G.
For example, instead of doing this (this is straight from
HTTPRequestImpl.java):
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4) {
delete xmlHttp.onreadystatechange;
var localHandler = handler;
var responseText = xmlHttp.responseText;
handler = null;
xmlHttp = null;
localHandler.@com.google.gwt.user.client.ResponseTextHandler::onCompletion(Ljava/lang/String;)(responseText);
}
};
I'd like to call my own handler, and pass the xmlHttp.responseXML
property. What type should my Java function accept as parameter?
Thanks.