Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to use Microsoft.XMLHTTP object in ChiliSoft ASP

Posted on 2003-11-20
7
Medium Priority
?
800 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 1000 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 1000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
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/…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

722 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