testing WCF services on server - wcf

I'm trying to test my net.tcp binded wcf service on my server machine, the service cannot be accessed from outside, does anyone know any tool that can be helpful to call my service on server 2008 machine?

Host the service in IIS. You can test the service using Integration Tests by adding the service Reference (net.tcp://localhost:8000/WCFTestService) in your test project.
Read this.

Related

How to host wcf server on application ?

I know how to make wcf service server to run on iis.
But i need to host my wcf server on something like iis but the service will be available only when my application is up and running.
I know that it is possible to create application that will act like a wcf host.
But in this case i will not have the access from other machine ( right ? ) to this service because as far as i know .. the access to this service from other machine can be done only when the wcf service is running from iis.
Any help please ...
10x
Hosting WCF service has three different types:
Hosting in IIS
Hosting in Managed Application
Hosting in Windows Service
But in this case I will not have the access from other machine ( right
? ) to this service because as far as I know .. the access to this
service from other machine can be done only when the WCF service is
running from IIS.
If you thought that only the WCF service hosted in IIS is accessible outside that machine where service is hosted. You are completely wrong. As long as your service is up and running and your machine has Public IP address you can access it every where.

wcf service on windows 2003 server - works as server but not as a consumer/client

It is a very simple wcf service. Since my original wcf service didn't work there I decided to create one test service. Basically I'm using the default method GetData(int).
I hosted this service on windows 2003 server. It works well when I consume it from a different machine. I use a windows forms test application to consume this service. When I run this forms app on the same ws2003 server and attempt to consume the service on the same server it throws the following error:
There was no endpoint listening at http://...
I created another wcf client using asp.net, also silverlight, nothing works.
Basically, it looks like it can't consume any wcf service.
I couldn't figure out what could be the issue.
Basically, the machine had McAfee antivirus installed and was blocking http communication to aspnet_wp.exe.
The full path is c:\windows\microsoft.net\framework\v4.0.30319\aspnet_wp.exe
Everything works fine after unblocking this specific exe.

Can windows managed service be a wcf client?

On 1st server, there is wcf service hosted in windows managed service. On the 2nd server, there is another wcf service, hosted in their own windows managed service. I try to connect to 1st service from the inside of the 2nd service, but I become a exception "The socket connection was aborted". With same configuration and same code I successfully connect from console application and winform application, but not from this windows managed service.
Configure your WCF services on both servers to perform diagnostic logging. Follow the instructions in http://msdn.microsoft.com/en-us/library/ms730064.aspx to achieve that.
Make sure the account your service on server 2 is running under is capable of connecting to server 1. This is a typical difference between the client test you did (and worked) and a service running on that system. For a test, make the service on server 2 run under your personal login credentials.

can I expose a WCF service from an application runing in visual studio(with F5, run)?

If I run a WCF application which exposes a service in visual studio, is it possible to consume the service from an asp.net application running on another computer? How can I determine the address of the WSDL published by the WCF service in order to add a reference to it in the ASP.NET application?
If your service is an ASP.NET application and you are hosting it with the built-in development server, refer to Kalus's answer. However, if you have IIS installed locally, you can reconfigure your project settings so that the application is hosted by IIS for debugging instead of the built-in development server.
If you are writing a standalone WinForms or Console application, then the responsibility will be on you to select an endpoint and binding, whereas with an ASP.NET application, those parameters will come from IIS or the Dev server (the protocol will always be HTTP/HTTPS, and the port number will be set by IIS or randomly generated by the Dev server). So in a standalone application, you will have to configure which binding (basicHttp, wsHttp, netTcp, etc.) and an appropriate hosting endpoint (http://hostname/MyService or net.tcp://hostname:port/MyService). But yes, if the service is hosted by a standalone application, it will be accessible from other computers.
Refer to this overview here: http://msdn.microsoft.com/en-us/library/ms731758.aspx
According to #Kent Boogart's comment below, the asp.net development server can only be used for local requests. So you will need to configure your web service to run in IIS if you want to call it from another machine.

Deploying a TCP based WCF service, that's hosted in a Windows service

I've finished writing a WCF service that uses TCP. It is meant to run on a Windows 2003 Server, which doesn't have WAS available, so I've written a Windows service to host my WCF service. It works great on my development machine.
Now, how do I get these two services onto the Windows 2003 Server? Do I just copy the WCF service there and that's it? I would think it would probably be best if I put it into some specific location, but where would that be? And then the hosting Windows service, how do I deploy that to the Windows 2003 Server?
You should have a service deployment project that you've used in the Dev area.
It will be the same technique.
Example of creating a service in c# from codeproject
put it in program files\Your Service