Running XML Web Service from IIS Virtual Directory without creating application

B

Ben Fidge

How do you run an XML Web Service from within an IIS Virtual Directory
without creating an application.

According to Microsoft you can do this, but I get the following error
when I try to access my Web Service:

Description: An error occurred during the processing of a
configuration file required to service this request. Please review the
specific error details below and modify your configuration file
appropriately.

Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This
error can be caused by a virtual directory not being configured as an
application in IIS.


Any ideas?

thanks

Ben Fidge
 
J

Juan Wajnerman

That is a problem with any configuration section you
placed inside the Web.config, that can be only defined in
machine.config or in an application directory inside IIS.
Look at the source error for more information. For
example, the section "autentication" cannot be placed
inside a Web.config file that isn´t placed in a IIS
application directory.
 
B

Ben Fidge

Juan,

Thanks for your help. Altough this resolved that
particular problem, I still can't run my Web Service from
a plain virtual directory.

After removing the <authentication> and <sessionState>
elements from web.config I'm noe presented with the
follwoing error:


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 'BackupContent_WebService.BackupContent_Service'.

Source Error:


Line 1: <%@ WebService Language="c#"
Codebehind="ContentBackup.asmx.cs"
Class="BackupContent_WebService.BackupContent_Service" %>


Can you shed any light on this? When I temporarily make
the virtual directory into an IIS Application, everything
runs as normal and the Web Service can be instantiated as
expected.

Thanks

Ben
 
D

Dino Chiesa [Microsoft]

Seems to me the ASPX parser is trying to resolve the type
BAckupContent_WebService.BackupContent_Service

This sort of thing is normally provided in a DLL, which is in the bin dir of
the app.


--
Dino Chiesa
Microsoft Developer Division
d i n o c h @ o n l i n e . m i c r o s o f t . c o m

Juan,

Thanks for your help. Altough this resolved that
particular problem, I still can't run my Web Service from
a plain virtual directory.

After removing the <authentication> and <sessionState>
elements from web.config I'm noe presented with the
follwoing error:


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 'BackupContent_WebService.BackupContent_Service'.

Source Error:


Line 1: <%@ WebService Language="c#"
Codebehind="ContentBackup.asmx.cs"
Class="BackupContent_WebService.BackupContent_Service" %>


Can you shed any light on this? When I temporarily make
the virtual directory into an IIS Application, everything
runs as normal and the Web Service can be instantiated as
expected.

Thanks

Ben
 
C

Chris Botha

By default the DLL file must be in a folder called "bin" in the root of the
IIS Application. Backtrack from the virtual directory to the folder which is
the root of the app (which may be wwwroot I guess), create a "bin" folder
there, copy the DLL to that folder and it should work.

Juan,

Thanks for your help. Altough this resolved that
particular problem, I still can't run my Web Service from
a plain virtual directory.

After removing the <authentication> and <sessionState>
elements from web.config I'm noe presented with the
follwoing error:


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 'BackupContent_WebService.BackupContent_Service'.

Source Error:


Line 1: <%@ WebService Language="c#"
Codebehind="ContentBackup.asmx.cs"
Class="BackupContent_WebService.BackupContent_Service" %>


Can you shed any light on this? When I temporarily make
the virtual directory into an IIS Application, everything
runs as normal and the Web Service can be instantiated as
expected.

Thanks

Ben
 
B

Ben Fidge

Chris,

Thanks for your help. I have got my web service running using what you
suggested. However, as my client (UK National Health Service) is running
their sites from a co-hosted server, I wanted to run my web service from
within it's own virtual folder just to keep it seperate from the main
application(s) (the web service is not acutally part of the application).

Thanks a lot,

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top