|
-
Feb 5th, 2008, 10:50 AM
#1
Thread Starter
Fanatic Member
Web Service in a sub directory
Ok I've created a web service and I've published the web service so that i have a precompiled app file. And on the server, I've created an IIS virtual directory called \ws\.
When i have the service in the root directory, i can access the .asmx file and run the service just fine, but when i drop it down to the sub directory (\ws\AssociatesWebService) i get an error.
Code:
Server Error in '/WS' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not create type 'AssociateInformation'.
Source Error:
Line 1: <%@ WebService Language="vb" CodeBehind="/bin/App_Code/AssociateInformation.vb" Class="AssociateInformation" %>
Source File: /ws/AssociatesWebService/AssociateInfo.asmx Line: 1
I'm assuming that i could turn this sub directory into another virtual directory but i'd rather not have to do that every time i have a new web service to deploy. Is there anyway around having to do that?
Thanks S_M
Last edited by space_monkey; Feb 5th, 2008 at 10:54 AM.
Using VB6 or VB.net 2008 with .net 3.5
"Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad
-
Feb 5th, 2008, 01:31 PM
#2
Re: Web Service in a sub directory
I'm assuming you, effectively, moved everything into the sub-directory - including the App_Code? If so, the issue is caused by the fact that the CodeBehind attribute is directing ASP.NET to load a type from the application root's bin/App_Code directory.
Try changing the CodeBehind attribute to include your sub directory's path, i.e. /ws/AssociatesWebService/bin/App_Code, or move the code [AssociateInformation.vb] to the application root's bin/App_Code folder.
-
Feb 5th, 2008, 01:57 PM
#3
Thread Starter
Fanatic Member
Re: Web Service in a sub directory
 Originally Posted by axion_sa
I'm assuming you, effectively, moved everything into the sub-directory - including the App_Code? If so, the issue is caused by the fact that the CodeBehind attribute is directing ASP.NET to load a type from the application root's bin/App_Code directory.
Try changing the CodeBehind attribute to include your sub directory's path, i.e. /ws/AssociatesWebService/bin/App_Code, or move the code [AssociateInformation.vb] to the application root's bin/App_Code folder.
Yeah everything got moved, and you're correct the issue is caused by the asmx page pointing to the root application directory. If i move the bin folder up everything works fine.
Will there be problems if i try to use this root directory to hold other web services? Seeing as how the name for the bin folder and the sub files are all the same, figure that they will overwrite each other. I had the thought that i could version the dlls differently for each individual web service but what kind of hell would that cause for the poor guy who works on this after me.
I also tried providing the proper path for the codebehind but i still received the same error. I tried several versions but none seemed to work.
Code:
<%@ WebService Language="vb" CodeBehind="/ws/AssociatesWebService/bin/App_Code/AssociateInformation.vb" Class="AssociateInformation" %>
<%@ WebService Language="vb" CodeBehind="~/ws/AssociatesWebService/bin/App_Code/AssociateInformation.vb" Class="AssociateInformation" %>
<%@ WebService Language="vb" CodeBehind="~/AssociatesWebService/bin/App_Code/AssociateInformation.vb" Class="AssociateInformation" %>
Using VB6 or VB.net 2008 with .net 3.5
"Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad
-
Feb 6th, 2008, 01:28 PM
#4
Re: Web Service in a sub directory
Seems you could also use sub-directories within the App_Code folder: http://dotnetjunkies.com/QuickStartv...ages/code.aspx
-
Feb 6th, 2008, 02:09 PM
#5
Re: Web Service in a sub directory
Why not just have the ASMX's codebehind with the ASMX? The app_code folder is meant for classes, so you can move your logic out into classes there, but leave the rest alone.
-
Feb 6th, 2008, 03:22 PM
#6
Thread Starter
Fanatic Member
Re: Web Service in a sub directory
Its seems like the default codebehind for the webservice is stored as a class in the app_code (just .vb) rather than as an asmx.vb file....
Using VB6 or VB.net 2008 with .net 3.5
"Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad
-
Feb 7th, 2008, 06:19 AM
#7
Re: Web Service in a sub directory
How odd, I can't seem to replicate that. Tried it on VS 2005/2.0, unless the OP is actually using something else.
-
Feb 7th, 2008, 08:33 AM
#8
Thread Starter
Fanatic Member
Re: Web Service in a sub directory
nope I'm using VS 2005/2.0 as well... When i get into work I'll take a look and see if i have some weird setting changed but i don't think i do.
Using VB6 or VB.net 2008 with .net 3.5
"Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad
-
Feb 7th, 2008, 08:59 AM
#9
Re: Web Service in a sub directory
Oh, you're the OP. That's probably the reason it's happening. 
(Keep us posted) (pun unintended)
-
Feb 7th, 2008, 12:30 PM
#10
Thread Starter
Fanatic Member
Re: Web Service in a sub directory
Here's what I've ended up with.
I went back to my web service solution and added a new web service item to it. When I was creating the web service, I unchecked the option that says "Place code in separate file". Soooo all my code is stored in the asmx file. In my \ws\ dir i place my asmx file into a sub folder and my classes in the app_code folder in the root directory. And everything works. Though I'm not sure i even need the sub directory now.
I don't know if I'm entirely happy with it but unless there is a reason not to do it or until i can figure out why my code behind is getting split off like it was; I guess I'll have to settle.
I appreciate the help.
Using VB6 or VB.net 2008 with .net 3.5
"Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|