473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Accessing .asp subroutines remotely

26
Hi,

I need to access an .asp subroutine file from a subdomain.

i.e. the website is at www.domain.com and I want to access the same subroutines on the subdomain mobile.domain.com.

The normal #include and #virtual don't seem to be working remotely.

I have also tried:

url = "http://<domain>/subroutines.asp"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.write xmlhttp.responseText
set xmlhttp = nothing

and it doesn't error out, but the subroutines don't seem to be accessible.

Ideas? thanks.
May 2 '09 #1
10 2890
jhardman
3,406 Expert 2GB
actually sounds like a server issue to me. Let me ask an IIS expert to weigh in.

Jared
May 4 '09 #2
Denburt
1,356 Expert 1GB
Yes this would be a server issue as an include tag such as this is called a Server Side Include or SSI. Do you have access to the servers directory structure or are you uploading to a remote server someplace? This is important, if it is the latter then there may be certain restrictions on what you can use and how you can use it. Such as using various file extensions and such.
It sounds as though you are trying to move up on the directory structure as such. <!--#include virtual="../header.html" -->
So it may be as simple as that a simple .. or ../../ for moving up two directories depending on where the file resides the server may require a full path name even it really depends on the server and the restrictions that they put on it and where the file resides in relation to the file that calls it.

here is a link that may help.
http://www.w3schools.com/asp/asp_incfiles.asp
May 5 '09 #3
liz0001
26
I have looked through your reply and tested out your suggestions. The problem is that my subdomain, even though it is physically located in a subdirectory, is treated as a completely separate entity. Therefore I can't access the subroutine file through a relative path. (

<!-- #include file ="../ActionFiles/subroutines.asp" -->

gives the error:

"The Include file '../ActionFiles/subroutines.asp' cannot contain '..' to indicate the parent directory. "

)

I am uploading to a remote server with a shared hosing package, so I don't have control over the server variables. Is there a setting I could ask support to change to allow me to include a remote file?

It looks to me like the problem is more that the .asp code won't execute. It does read in the file through the MSXML2.ServerXMLHTTP object, and if I take off the <% %> asp tags it will display the actual text. It just won't allow me to use the subroutines.

Is there a way I can specify for the read-in file to execute early enough to use those subroutines in the page?
May 5 '09 #4
Denburt
1,356 Expert 1GB
You stated that it is in a sub directory so the two dots shouldn't be necessary that will only take you to the parent. You also stated that you can read text from an include of this sort so obviously you have the paths straight, now as to why you can't call the subroutines there could be a lot of reasons for that. If it is loading the file then you should be able to call the subroutines in it.
As to your question about the file that is read in and if you are calling it early enough yes it loads before any scripting on the page. Quoting from the link I posted earlier:
Included files are processed and inserted before the scripts are executed.
You may have an error in the script or something there that is hanging it up I really can't say. If I were you I would try to break it up so that I only have one subroutine then add them each in one at a time till you see where it breaks. If need be start with something really simple call that and make sure it works then go from there.
May 5 '09 #5
GazMathias
228 Expert 128KB
Couple of thoughts

<!-- #include file ="../ActionFiles/subroutines.asp" -->

gives the error:

"The Include file '../ActionFiles/subroutines.asp' cannot contain '..' to indicate the parent directory. "
Would Enable Parent Paths in IIS cure that?

Also are the User credentials the same in the sub domain as they are in the root?
May 5 '09 #6
liz0001
26
Thanks for working at this with me.

Let me clarify my problem, correct me if I am wrong:

1) Subdomains are treated as separate entities by asp (as evidenced by the session variables not transferring).

2) Therefore using any sort of relative path shouldn't work.

3) So the path must be a complete address.

4) <!-- #include file="..."> and <!-- #include relative="..."> do not allow complete addresses, all paths must be relative.

5) So I have to read in the subroutine file via a different method.

6) The MSXML2.ServerXMLHTTP object will read the contents of the remote file that I want and execute them. (if I have a subroutine and a call to that subroutine in the remote file, it will execute.)

HOWEVER - I CANNOT CALL THE SUBROUTINES IN THE ORIGINAL PAGE.

My original page is treating the subroutines as if they do not exist. No errors, but no execution.

**And this is where I'm stuck.

Thanks.
May 6 '09 #7
jhardman
3,406 Expert 2GB
@liz0001
this is also not an ASP issue, but a server issue. It is the server that maps different directories to different websites. If you just made directories from the command line there is no reason an ASP page wouldn't recognize all of them as being in the same website. That said, I am aware that dreamweaver's implementation of ASP would separate each directory into its own website, and there are probably other programs that do that as well. If you don't have direct access to the server than there isn't much you can do about that, but I have done that type of thing many times.
2) Therefore using any sort of relative path shouldn't work.

3) So the path must be a complete address.

4) <!-- #include file="..."> and <!-- #include relative="..."> do not allow complete addresses, all paths must be relative.

5) So I have to read in the subroutine file via a different method.

6) The MSXML2.ServerXMLHTTP object will read the contents of the remote file that I want and execute them. (if I have a subroutine and a call to that subroutine in the remote file, it will execute.)

HOWEVER - I CANNOT CALL THE SUBROUTINES IN THE ORIGINAL PAGE.

My original page is treating the subroutines as if they do not exist. No errors, but no execution.
for a real server-side include the include needs to be pulled up by the server BEFORE the asp is executed. that's why what you are trying to do won't work, you are pulling the text of the file in with ASP instead of before. This would be a terrible security risk, but you could theoretically open both files (the include and the asp file) in a separate asp page and merge them on the fly, then redirect to the newly merged file. This would accomplish the same thing as the include: the include file is accessed and linked to the asp page BEFORE the asp is run
**And this is where I'm stuck.

Thanks.
Without more details it is hard to give better suggestions, but I am inclined to say that it sounds like a job for a web-service.

Jared
May 6 '09 #8
GazMathias
228 Expert 128KB
4) <!-- #include file="..."> and <!-- #include relative="..."> do not allow complete addresses, all paths must be relative.
To reiterate:

Setting Enable Parent Paths in IIS will allow the use of "../"

Gaz
May 6 '09 #9
liz0001
26
THANK YOU!! I was able to enable the parent paths and include the files!!
May 6 '09 #10
Denburt
1,356 Expert 1GB
Very nice glad you've got it. If there is anything else we can do we'll be here.
May 6 '09 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Fred the man | last post by:
Hi, Some of our customers have remote offices. I was wondering if it'd be safe to have a DBMS running at their central office, and have our client application running on hosts in the branches...
1
by: Dan Levy | last post by:
I have a query of the kind brains of this group. Is it possible to access a microsoft sqlserver database (for select, insert, update, delete, and for miscellaneous administrative actions such as...
3
by: prodirect | last post by:
Hi all, I hope someone can help me. I've recently created a database and wanted to put it up on an ftp sight so that multiple people could access the same tables at the same time from different...
7
by: David Laub | last post by:
I've also posted this issue to a Sun/java formum, but since it appears to be an integration issue, this may be the better place to posr: I have written a dot net/c# Web Services doesn't fully...
3
by: sam | last post by:
hello all, i am currently in the process of planning a piece of software to model polymerisation kinetics, and intend to use python for all the high-level stuff. the number-crunching is...
0
by: KAData | last post by:
I have a program that will access remote stored procedures via visual basic.net application. I have SQL Server Management Studio Express (2005) installed on the client computers that will be...
1
by: Jerim79 | last post by:
Probably an incredibly simple answer, but I can't seem to phrase it so a search engine can understand it. I have a php script with a simple include: include("/include_this.php") I need to...
1
by: abhijity | last post by:
How to insert subroutines of c in fortran?
12
by: helveticus | last post by:
I'm in the process of finalizing my site. I spent quite a bit of time designing content pages and would like to cut on development time by simply managing the DB (SQL server, evt. MySQL) via MS...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.