DidierSanDiego
asked on
How do I consume a Web Service from a C# Library Project ?
Hello,
I have no problem consuming a web service from an ASP.NET Web Application project. I add a Web Reference and after that I can easily consume the web service and its methods.
Now if I want to create a C# Class Library Project to test my Web Service, how do I create a Web Reference to the service in order to consume it?
Thank you.
Didier
I have no problem consuming a web service from an ASP.NET Web Application project. I add a Web Reference and after that I can easily consume the web service and its methods.
Now if I want to create a C# Class Library Project to test my Web Service, how do I create a Web Reference to the service in order to consume it?
Thank you.
Didier
Here was what I did to fix my problems...
Apparently it was something dumb and easy... i deleted the app.config, settings, and those kinda files. Added the webservice and it worked.
Apparently it was something dumb and easy... i deleted the app.config, settings, and those kinda files. Added the webservice and it worked.
ASKER
Hello,
Thank you for your prompt reply.
I am unable to find a way to add a Web Reference from my project. How did you do this?
The only option I have is to add a Service Reference.
Didier
Thank you for your prompt reply.
I am unable to find a way to add a Web Reference from my project. How did you do this?
The only option I have is to add a Service Reference.
Didier
Add System.Web.WebServices to your project as a reference, maybe System.EnterpriseServices also... I got that as a reference, but I don't remember why... It could be anything.
Then you might want to make sure that show all files icon is selected in the solution explorer
Then you might want to make sure that show all files icon is selected in the solution explorer
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
don't know... I use 2008, but I have to use 2.0 framework still for older computers.
i just add system.web.servservices to my project, and then i add a web reference.
Or I might have just added the web reference, and then it brought in all those other references.... Hard to remember, I do web services so little.
i just add system.web.servservices to my project, and then i add a web reference.
Or I might have just added the web reference, and then it brought in all those other references.... Hard to remember, I do web services so little.
ASKER
Thank you very much for the help.
Didier
Didier
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ServiceEmailer.Emailer objEmailer = new ServiceEmailer.Emailer(); from class library... I had added the web reference to the class library.