Post deployment task for WCF service - c#

Is it possible to run a post-deployment task (lets say a piece of code) immediately after the WCF service is deployed on IIS? I am using Visual Studio publish method to deploy the service.
Thanks

Related

Deploy a WCF workflow service Application

I have created a "WCF workflow service Application". as of now, i press F5 and run the application. after which the service will be up and running. then i ping this service using SoapUI ( I have loaded the wsdl in the soapui)
How do i host/deploy this "WCF workflow service Application". ( I dont want to press F5 to up the service basically).
I have tried using this link.
But it is not related to "WCF workflow service Application"
First you have to publish the Service , you can try the following screens,for your reference check these links :
How to host wcf service in IIS 7 or 7.5
creating WCF 4.0 Service and Hosting in IIS 7.5

How to debug calls to ASP.NET web api in Visual Studio [duplicate]

I built a Web API service that's hosted locally on my machine in IIS. I have an iOS app that I'm running via XCode that makes the call to the web service. The connectivity is there, and works. The iOS app successfully makes the connection to my published web service.
The problem is my web service is returning a non descriptive error to the client (iOS), so what I need to be able to do is step through the web service code while running my iOS app.
So, in summary:
I run an iOS app via my MacBook, and it connects to my .NET Web API service.
My Web API service is published to my local IIS, and is returning an error back to the client.
Breakpoints aren't being hit in Visual Studio - do I need to attach my Visual Studio debugger to a specific process? I've tried running my web service in debug mode while running my iOS app, to no avail.
How can I step through my web service code when running the client app (iOS) that accesses the web service?
Attach to process - http://msdn.microsoft.com/en-us/library/vstudio/3s68z0b3.aspx
Make sure "Show processes from all users" is checked, and pick w3wp.exe
You may need to hit the service once first to make sure its started.
To debug an app that's hosted by IIS, you want to attach to process (in Visual Studio it's Tools->Attach to Process or Ctrl+Alt+P) and pick w3wp.exe from the list (you might have to check a few boxes for the process to show up).
Another option is to use our free VS Extension called Conveyor
https://marketplace.visualstudio.com/items?itemName=vs-publisher-1448185.ConveyorbyKeyoti
With it you open up IIS Express to remote connections on your network (or even the web through tunnelling).
Once you've done that you can debug the project directly from VS and connect to the Conveyor port number (or domain name via tunnelling) and debug as you would locally.
you can use Postman client.
First : run the API FROM visual studio
Second : go to postman put the url and add the parameter in body
More information : http://www.tutorialsteacher.com/webapi/test-web-api
this often works for me i generally list all of the processes in IIS with appcmd command
appcmd list wp
and pretty much you know which process to attach by seeing the names of the web services
if appcmd is not available please visit
Here for configuring this

Debugging WCF services : Multiple Startup project

My solution constists of -
WCF service hosted on Visual Studio Development server. (Port 8001)
Web Application consuming services. (Port 8002)
I use start multiple projects in debug mode in visual studio solution.
Starting with WebApp debugging, I set few break points in WCF service code.
Issue:
WCF services breakpoint is not being hit. Although the code executes fine & returns the response to UI (WebApp)
These work fine when starting WebApp & Wcf services using two different solution.
Any suggestions ?

Use WCF class library in application

I am new to WCF and I don't really understand the puropose of a WCF class library. (it does not look like a library to me it launches a program when I run my application) I have created a WPF application with a reference to my WCF service library. Everything works great under development. When I launch my application from visual studio the service get's hosted automatically by visual studio.
Now let's say I am ready to deploy. If I launch the application from outside visual studio then the service will not run. How do I start the service?
WCF service class cannot exist in a void. You need to host and there are a couple of option for Hosting.
In Visual Studio, there was two main template for WCF, WCF Service Application and WCF Service Library. Depend on your need, choose which template will be good for your project. If you want Self Hosting, better choose WCF Service Library template. (You need to write Hosting Service/Application). If you want to Host in IIS, better choose WCF Service Application.
And check this Tutorial for self hosting.
http://wcftutorial.net/WCF-Self-Hosting.aspx

wcf service application deploying issue

I am new to wcf. I have developped a wcf service application(not a library). Can someone tell me how to deploy it other than iis. And how to access the service as a webservice. is this possible and how?
This link has an example that shows how to deploy a WCF-service as a servicehost application.
This means it runs as a service and does not need to be deployed to an IIS-instance.
There is an automatic WCF deploy tool in Visual Studio or copy the code to the server.
The server will be access like through a website like http://localhost:2342342432342/YourWebService.Svc.
You have to get the references from the WS using a tool that generates all the classes for you and you use that service's classes to write your code.
If your intention is to deploy to to a server that does not use IIS for hosting, you could look at an alternative hosting application like Cassini.

Categories

Resources