Deploy WCF REST 4.0 to XP IIS 5? - wcf

I am trying to deploy a simple "Hello World" .NET 4.0 REST-style WCF service on WinXP (IIS5). It works fine in Cassini.
I tried to adapt the info here to me:
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
but something is not clicking. Can anyone lend ideas or comments? Yes, I must stay with WinXP.
Thanks.

After a fair amount of struggling I was able to successfully deploy a WCF 4.0 REST web service on XP/IIS5. For the benefit of you and others in the same situation, here's what I did (let me know if you need more detail):
Using VS 2010, build a deployment
package for the project and then
install it on the target machine
(your web server). The following
link will show you how to do this: http://vishaljoshi.blogspot.com/2009/03/web-packaging-installing-web-packages.html
Make sure that your virtual directory in IIS is configured to use .NET 4 (right click on virtual directory > properties > ASP.NET tab > ASP.NET Version)
Configure your virtual directory to support extensionless requests (i.e. your REST API) by creating a wildcard mapping (right click on virtual directory > properties > configuration > mappings tab) with the following properties:
Executable: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
Extension: .*
Check that file exists: unchecked
(Note: watch out for the bug that keeps the "OK" button on this dialog grayed out. To get around this just click in the executable textbox after entering your extension and the "OK" button should get enabled).
If you get an authentication error when accessing the service then turn off integrated authentication on the virtual directory. This should fix the problem if you have used the defaults in the generated web.config of your service. If you have explicitly modified the authentication mode then you will have to adapt accordingly.

Have you considered self-hosting your service instead of trying to use IIS. That will probably be easier to do than use IIS.

In case above steps dont work. There could be a problem with permissions on your App pool for that website / virtual directory , you can try to set that right and try it out.
You can refer this article for more help on this.
http://technicalwizardry.blogspot.in/2013/04/wcf-rest-service-hosted-on-iis-5.html#!/2013/04/wcf-rest-service-hosted-on-iis-5.html

Related

Publish a WCFService doesn't work; Debugging-mode works

I want to start an default webservice-project, where I can send data over a service. When I go to debug the API through VS then everything works fine, but not when I try to use it over IIS.
I created an WcfServiceLibrary-Project in Visual Studio 2017. I then right-clicked on the project (in the solution explorer) and then published it to a folder A.
I also didn't do anything special at IIS (all the things are still on localhost.): I activated the default windows-feature "IIS". (The default web site got also stopped). Then I added there a site with an random name and the path to the folder A. The service got started.
My access trial was to find anything through Visual Studios "connected services".
Has anyone an idea?
At first, please use the WCF service application project template,
or the Appconfig file would not be kicked in. library project needs the additional configuration in the hosting environment, and the Appconfig file could not recognized. We have to move the configuration code into the configuration file recognized by your hosting environment.
https://learn.microsoft.com/en-us/dotnet/framework/wcf/deploying-a-wcf-library-project
Secondly, for hosting the WCF service in IIS, we should enable the below windows feature.
Feel free to let me know if the problem still exists.

HTTP Error 404.3 - Not found - The page you are requesting cannot be served because of the extension configuration

HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
what could be the reason of this error for the WCF service hosted on IIS 7.
Answered here
Please make sure you've activated WCF components from here.
Or alternate and easy way is, go to control panel -> Turn Windows feature on or off -> and make sure you've all the options ticked as mentioned in below screenshot.
Run from cmd:
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
All you need to do is enable HTTP Activation and any other features that are required for HTTP activation.
For Windows Server 2012,Go to server manager, on the dashboard --> click on Add roles and features. In the Wizard window that opens choose the appropriate server and go on clicking next until you are on the features selection page.
Depending on the version of .NET framework in use on your server you have to check HTTP Activation under WCF Services and proceed to install it. This should resolve your issue.
Run Visual Studio 2008 Command Prompt as “Administrator”.
Navigate to C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation.
Run this command servicemodelreg –i
Thanks for the blog from Rahul.
http://blogs.msdn.com/b/rjohri/archive/2009/06/29/the-page-you-are-requesting-cannot-be-served-because-of-the-extension-configuration.aspx

svc doesn't work

I have some problem and trying to solve for a few days..
I installed iis 6.0 but I updated it 7.5 express and 7.0. it looks 7.5 version..
so, I published wcf to localhost and set 4501 port. I can see file when I run iis http://localhost:4501/
but svc file doesnt work. When I click or type http://localhost:4501/Products.svc it doesnt work and I see a blank website.. nothing..
But If I run svc client in visual studio, asp.net development server works and my svc file works.. (http://localhost:4501/Products.svc) everything is same..
I dont understand why IIS doesnt work well?
I think that 6.0 doesnt support .. I use a proxy and I can connect to my global ip with proxy or my friend opens it.. but still svc file doesnt work..
I think the problem is iis.. but a global side, asp.net development server doesnt work too, but it works on localhost..
I opened all ports, add some new rule to firewall and i closed firewall (modem and computer)
I really become a crazy..
Edit: I try to connect ip with http://myGlobaLIp:4501 I can see my files on my localhost but If I try http://myGlobalIp:4501/Products.svc I get blank page..
Here is your issue: when you run from Visual Studio it automatically runs a virtual IIS for you, and assigns the ip/port...in this case it's http://localhost:4501/. When you setup the site and run it in IIS, you have to set those values during the website setup.
You need to create a website in IIS, then point to your code (publish it to a location like c:\inetpub\wwwroot\myapp)
You then need to set which port your webservice should run on.
THEN, go to http://{your ip or machine name}:{port configured in IIS, not the VS virtual IIS port}/Products.svc
Here is a step-by-step walk through from Microsoft to help you deploy a website (or wcf webservice): http://technet.microsoft.com/en-US/library/f6c26eb7-ad7e-4fe2-9239-9f5aa4ff44ce.aspx
good luck

WCF Test Clinet - Can't Edit Config File

We are currently experiencing an issue that requires the client endpoint configuration file to be modified but can't find a way to do this in the WCF test Client. Is there a way to modify the Config file in the WCF Test Client?
I have read that you should be able to right click and select edit but this option is not available.
Running Visual Studio 2008 (without SP1 - please don't ask why)
To edit the client config in WcfTestClient, right click on the Client Config below the listed service and select "Edit with SvcConfigEditor". Is the "Edit with SvcConfigEditor" greyed out or missing when you right click on Client Config?
Here is a link on more information about WcfTestClient for .Net 3.5: http://msdn.microsoft.com/en-us/library/bb552364(v=VS.90).aspx
Update
The "Edit with SvcConfigEditor" is added in SP1, but you can try the following to make manual changes:
From http://social.msdn.microsoft.com/forums/en-US/wcf/thread/dde72fbe-e741-48fd-a9e1-253800d5227a/ Herve Roggero suggested this:
Well, I was facing a similar challenge. There is a manual way to do this until the tool gets updated.
Start the client interface (WcfTestClient.exe) with the WCF Service HTTP
Expand the service and right-click on the Web.Config (do not double-click - this will load the config file)
Click on Copy Full Path
Go to the file and edit the configuration sections you need to change (buffer limits, dns identity for https...)
You can now start using the tool with a modified config file.
Unfortunately everytime you restart the tool a new config file gets generated in a different folder. So this is a manual step. Still it helped me test an HTTPS endpoint that required changing the config file.
Hope this helps

WCF and IIS confusion on the wsdl location

I created my WCF project and it works fine when I just run it from the debugger.
But when I publish it to IIS and point a browser to the svc the path used has localhost in it. Like this:
htpp://localhost/MyService/MyServices.svc
but the path that the webpage says to go to for the WSDL uses my computer name, like this:
http://MyComputerName.MyDomain.net/MyService/MyService.svc?wsdl
When I click on the link it times out. (Also, trying to view the services like that in WCFTestClient times out.)
However, if I go the wsdl using localhost then it works right away:
http://lcoalhost/MyService/MyService.svc?wsdl
Any link that uses my computer name times out ("takes too long to respond").
Any idea on how to make my WCF service work with the computer name?
(NOTE: I am using Visual Studio Ultimate and IIS 7)
Try adding MyComputerName.MyDomain.net to your proxy bypass list in Internet Explorer proxy configuration setting. Check that the IIS website has this FQDN in it's hostname in the site bindings.
Also what happens if you only use MyComputerName without the domain ?