Solved

How to use Microsoft.XMLHTTP object in ChiliSoft ASP

Posted on 2003-11-20
7
790 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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 informatio…
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/…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

617 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