Click to See Complete Forum and Search --> : XMLHttpRequest object question


KnightDeveloper
08-04-2009, 12:14 AM
I have an asp page that creates this object (e.g. Dim objXMLHTTP : SET objXMLHTTP = Server.CreateObject("Msxml2.XMLHTTP.3.0") ).

Is this something that has to be supported on the web server, or within the user's browser?

Thanks.

Scriptage
08-04-2009, 01:23 AM
If it's created on the server then it's going to be used to receive information using an HTTP request on the server, not the client.

Kuriyama
08-04-2009, 07:53 AM
Dim objXMLHTTP : SET objXMLHTTP = Server.CreateObject("Msxml2.XMLHTTP.3.0")

Any time you create an ASP page, this would be server side functionality. You can make XHR calls using JavaScript from the client side.

KnightDeveloper
08-04-2009, 02:25 PM
Sorry, I don't think I was clear with my question.

What would I need on the server so that I can run that line of code to create the XMLHttpRequest object? Would that be compatible with all versions of Classic ASP?

Or is the only thing required for it to work is that someone's browser (IE 5.0 onwards) needs to support that object so they can view the page properly?

Thanks again.

Kuriyama
08-04-2009, 02:35 PM
Sorry, I don't think I was clear with my question.

What would I need on the server so that I can run that line of code to create the XMLHttpRequest object? Would that be compatible with all versions of Classic ASP?

Or is the only thing required for it to work is that someone's browser (IE 5.0 onwards) needs to support that object so they can view the page properly?

Thanks again.

You are confusing server vs client side coding. If you are developing an ASP page, that would be server side development. If you are creating anything that exists in a <script></script> tag in your HTML, then that is client side coding (unless you are using ASP.NET).

From the small snippet that you gave me, you are running this XHR call on the server. The client doesn't care what version of the XMLHTTP object because that code runs on the server. If the server can run it you'll be fine.

KnightDeveloper
08-05-2009, 11:57 AM
Ok thanks Kuriyama. Do you or anyone else know what XMLHttpRequest object would be best to use so that it'll be compatible with the oldest version of a server setup as possible? This asp page I'm creating is going to be used by other people (who know nothing about websites), and they'll put it on their sever so that it'll run (it calls a web service). So I'm not going to know the details of their server.

Kuriyama
08-05-2009, 12:07 PM
Ok thanks Kuriyama. Do you or anyone else know what XMLHttpRequest object would be best to use so that it'll be compatible with the oldest version of a server setup as possible? This asp page I'm creating is going to be used by other people (who know nothing about websites), and they'll put it on their sever so that it'll run (it calls a web service). So I'm not going to know the details of their server.

I don't think this is a good solution. You shouldn't be giving script to other people because you have no way of knowing what server side language they are using or what type of OS they are running on their servers. What happens if you try to give a .ASP file to someone running PHP or a J2EE app? What happens if they are using Unix and not MSServer 200x?

If you already have a web service created, you should just be able to provide your clients with the WSDL file. There is simple no consistent way for you to do this without big head aches.

*IF* by some chance all of your clients are running classic ASP and on MSServer2000+ Msxml2.XMLHTTP.3.0 should be supported.

KnightDeveloper
08-05-2009, 05:47 PM
Yeah, that would be the best scenario, but like I said, we're assuming the person who wants to call our web service knows nothing about websites and doesn't have a web developer to do the job. That's why I'm creating an asp, php, and aspx pages that would ideally be as compatible as possible with the respective servers. They would tell us what server technology they're using, and we'd give them the appropriate file.

The .NET solution will work for all versions thus far, PHP will work for version 4 and later, but I'm just having some trouble understanding what's needed for the Classic ASP solution.

Kuriyama
08-05-2009, 08:34 PM
Yeah, that would be the best scenario, but like I said, we're assuming the person who wants to call our web service knows nothing about websites and doesn't have a web developer to do the job. That's why I'm creating an asp, php, and aspx pages that would ideally be as compatible as possible with the respective servers. They would tell us what server technology they're using, and we'd give them the appropriate file.

The .NET solution will work for all versions thus far, PHP will work for version 4 and later, but I'm just having some trouble understanding what's needed for the Classic ASP solution.

Well this isn't exactly best practice but. . . teeeechnically you can call .NET components using server.CreateObject. Anyways, the XML object that you are using will work on all windows server editions 2000+

KnightDeveloper
08-07-2009, 11:34 AM
Thanks again.