Geting net.tcp not supported when adding service reference - wcf

i have hosted my WCF service in IIS and have following endpoints configured
<endpoint name="MainService" contract="Docs.ICalculatorService" address="http://localhost:49495/WcfService1/service.svc" binding="wsHttpBinding">
</endpoint>
<endpoint name="MainTcpService" contract="Docs.ICalculatorService" address="net.tcp://localhost:49496/WcfService1/service.svc" binding="netTcpBinding">
</endpoint>
i have hosted my WCF service on port no 49495 which is real ,
now i have configured another endpoint which is using port no 49496
do i need to host this WCF service on another port 49496 or i am missing something
getting this error when looked in stack trace
The ChannelDispatcher at 'net.tcp://localhost:49495/WcfService1/service.svc' with contract(s) '"ICalculatorService"' is unable to open its IChannelListener
i have configured Endpoints and Configured Bindings in IIS 7
but now i am getting a new error
You have tried to create a channel to a service that does not support .Net Framing. It is possible that you are encountering an HTTP endpoint.**

As shabulator says, you need to enable the non-http service activator.
In case this isn't clear to anyone stumbling across this, this is a Windows feature you need to switch on.
On Windows 7 (Server 2008 will be similar) under Control Panel -> Programs you will see "Turn Windows features on or off". This brings up a dialog as the one shown.
Under Microsoft .NET Framework 3.5.1 tick the two boxes to install the features.
When I did this, it had the side effect of putting .NET 3.5 onto the server, which I didn't want as I was using a later version.
If this happens, open a command prompt and go to the .NET 4.0.30319 folder and run the aspnet regiis tool.
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -iru

Related

Why can't I browse to my WCF service in Windows Server 2012?

On any other operating system, if I browse to my WCF service in the browser, I can see information about that service. In Windows Server 2012, I get no information about the service, and it even acts as if there's nothing there at that address. I can still access the service from a client, but I had to add a server feature just to make it work (.NET Framework 4.5 Features -> WCF Services -> HTTP Activation).
Browsing to the service is normally a quick way to make sure that the service is running, but it's a slight annoying that I no longer have this luxury. Does anyone know how I can get Windows Server 2012 to show information about my service when I browse to it?
Make sure your services' configuration or code modifies the default behavior to enable metadata to be published:
How to: Publish Metadata for a Service Using a Configuration File

.Net 4.5 WCF Error 404.3 on IIS 7.5

I deployed a MVC4 web application including a wcf service.
when i try to browse to the .svc file i receive Error 404.3 (Error Code 0x80070032).
I tried all the relevant answers i read:
1. adding a .svc mime
2. checking that the server's ISAPI filter include ASP.Net 4 bothe 32bit and 64bit.
3. checking that Server Managers Features include WCF Activation.
I already have a MVC3 web application with WCF service running on the same server.
Can you please point me to what can cause this problem?
I noticed that on IIS Manager in Handler Mapping there is a difference between the two domains running the applications. the working one is almost empty (include only StaticFile) while the new one has a long list of handlers enabled (I don't know if it is relevant or not).
Thank You!
I had to tick "HTTP Activation" in "Add Role Services" within Windows Server 2012.
Run command aspnet_regiis -iru in command prompt as an admin and try again.
Make sure the two WCF services are not running on the same port -- that is, you are not connecting to the MVC3 WCF service. See How to consume multiple WCF services from one client for how to do this.

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 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.

No intropage in a Managed Windows Service

I have to do some maintenance on a WCF service that is hosted in a managed windows service.
In the old deployed version I can enter: http://localhost:9091. It shows a page with info about the hosted WCF service (with a C# and VB example).
When I get the sources from TFS and reinstall with the MSI, the same http://localhost:9091 gives a 404.
What could be wrong ?
Could be lots of things. Try these for a start:
Installed msi on wrong port
web site / app pool not runnig
the configuration in web.config does not match the new location
Web site not marked as asp.net 2.0
IIS not configured to recognise svc files
The last 3 are the most probable. Check the event log for more details.
Here are a few more based on the comment:
is the service started
is the port blocked on the new machine
the configuration in web.config does not match the new location
Perhaps that port is meant to be the port of the ASP.NET Development Server. Is the service started? Open the solution in Visual Studio, right-click the service and choose "View in browser". That will have the side-effect of starting the service.