Solved

How to use Microsoft.XMLHTTP object in ChiliSoft ASP

Posted on 2003-11-20
7
782 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
If condition on Html with Asp 11 49
edit .asp files 5 61
Load data upon clicking a button 8 54
Session on Html 8 55
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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