Solved

How to use Microsoft.XMLHTTP object in ChiliSoft ASP

Posted on 2003-11-20
7
763 Views
Last Modified: 2012-08-13
Hello Experts,
       I am running ASP(VBScript) on the Linux server with the support of ChiliSoft 3.6 ASP, but this does not support Microsoft.XMLHTTP object, which I m using in my Script to Send and receive information to a URL, in which I m passing my data to a URL and processing its response.

Is anybody have solution for problem or can anybody let me know any other object that will work on ChiliSoft 3.6 and functions the same.

Thank You
Kishan
0
Comment
Question by:Kishan
7 Comments
 
LVL 21

Accepted Solution

by:
ap_sajith earned 250 total points
ID: 9795188
Could you try the following?

<%
Function CreateXMLObj(XMLType)
dim tmpObj,n
dim ObjArray

select case UCase(XMLType)
case "DOM"
ObjArray = Array("Microsoft.XMLDOM","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument.4.0")
case "HTTP"
ObjArray = Array("Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP.4.0","MSXML2.ServerXMLHTTP.3.0","MSXML2.ServerXMLHTTP.4.0")
case else
'debugging code removed
Set CreateXMLObj = nothing
exit function
end select

On Error Resume Next

'test in reverse order to get "best" version
for n = UBound(ObjArray) to 0 step -1
set tmpObj = CreateObject(ObjArray(n))

If Err Then
'debugging code removed
set tmpObj = nothing
Err.Clear
Else
'debugging code removed
exit for
End If
next

If not IsObject(tmpObj) then
'debugging code removed
CreateXMLObj = nothing
exit function
End If

set CreateXMLobj = tmpObj
end function
%>


Use like this:

<%
set XMLHTTP = CreateXMLObj("HTTP")
set XMLDOM = CreateXMLObj("DOM")
%>

This code snippet is from this excellent discussion at http://www.sitepointforums.com/archive/index.php/t-54526 ... Checkout the second post by alexming as well...

You could use either of the two to find what version of XMLHTTP component you have on the server.

Hope this helps...
Cheers!!
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9795209
Another great script... Checks what versions of XMLHTTP you have on the server...

<%@LANGUAGE="JavaScript"%>
<html>
<head>
<title>MSXML Versions</title>
</head>
<body>
<h1>MSXML Versions on Server</h1>
<p>Following MSXML Parsers are installed on this server:</p>
<p>
<%
var strXMLText = "<?xml version=\"1.0\"?><ROOT></ROOT>";
var i=0;
//1
try
{
var objXMLDOM = new ActiveXObject("Microsoft.XMLDOM");
objXMLDOM.async=false;
if (objXMLDOM.loadXML(strXMLText))
{
Response.Write("[Yes] Microsoft.XMLDOM<br>");
i = i + 1;
}
}
catch (e)
{
Response.Write("[No] Microsoft.XMLDOM<br>");
}
//2
try
{
var objXMLDOM = new ActiveXObject("Msxml2.DOMDocument");
objXMLDOM.async=false;
if (objXMLDOM.loadXML(strXMLText))
{
Response.Write("[Yes] Msxml2.DOMDocument<br>");
i = i + 1;
}
}
catch (e)
{
Response.Write("[No] Msxml2.DOMDocument<br>");
}
//2.6
try
{
var objXMLDOM = new ActiveXObject("Msxml2.DOMDocument.2.6");
objXMLDOM.async=false;
if (objXMLDOM.loadXML(strXMLText))
{
Response.Write("[Yes] Msxml2.DOMDocument.2.6<br>");
i = i + 1;
}
}
catch (e)
{
Response.Write("[No] Msxml2.DOMDocument.2.6<br>");
}
//3
try
{
var objXMLDOM = new ActiveXObject("Msxml2.DOMDocument.3.0");
objXMLDOM.async=false;
if (objXMLDOM.loadXML(strXMLText))
{
Response.Write("[Yes] Msxml2.DOMDocument.3.0<br>");
i = i + 1;
}
}
catch (e)
{
Response.Write("[No] Msxml2.DOMDocument.3.0<br>");
}
//4
try
{
var objXMLDOM = new ActiveXObject("Msxml2.DOMDocument.4.0");
objXMLDOM.async=false;
if (objXMLDOM.loadXML(strXMLText))
{
Response.Write("[Yes] Msxml2.DOMDocument.4.0<br>");
i = i + 1;
}
}
catch (e)
{
Response.Write("[No] Msxml2.DOMDocument.4.0<br>");
}
%>
</p>
</body>
</html>

Cheers!!
0
 
LVL 33

Assisted Solution

by:shalomc
shalomc earned 250 total points
ID: 9795428
Kishan,
Sorry to disappoint you, but XMLHTTP is developed and supported by Microsoft, and exists only on MS platforms.
You will have to use a Java component, that will run on the Application server you have.


0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Kishan
ID: 9801840
Thank You ap_sajith for your excellent code.
         
          But unfortunately I had subscribed to a Shared Linux Server with ChiliSoft 3.6 which doesnt have any of the HTTP or DCOM objects as mentioned in your code.

I am using a code show below.

      str = Request.Form & "&cmd=_notify-validate"

     ' post back to PayPal system to validate
     ' set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
     ' set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
     set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
     objHttp.open "POST", "https://www.paypal.com/cgi-bin/webscr", false
     objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
     objHttp.Send str

As in the above code, I am using these objects to send data and receive response from the mentioned url.
But as the objects doesnt supported on the Linux server I cant get it created.

If you have any other solution for such type of operation or any other object that support this operation, Please let me know

Waiting for your reply

Thank You
Kishan
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9863946
Hi Kishan,
I did dig around for other/similar components in Linux... unfortunately there doesnt seem to be any out there. So i guess you will have to do it the old way.. ie, post the data onto a page and then redirect back to your page.... or pass the values to a popup page which loads the page from the other server. You could pass the values to the popup via the querystring or do a post to it.

Cheers!!
0
 
LVL 6

Expert Comment

by:masirof
ID: 12841150
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Split: ap_sajith &  shalomc

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

masirof
EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now