How to convert a Console WCF console application to a Web Service

I would like to convert a WCF Server Console application to a web service and Install that service on IIS 7. I have written a small VB.net WCF console application which listens for a string and returns a string. The code can be seen in my  previous questoni . This runs great on my development workstation.

I would like to convert this code to a web service. Once converted, it has to be installed on a server running IIS 7. After the installation, I will need to test it.

How do I:
1. Convert the code to a web service.
2. How do I install the web service so that it is started at the same time the web site is started or restarted.
3. How do I test the web service?

Thanks,
pat
mpdillonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MlandaTCommented:
1. Convert the code to a web service.
WCF allows you to host your service in either IIS (Internet Information Services) OR to self-host. You are currently self hosting. You can self-host in a Windows Service or Console Application or whatever other container you choose. In light of your Item 2, I would suggest hosting the WCF service in IIS. I find it easier to create a new project in VS and choose the approriate template.
Pick the right templateThis creates a project that allows you to create your service and host it in IIS (if you still need the console self-host as well, you can put the service contracts and all that into a class library and reference that library from both the console app and this new IIS hosting web app). Creating the service is exactly the same. You need your contracts, the actual service and all that. When you create the WCF project in Visual Studio, you will find that it will already contain a  service contract and service example. You could just customise this if you choose.

3. How do I test the web service?
When hosting in IIS, you can access the service via HTTP. It will look like http://localhost:59004/Service1.svc (default, using IIS Express) or you can change that to use the full IIS (better, http://localhost/myService/Service1.svc). To test, you create a seperate project (which will be the client) and you add a Service Reference. Giving it the URL to the service. If using the same solution in Visual Studio, you can click on the Discover button. You will then be able to call the service as i showed you earlier (in that other question).
mpdillonAuthor Commented:
I apologize for not responding sooner. I am only able to work on this project on Tuesdays.
Now I realize I should have split this question. I will only try to resolve the creation of the web service hosted in IISExpress and the testing of that web service in this question. I will create a new question for moving the files to the production IIS.

I created a new web service application in Visual Basic 2013 in a new folder. I added the Service Contract and the Service from my other project. I deleted the Service1 and its contract which were created with the NEW project. I did not change anything in the Web.Config file that was created as part of the new project.

Is there anything else I needed to change after creating a new WCF Web Service Application, Copying the classes from the other project and deleting the two Class that were created with the new project. See below for an image of my solution.
WCFWebServiceApplication.png
I tried to Create a Service Reference in the original Test client I had created. I was not successful. I started the new web service application, Internet Explorer was the button caption rather than Start. In the client test app, I selected Add Service Reference. The usual application appeared.
WCFClient.png
When I entered a web address, the Add Service Reference could not find that address. What am I doing wrong?
thanks,
pat
MlandaTCommented:
You need to specify the full path of the Web service... Right up to the .wcf extension.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

mpdillonAuthor Commented:
The Customer rescheduled me to Thurs. I will test this in the morning. Thank you.
mpdillonAuthor Commented:
I have rebuilt the project. I do not see any .WFC files. I looked in all the folders. Thus I cannot give the path to them. Why am I not seeing a WCF file?
No-WCF.png
mpdillonAuthor Commented:
Never quite got it to work. I appreciate the effort.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.