Deploying a wcf web service - wcf

I am new to web services. I have successfully created my WCF web service, now I want to consume it. The client to consume this is on a different machine. I am using Visual Studio 2012. The service that executes a stored procedure in SQL Server 2005.
How do I proceed to make the other party test the service?

you will have to add service reference to the service by right clicking your client application.

Related

Remote debug WCF services running under a custom IIS account

I want to remote debug an WCF service. The application pool that hosts the WCF service runs under an custom account. The custom account is a domain account.
In the 'Attach to Process' window in Visual Studio 2012 I have checked 'Show all processes from all users' but it only shows WCF services that are hosted under a built-in IIS account (like NETWORK SERVICE, etc.).
How can I remotely debug this service?
Assuming you've gone through this https://msdn.microsoft.com/en-us/library/y7f5zaaa.aspx, you may need to go through this https://msdn.microsoft.com/en-us/library/9y5b4b4f.aspx
HTH!
You are not seeing because it is not hosted in your application. You have to host the Remote WCF Service first. Add Service reference to add WCF to your app. Then right click WCFService.svc file to view WCF Service in browser to start the service. It will now be available to you and you can Attach the process.

Developing Windows service using WCF

I have one requirement.
In our company each employee will submit some standard reports using internal portal.
If some employees not submitted report end of the day manager should get notified list of employees not submitted report.
I am using SQL Server database in which one table maintains records the employees submitting reports.
For this i want to use WCF client service.
This service will be installed on the server and client service should send email to Manager at specific time whoever not filled reports.
I know this is very basic requirement and i can do in Windows service. But I want to implement using WCF client service.
Can anyone help me how to do this task using WCF. And can you please refer some links.
I think you want to host the wcf service in windows service instead of IIS.
var serviceHost = new ServiceHost(typeof(YourService));
serviceHost.Open()
Open the service host in the onstart method of windows serice and close on onstop event. And copy the wcf config from wcf service project to windows service project and comment the configuration from wcf service project.

got EndpointNotFoundException when consuming WCFService in A webrole from B webrole

I have a webrole for hosting a web application, and another webrole for hosting a WCF service. Now I have got my WCF service webrole published on windows Azure, but the webrole with web application is not since I am still developing it. Then when I try to consuming the WCF service which has published on cloud in the web application, it gives the error:EndpointNotFoundException, the inner exception is remote server is not found.
But actually, I can comsuming the WCF service in a web application which is not a Azure project. so is it because web application in one webrole can't consume WCF service in another webrole?
It should be able to as long as they both aren't in Azure. At that point you will need an InternalEndpoint instead for them to communicate through. Did you add it as a web reference in Visual Studio and that worked correctly? Can you browse to the WCF service from the browser and see it? My guess would be that it has the wrong port, maybe you just manually updated the reference after publishing it to Azure.

Can the SQL Server Service Broker converse with a service in a web server (IIS) application?

Is there any way to communicate to application components within the Web Server. My application is made up of a Web Application on IIS 7.0 and a database on SQL Server 2005. I have several satellite services that are poling the database, and I am wanting to replaces these with web services that are triggered from the SQL database itself.
Can the Service Broker do this? Can it send start a conversation with a service within the web server (i.e. an ASP.Net page, a web service, or even a WCF service)?
Edits:
Is there any way that SQL server can call a web application component (i.e. web service, ASP.Net page. etc...). I need to know.
Yes, in the form of "Query Notifications" which builds on Service Broker
I haven't done it myself but this page on MSDN shows you a few options and further link
"Query Notifications in SQL Server (ADO.NET)"
As I understand it, there is no direct Service Broker API and it's done via SQL commands.
Hence the use of SQLDependency or SQLNotificationRequest in .net not Service Broker directly. This article explains more http://javiercrespoalvez.com/2009/03/using-sql-service-broker-in-net.html

Consume WCF Service Hosted in a Windows Service

I wrote the WCF Service and hosted in windows service. I need to know how to consume this windows service in my client application.
Note:
I wrote Net pipe binding service.
Edit:
How can I write the client application for net pipe binding?
You need to do a few easy steps:
start your Windows service hosting your WCF service
from within Visual Studio (2008 or higher), right-click on a project node in the solution explorer and choose "Add service reference"
enter the URL where your service can be reached
That's about all there is, really. Visual Studio will go to your running service, get all the metadata it needs (assuming you've enabled a MEX endpoint for metadata exchange), and will create a client proxy class for you to use to connect your client to your service.
Marc
you need to use ChannelFactory to create a proxy, and then you can use the proxy to perform wcf tasks.
ChannelFactory<IWCFService> pipeFactory = new ChannelFactory<IWCFService>(
new NetNamedPipeBinding(),
new EndpointAddress("net.pipe://localhost/PipeWCFService"));
IWCFService pipeProxy = pipeFactory.CreateChannel();
pipeProxy.RunWCFServiceMethod();}
http://www.switchonthecode.com/tutorials/wcf-tutorial-basic-interprocess-communication
You can consume it like any other WCF service. The method used for hosting the WCF service is not relevant to the client side.
If you need details on how to actually build the client, let me know and i'll update the post.
Edit : Start here to learn how to build a WCF client.