Cannot access WCF service in IIS in a VM (Windows 2003) - wcf

I cannot access my WCF service in IIS 6.0 when running on a VM (Windows 2003 64 bit server).I have a local IIS as well on where I developed the service, and I can access my service fine over there. I built a deployment package and deployed it to the VM, however I just cannot get to it.
Particulars about the WCF service:
1 - Its REST based
2 - Using SSL
If I place a static HTML file in the directory where my service.svc file is, I am able to access that but I cannot access the service.svc file. I am doing all this using IE.
So for instance
Any help would be appreciated it. Thanks.

Couple of things to check:
ASP.NET is installed properly and is registered for IIS (aspnet_regiis -i). Best way is not to use a static file, but an .aspx file to see if the asp.net runtime is running.
Verify you are running a 64-bit binary for the wcf service. If you copied if from a local 32-bit OS, you might need to recompile it for 64-bit.
Did you use https localy also? if not, try to change the configuration of the service to use http (without ssl), check that it works, and then understand what is the required configuration for https.

Related

Is app.config file exposed for Windows Service like WCF service web.config file using IIS?

I'm new to creating Windows Services to host WCF, as I've been using IIS to do this. I've created a Windows Service to host about a dozen of WCF services, and have set up an app.config file in Visual Studio to handle all the endpoints and addresses for each of the services.
Where on the file system are windows services installed? Is there a way to reconfigure the config file to change bindings/addresses without having to uninstall/reinstall the service?
I've been doing this with the published web.config file that is present in the inetpub for WCF services that are using IIS, I'm wondering if it's the same with a windows service.
The answer to your title question is YES. The app.config to Windows Services is the same as the web.config is to IIS hosted web services.
Windows services are usually deployed as regular executable files in a certain place within a product specific path. The app.config placed next to this executable is with the same name as the executable appended with .config. So a ScanService.exe has a ScanService.exe.config next to it that contains its configuration.
Hans , I have developed/installed my distributed services(.NET remoting) with as windows services, What happens is you need to specify folder while installing the service. eg you select the folder as "C:\Program Files\MyService" then your MyService.exe.config will be installed in same folder as "C:\Program Files\MyService"
so your can find "C:\Program Files\MyService.exe.config" and modify your bindings and then restart your windows service.
Other points you consider is
There will be no AppPool here so what ever account you will use while installing the services will be used to run your services. you may need to provide some additional permissions if you are using simple domain\account
in case you need to access event log or registry via your service.
Or in you can modify your service account later on after installing the services.
Is there any particular reason you want to move away from IIS ? As my WCF services also live in IIS so was wondering if you facing any issues with one.

Unable to host WCF REST Service 40(CS) on IIS 7

I have created WCF REST service in vs2010(4.0) with WCF REST Service Template 40(CS). It works fine on localhost and local IIS (7.5), without giving me any errors. But while I am trying to deploy it on server, it gives me 500 Internal server error. I have deployed same way I did on locl IIS. It is not giving me more details about the error. When I checked the server log, it says service.svc - file does not exist. While I have not created .svc file, I did directly with given template.
Can any one please help me to find the solution to this...
Thanks in advance...
I am using template, so there is no .svc file. In this we can directly access the uri without .svc with the filename.
Chrome is just displaying me 500 Internal server error. It is not displaying any related information about error.
-
Satyen Pandya
finally I found the thing that causes error in my service. I have used MySQL database and for that reference to MySql.Data.dll file of older version, and when I upgraded that dll with newer version, my entire project was not responding. It was replaced my newer version and when I tested with older version, service is running fine.
And for hosting it on WCF, Normal procedure of hosting the site on IIS worked for me after solving above problem... And I better opt for going with .net 3.5 WCF Rest Service with .svc extension available.
Thanks all for reviewing my problem..
Take a look at similar post...
# hosting .net 4.0 REST WCF service in IIS 6

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

404 Error Hosting WCF Service via IIS 7.5 Shared Content

We're attempting to host a WCF Service (.NET 3.5 SP1) using Shared Content on IIS 7.5. At the moment it's returning a 404 error. My assumption at this point is that WCF can not be hosted via a UNC path (See workaroundHosting WCF service in IIS6 using UNC).
Steps I've taken:
- Established a FullTrust to/with the UNC path.
- The service works hosting it on a local disk.
- A basic HTML page renders without issue from the UNC path.
- A ASPX page renders without issue from the UNC path.
- Explicitly set "Full Control" permissions to the user running the service.
The reason for using Shared Content in IIS 7.5 to host this WCF Service, and several other websites, in a web farm. Using Shared Content avoids the need for file replication between the nodes in the farm. (Note we are also using Shared Configuration to support this environment.)
Have you used fiddler to inspect the traffic?
Or enabled failed request tracing in IIS?
It seems that the root of the issue revolves around the identity of the application pool being set to "ApplicationPoolIdentity" (Application Pool/[App Pool]/Advanced Settings/Process Model/Identity). We were setting the proper user credentials at the website, but not here.
We now have the application pool running as the user and the website using pass-through authentication.

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.