Ajax.Request fails in IE with java/jaxp service
Reported by hbetts | June 16th, 2008 @ 09:55 PM
Ajax.Request fails in IE v6 when using the parameters: object.
For example:
var reqHash = new Hash();
reqHash.set('service','ServiceString');
reqHash.set('port','portString);
reqHash.set('param','paramString');
new Ajax.Request("proxy",{
method:"post",
parameters: reqHash,
asynchronous:true,
onFailure:function(){
alert("Web service Failed");
},
onSuccess:function(transport){
alert(transport.responseText);
}
});
Will fail in IE6 but not FF v2 and higher, as will
new Ajax.Request("proxy",{
method:"post",
parameters: $H({service:'ServiceName',port:'portString',param:'paramString'}),
asynchronous:true,
onFailure:function(){
alert("Web service Failed");
},
onSuccess:function(transport){
alert(transport.responseText);
}
});
However, if we change it to look like this:
reqHash.set('service','ServiceName');
reqHash.set('port','portString');
reqHash.set('param','paramString');
new Ajax.Request("webserviceproxyservlet?".concat(reqHash.toQueryString()),{
method:"post",
asynchronous:true,
onFailure:function(){
alert("Web Service Failed");
},
onSuccess:function(transport){
alert(transport.responseText);
}
});
It works just fine in IE and FF. Therefore I can only conclude that it
is something in the parameters Hash map that follows the proxy.
Can you please advise.
Hendry Betts III
Application Development Team
ViaSat, Inc.
o: 678-924-2409
Comments and changes to this ticket
-
John-David Dalton June 16th, 2008 @ 10:14 PM
- → State changed from new to invalid
Hello Hendry,
I cannot reproduce this in the latest github core.
Also, in your "workaround" you are sending request via the "post" method. So then
why are you setting "get" variables in the url?
I think maybe your serverside is looking for something like $_GET['port']; instead of $_POST['port'];
-
hbetts June 16th, 2008 @ 10:25 PM
John-David,
Thank you for your reply.
We are using the latest GA distribution (1.6.0.2) and cannot use
anything other than GA software in our applications [company policy]. I
realize the use of the post declaration in the attribute hashmap is
pointless. It was just latent from quick fixes.
The services themselves are java/jaxp web services and do not care if it
is a get or a post for the request. The reason I raised this as a bug
is because the second construct I provided worked in Prototype 1.5
(which is where we began using this library), and when we upgraded to
the last GA 1.6.0.2, we encountered this problem and found the
workaround.
-
John-David Dalton June 16th, 2008 @ 10:32 PM
- → Title changed from Ajax.Request fails in IE to Ajax.Request fails in IE with java/jaxp service
- → State changed from invalid to new
Hmmm. I don't think the issue is with the Hash object then because that seems to test fine.
I think it might have to do with the java/jaxp setup and how Prototype posts things via ajax.
Have you tried a basic ajax wrapper (found by googling) and seen if that causes any issues?
Your first example should work.
I am reopening this ticket under a new name.
-
hbetts July 11th, 2008 @ 05:38 PM
- no changes were found...
-
hbetts July 11th, 2008 @ 05:39 PM
- no changes were found...
-
hbetts June 16th, 2008 @ 11:20 PM
John-David,
I can use the poster add-on in FF to post values to our webservice proxy
and it responds fine. I have confirmed at every possible point that it
is not the web service or Ajax interaction. When we try to use GA
1.6.0.2 the proxy servlet doesn't even see the parameters being
submitted. Again, in version 1.5.0 - 1.5.1.2 we did not have this
problem.
Thanks again,
-
John-David Dalton June 21st, 2008 @ 04:30 PM
Out of curiosity can you try this on lines 1174-1175 of Prototype 1.6.0.2
else if (Object.isHash(this.options.parameters)) this.options.parameters = this.options.parameters.toQueryString().toQueryParams(); -
hbetts June 23rd, 2008 @ 04:40 PM
John-David,
It appears to fix the issue with the Ajax.Request. However, it "breaks"
the output from the transport.resposeText -- I can no longer view it as
a String, it is an object.
I will take some more time to delve into the response, but I wanted to
let you know that it did have an impact on the application itself.
-
hbetts July 11th, 2008 @ 04:46 PM
- → Tag changed from to needs_tests
John-David,
This issue was not related to prototype. It was specifically related to IE and NTLM. We have resolved it.
The short cause was we were using NTLM credentials to validate and IE was not POSTing the data back properly. We found the fix and have implemented it. Prototype is now behaving according to specifications and working wonderfully. Thank you for your patience on this matter and you can close this issue.
Thanks again,
Hendry
-
John-David Dalton July 11th, 2008 @ 05:35 PM
- → State changed from new to invalid
- → Tag changed from needs_tests to an issue not
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
The Prototype JavaScript library.
