views:

37

answers:

1

I've built a custom RoleProvider which uses an already existing datasource (from a web service) to dtermine roles. It's written in C#, and I want to be able to compile it as a DLL so I can distribute it to others within the organisation and they can use it too.

When compiling, how do I reference the web service?

Currently getting this error: SedRoleProvider.cs(4,15): error CS0234: The type or namespace name 'sedservice' does not exist in the namespace 'com.sed' (are you missing an assembly reference?) SedRoleProvider.cs(38,24): error CS0246: The type or namespace name 'SEDServices' could not be found (are you missing a using directive or an assembly reference?) SedRoleProvider.cs(40,24): error CS0246: The type or namespace name 'SEDServices' could not be found (are you missing a using directive or an assembly reference?)

Alternatively, is there a better way to accomplish what I'm trying to do? Only been at this C#/.Net/ASP.NET lark for a couple of months now.

A: 

Click right on your web site (or other) project and there is "Add Service Reference". Click on discover and it will list your service interfaces in your project.

Jan Remunda
This isn't part of a project, it's a standalone .cs file. Do you know how to use a web service reference from the csc.exe command line tool?
Jak
csc.exe is C# compiler and you can learn about this at: http://msdn.microsoft.com/en-us/library/78f4aasd.aspx But service reference is not like reference to another assembly. "Add Service Reference" in Visual Studio generates proxy client class and methods to your assembly with which you can handle the webservice. If you don't have Visual Studio, you can also generate this in console with wsdl.exe. http://my.execpc.com/~gopalan/dotnet/webservices/webservice_csharp_client.htmlBut your webservice must have published WSDL document.
Jan Remunda