If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > How can I use ASP to interact with cgi-bin scripts?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-09-04, 16:56
thele thele is offline
Registered User
 
Join Date: Jun 2003
Location: Ohio
Posts: 108
Question How can I use ASP to interact with cgi-bin scripts?

I am using Search engine Studio, which is a cgi script that gives us search results on our intranet.

The problem is that the cgi script displays the results. I would like ASP to display the results.

The product help desk says to use their XML wrapper to call the cgi script (via "GET"), and then the XML object can display the results.

However, XML 3 with sp4 patch does not work. It gives me a bad error: msxml3.dll error '80004005'

The help desk says that that my ASP version is too old.

So my only solution: write my own asp wrapper, which will call the cgi-script via "GET", then display the results on the same page.

How can I do this?

`Le
Reply With Quote
  #2 (permalink)  
Old 12-09-04, 20:14
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
ASP version is too old? First I've heard of that... make sure your server is up to date on all it's patches.. but aside from that, it could be how you're using the MsxML object. Can you show us your code?
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #3 (permalink)  
Old 12-10-04, 10:09
thele thele is offline
Registered User
 
Join Date: Jun 2003
Location: Ohio
Posts: 108
Smile

I'd be happy to!

Code:
cgiPath = "/cgi-bin/SearchEngine/root/sessearch.cgi"
scrName = Request.ServerVariables("URL")
query = Request.ServerVariables("QUERY_STRING")

Response.Write(cgiPath & "?" & query & "&wrap=" & scrName)

Function PrintSearchCode (url)
	Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xml.Open "GET", url, False '-- Error happens here
	xml.Send()
	Response.write xml.Responsetext
End Function

if query <> "" then
	PrintSearchCode (cgiPath & "?" & query & "&wrap=" & scrName)
end if
The error happens in the function, at the "xml.Open" call. I have upadated our xml3 with sp 4, but I still get the error. I am not familiar with XML at all I am afraid...

Basically the function calls the cgi executable script, called "sessearch.cgi". That cgi script returns the webpage results. Normally the .cgi file is called directly from a form Get.

So as far as I can tell, this asp function calls the cgi file via GET, then the script returns the results back to the xml object. Then the xml object prints those results.

But the error happens on the xml.open command.

Any advice would be welcome, thanks.

~Le
Reply With Quote
  #4 (permalink)  
Old 12-10-04, 13:03
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
Try this:

Code:
Function PrintSearchCode (url)
  Set xml = server.CreateObject("msxml2.XMLHTTP")
  xml.open "get", url, false
  xml.send()
  Response.write xml.Responsetext
End Function
In our code, the "get" statement is lower case.. not sure if that matters...
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #5 (permalink)  
Old 12-10-04, 14:02
thele thele is offline
Registered User
 
Join Date: Jun 2003
Location: Ohio
Posts: 108
Thumbs down

same issue
I get: error '80004005'

Interesting though, because the before the change the error was: msxml3.dll error '80004005'


I am still trying different things. More suggestions would be welcome.

Thanks.

`Le
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On