|
-
July 13th, 2005, 01:31 PM
#1
Web Service asmx problem
hi all,
When I create a ASP.Net Web Service project in visual studio,it creates an asmx and asmx.cs(code-behind) by default apart from some other files.
The class inside asmx.cs inherits from System.Web.Services.Service.But if i make changes to the class to inherit from my custom class(clsCustom) instead of System.Web.Services.Service,the designer view(asmx file) throws an exception saying 'could not create an instance of the class clsCustom'.
Anybody has any idea?Thanks in advance.
CafeDreamz.
-
July 13th, 2005, 08:30 PM
#2
Re: Web Service asmx problem
Since .NET CLR allows only single-inheritance, you need to have your custom class to inherit from System.Web.Services.Service and the code-behind class to inherit from that custom class
-
July 13th, 2005, 09:11 PM
#3
Re: Web Service asmx problem
If you do not want any UI objects in your web service u dont have to derive from System.Web.Services.WebService. if you do not derive from this class the web service designer is of no use.
Try deriving your custom class from System.Web.Services.WebService, the designer should load correctly.
There has been an alarming increase in the number of things I know nothing about .
-
July 14th, 2005, 08:15 AM
#4
Re: Web Service asmx problem
My custom class is deriving from System.web.Services.WebService.But still the designer doesnt work.Any ideas?
Thanks in advance.
CafeDreamz
-
July 14th, 2005, 08:18 AM
#5
Re: Web Service asmx problem
The designer needs an parameterless public constructor for displaying.
Useful or not? Rate my posting. Thanks.
-
July 14th, 2005, 08:56 AM
#6
Re: Web Service asmx problem
There is a paramterless contructor.The problem is that the designer is not able to recognise my custom class like it does the built in classes(like System.Web.Services.WebService).Maybe I need to place the assembly containing my custom class in the GAC or some other location for the designer to recognise it.Any ideas?
Thanks.
CafeDreamz.
-
July 14th, 2005, 09:45 AM
#7
Re: Web Service asmx problem
Identify the code generated by the studio in the asmx.cs . Copy the same into the custom class that you have and u will be good to go.
There has been an alarming increase in the number of things I know nothing about .
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
|