Reputation: 521
How do I invoke or start a asp.net web service (asmx) from another project in C#. The another project can be a console application. I am not asking to consume the web service (which I am doing in Java) but how to start the web service in C# but from a different project.
I already tried including the webservice project in my console application project and also added a reference to the webservice project, included the namespace but I get an error,
The type 'System.Web.Services.WebService' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
I am trying to invoke the webservice by creating an instant of the webservice class which I guess is already a wrong way.
Thanks in advance!
Upvotes: 1
Views: 2049
Reputation: 2882
You are going to want to add a web reference.
How to: Add a Reference to a Web Service
Then you are going to want to set multiple projects to start. This will allow you to debug both.
How to: Set Multiple Startup Projects
Upvotes: 4