GIVE-ME-CHICKEN
GIVE-ME-CHICKEN

Reputation: 1269

How do I publish web service via visual studio?

Need to deploy a WCF web service to Windows Server 2012 R2.

I was hoping to:

  1. Publish it to a file.
  2. Copy the files over to the web server.
  3. Run the service on the web server.

Steps I have done:

  1. I have opened the web service via Visual Studio 2013 and right-clicked it and selected Publish.
  2. I specified the location to publish this application to the file path of where I want the files to go.

Then the next step is 'How will users install the application?' I have 3 options available:

  1. From a Website
  2. From UNC path or file share
  3. From a CD-ROM or DVD-ROM

I am confused as to what these mean? And what values I should be entering for any of them?

A web application will call this web service and then the web service handles the database calls and returns the results to the web application. Do not know what exactly needs installing?

I have searched the internet but unfortunately it has not helped me. I need some layman-term explanation how to get the web service files over to the web server.

Edit: Windows Server 2012 R2 does not have IIS installed. Web services are still able to run on it.

Upvotes: 2

Views: 7476

Answers (1)

Aman Sura
Aman Sura

Reputation: 256

  1. Open WCF in Visual Studio
  2. Publish the site to a path ( as u mentioned correctly )
  3. This will create a bunch of files in the folder you selected.
  4. Copy these files manually to your Windows 2012 Server
  5. In IIS, on Windows Server, 'Add a new Website'. Assign any port, say 2000.
  6. Point the website to physical location where you just copied the files in step 4 above.
  7. Now you run the Website on IIS ( Note to select the correct .NET Version )
  8. External world can access your WCF as http://your.server.ip.or.name:PORT/yourservicename.svc
  9. Running this URL in browser will open up a page on browser. If it reports no error, then its good to go.
  10. Websites can consume your WCF using this URL ( in Vsual Studio By adding a ServiceReference in their projects ).

Upvotes: 1

Related Questions