views:

185

answers:

1

Hi,

var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.open("POST", "http://vat/_vti_bin/lists.asmx", false);

How can I let this script work on a Terminal server? When I open it on my local pc, it works, but when I do the same thing in a browser on a Terminal server, I get Access Denied.

I tried using ServerXMLHTTP, but then i get Cannot create automation object

A: 

Is vat your local pc or the terminal server? I'm guessing it's your local pc, which means you'll be limited by the Same Origin Policy - this means you can only make a request from the same server the page is being served from.

You can get around this using JSONP, which - in a nutshell - loads the ajax as a script tag with a js callback.

Or just move your ajax feed onto your web server.

adam
VAT is the server ( cit-srv-004.Converge-IT.local is dns name ).Dns name Terminal server is ( cit-srv-003.Converge-IT.local ).But it works in my browser on local pc, I get access denied when I do the same in the browser on Terminal server desktop.
Jeroen
Change your request to point to `/_vti_bin/lists.asmx` (ie no hostname)
adam
Don't think that will work, because I'm calling from http://crm/..
Jeroen
That might be, but that's the problem. Your request needs to originate from the same hostname as the website, or it will be restricted by SOP.
adam
But why don't I have that problem when I do this from a browser on my local pc, I'm calling a script from http:/crm/ and I post data to http:/vat/_vti_bin/lists.asmx
Jeroen
Could you just try it and see?
adam
Changed my request to point to /_vti_bin/lists.asmx. I get statuscode 500 or Internal Server Error. Now it goes to http:/crm/../_vti_bin/lists.asmx, but I need to go to http:/vat/vti_bin/lists.asmx.
Jeroen