No intropage in a Managed Windows Service - wcf

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.

Related

Can MDS only be installed on a server

Can you run the SQL Server 2014 Master Data Services Configuration manager on windows 8.1 pro and not on a server like Windows server R2?
If so please help it tells me "The required .svc handler mappings are not installed in IIS." but I have checked and everything in the windows features under IIS is selected
The answer was a simple google search away.
You can run it on Windows 8.1 Pro.
Take a look at this link for several troubleshooting help:
SVC_Handler_mapping_error_in_MDS_Configuration_Manager
SVC Handler mapping error in MDS Configuration Manager
When you configure Master Data Services in the MDS Configuration
Manager, you may encounter an error indicating that the required .svc
handler mappings are not installed in IIS.
Before creating an MDS web application, you must correct the following
errors:
Internet Information Services (IIS) is not configured on this server.
The required .svc handler mappings are not installed in IIS.
This can occur in one of the following instances: IIS may be missing the necessary .svc Handler Mappings. Visit IIS Manager from
the start menu. If you have a default website listed, click the site,
and click Handler Mappers icon. In the list, sort by Path column.
notice if *.svc is listed or not. If it is already listed, this error
may a false positive, but if it is not, you may need to install the
*.svc path mappers in Step 2 & 3 below.
Depending on the IIS version, there are different ways to get the
Service Mappers installed. For .Net 4.0, the mappers may need to be
installed by installing HTTP activation in .Net Framework 4.6 Advanced
Services. From the start menu search or control panel, find the item
Turn Windows Features Off or On. then in the tree of Windows Features
find .Net Framework 4.6 > WCF Services > HTTP Activation
On earlier Windows versions where .Net Framework 4.0 does not come
preinstalled, when you add or install IIS features after .NET 4 was
installed, you may encounter this error. To fix this issue, open a
command prompt and go to the .NET directory (for example
%windir%\Microsoft.NET\Framework64\v4.0.30319). Run the command:
aspnet_regiis -i.
You may encounter this error as a false positive or false negative
when there is an existing IIS website(s) already existing in your IIS
server, but you select a different Web site to host MDS, or when you
select a Web site other than the first Web site listed. This can
happen in following two ways: Service handlers are not installed on
the first Web site that MDS is not attached to, but are installed on
another Web site that MDS is attached to. MDS will post an error
because it looks at the first Web site, not the second Web site. This
is a false negative, in that the error message indicates that the
handler mappings are not made, whereas they actually are. In this
case, you can ignore the error and proceed. Service handlers are
installed on the first Web site that MDS is not attached to, but are
not installed on another Web site that MDS is attached to. MDS will
not post an error because it looks at the first Web site, not the
second Web site. This is a false positive, because the lack of handler
mappings will cause MDS not to work. You should install the handler
mappings for the Web site that you are attaching MDS to.

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

How do I configure Visual Studio to see a net.tcp URL on local IIS?

I've got a WCF service using the netTcpBinding, and no other binding. It works great when I manually deploy the files to IIS, and my client application can consume the service when I enter the net.tcp://localhost(etc) url. Now I'm trying to get the project to run in Visual Studio, so I can have the service and client in the same solution, and reference the service directly instead of going through IIS, and having to redeploy files manually.
Neither IIS Express nor the Visual Studio Development Server can use net.tcp, so they're out. In the Web tab of my service project, the "Use Local IIS Web Server" or "Use Custom Web Server" looked like good options, but neither of them will accept a URL that doesn't begin with http.
Is there some way of making my WCF service use IIS, and having my client reference the service directly (so that I don't have to deploy files to IIS, and then update service reference, every time I compile)?
Start the service in WcfSvcHost, then try to add a reference to the hosted URL.
Unfortunately, the VS IDE has no technique to start services automatically, except for when you're debugging.
Also, you always need to update service references explicitly. You need to decide which of your changes are ready to be applied to which clients of your service. It would be bad to assume that all clients should be updated as soon as you make a change then compile your service.
You could add a project, which you don't deploy, but only use during development, that self-hosts the service.

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.

WFC SVC File emits HTML when called from a service client

I'm in the process of deploying a WCF service application. The service works fine if it's running as its own site, but the intention is for the service to run as a virtual directory of the Default web site of the server. When I set the service up in this configuration, I get an odd problem. When the client tries to make a service call, it receives the HTML of the friendly service description, not SOAP. Naturally this generates a service error. The HTML appears to be identical to the service page that you see in a browser with an HTTP Get, but I'm only seeing the first 1024 bytes in the error message, so I may be missing something.
I've checked HttpHandlers and loaded assemblies, and as far as I can tell there's nothing unusual that is being inherited by the virtual directory. The default site has 3 ISAPI Filters installed including Outlook Web Access (yes, this server is running Exchange). I tried installing these filters in my test web site, but it still ran the service without problems. The problem only happens with the service is running as a virtual directory of another virtual directory within the default web site.
The server is Windows Small Bus Server 2003 SP 2 running IIS6.
If you're hosting WCF in IIS you need to set the server up in the 'Application Role' check out the following link does that help:
MSDN: Internet Information Service Hosting Instructions