404 On existing .svc file - web-services

I have an IIS site on a Windows 2012 R2 server. The site has an Application inside it:
The URL for this site is setup on our Active Directive servers as it is only accessible internally from our company. The URL follows the following structure:
http://NAMEoftheSERVICE.myCompanyServices.myCompany.local
The service for this site is placed in an internal folder:
http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/InternalFolder/Service.svc
I have placed a number of test files both at the root level and in the internal folder:
http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/HelloWorld.html
http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/InternalFolder/HelloWorld.html
I can browse these files without any problems. However, I cannot browse the service at http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/InternalFolder/Service.svc
The browser returns
However the file is there, and I have made sure there are no typos in the URL I put in the browser.
I have looked at similar questions but there seems not to be anything like the problem I am experiencing. The only question that looked promising was:
WCF service file not visible
But the answer for that post does not apply to my issue as I already have the configuration mentioned in that post setup as it is suggested.
I have checked the IIS-level config files for any exclusion regarding .svc files or anything similar, but could not find anyhting.
Have you got any suggestions on where to look at to solve this issue?

Solution: Install HTTP Activation feature
After running some more testing on other sites on the same server, I actually realised that the issue was specific to .svc files. I therefore made another search on Google and found that the server was missing the "HTTP Activation" feature (part of the WCF Services).
So, if you are having the same issue on .svc files follow the following steps to make sure you have the right components installed on the server:
Open Server Manager
In Server Manager, click the Manage menu, and then click Add Roles
and Features
In the Add Roles and Features wizard, click Next. Select the
installation type and click Next. Select the destination server and
click Next.
Skip the Server Roles page.
On the Select features page, expand ".Net Framework 4.5 Features",
expand "WCF Services" and select "HTTP Activation". Click Next.
On the Confirm installation selections page, click Install.
On the Results page, click Close.
The same can be achieved by running the following Powershell command:
Install-WindowsFeature -Name NET-WCF-HTTP-Activation45
This did the trick for me. I hope it can be of help to someone.

Related

Rest Web Service,

i am approaching the development of Restful web services for the first time. I tried to follow this guide for Netbeans . I am stuck at the testing of the web service.
When i open the
http://localhost:8080/WebServicesTest/test-resbeans.html
page, none of the root resources appears in the left menu. (there should be entities.customer and entities.discountcode)
I really can't find a solution.
Thanks in advance to anyone who likes to give me a hint.
--------------- Edit
If i click on CustomerDB --> Deploy i get an error
In-place deployment at C:\Users\utente\Documents\NetBeansProjects\CustomerDB\build\web
GlassFish Server 4, deploy, null, false
C:\Users\utente\Documents\NetBeansProjects\CustomerDB\nbproject\build-impl.xml:1071:
The module has not been deployed.
See the server log for details.
The line 1071 of build-impl.xml is
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
I checked out the referenced tutorial.
Which exact path did you follow? Did you change anything?
Most likely your CustomerDB application is not deployed correctly (see GlassFish Server output in NetBeans) and thus is not able to expose the web service and thus is not displayed in the test page (nothing visible in the side bar).
I tried the tutorial myself and had that phenomenon when using another database ("test" instead of the sample db, which was not connectable in my installed environment), resulting in a message that "test__pm" resource was not found. I then created a conection pool and a jdbc reosurce for test and then it worked.

ELMAH does not work after moving to a new server

I made a complete copy of the old web application.
Copied it to the new server.
Made appropriate SQL Server changes and it does not work.
ELMAH Version: v1.0.3705
OS: Windows Server 2012
IIS 8
I believe I found your answer. You need to grant your IIS AppPool permission to modify (or write) to the path you have instructed ELMAH to write the XML. To do this, bring up Windows File Explorer, locate the path and folder where ELMAH is writing those XML, right click to get folder menu and select properties, locate and click on the tab labeled SECURITY, and follow the instructions described in this URL:
http://www.iis.net/learn/manage/configuring-security/application-pool-identities

Trying to browse to a new web root in ColdFusion 10

OK, the documentation says:
If you configure the folder containing FW/1 as a new web root and
browse to it, you'll see an introductory application.
So I created a new site in Windows Vista and pointed it to the Framework 1 bundle.
I've installed CF10, and am able to navigate to http://localhost:8500/CFIDE/administrator/
so I know that's working.
But when I navigate to http://localhost/, it gives me:
Error Summary
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Requested URL http://localhost:80/
Physical Path C:\inetpub\seancorfield-fw1-9e69741
And trying localhost:8500 goes to C:\ColdFusion10\cfusion\wwwroot
I wrote up a pretty detailed blog post here:
http://blog.bittersweetryan.com/2012/02/changing-webroot-of-coldfusion-zeus.html
It looks like you may not have updated your mapping to the WEB-INF and CFIDE folders.
If you installed it as the built in server then it will be 8500.
If you integrated into IIS then it will be port 80
You may just need to run the web connector tool, you will find it in the start menu.
If that doesnt work, you likely don't have the necessary bits of IIS installed.

How to publish a Web Service from Visual Studio into IIS?

I have written a WCF web service in C#. I had originally self-hosted it and then decided to host it on IIS running locally on my PC. While the service is working, there are several aspects of the deployment process that I don't understand:
Firstly, the URL of this service when hosted in IIS does not correspond to what I specified in my web.config. I had specified "http://localhost:8000/MyServices/OrderService" there and this was used when I self-hosted. Now that I've deployed to IIS, the URL has become "http://localhost/MyServices/OrderService". Why is the URL not picked up from my config file?
Secondly, to host the Web Service, I created a new web site within IIS (in addition to the existing 'Default Web Site'). I set the physical path to c:\inetpub\wwwroot (no idea if this is correct) and left the other parameters as default. I then copied my /bin folder, my .svc file and my web.config to this folder. Is this the equivalent of a 'Virtual Directory'?
Finally, the service didn't work until (within IIS) I selected 'Convert to application'. Why is it necessary to select 'Convert to application'?
Can anyone explain what the correct procedure is to publish a simple web service from Visual Studio into IIS, or point me at some good documentation so I can understand the process?
****EDIT TO ORIGINAL*****
Having spent more time looking into this, I have found the following:
When I create a web site in IIS, I give it a physical directory of c:\inetpub\wwwroot....etc
If I then "publish" from within Visual studio, all it's doing is copying all the required filed (like the /bin directory, web.config and .svc file) into the physical directory of the website i.e. - c:\inetpub\wwwroot...
You can perform the copy manually to the same affect.
Lastly, with regard to the URL of my service not corresponding to the baseAddress section of my web.config file, this has been answered on stackoverflow previously.
The answer is that the baseAddress is completely ignored when hosting on IIS.
If using Visual Studio 2010 you can right-click on the project for the service, and select properties. Then select the Web tab. Under the Servers section you can configure the URL. There is also a button to create the virtual directory.

Configure IIS 7.0 to enable webservices in classic mode

What are the configuration file settings to enable webservices on IIS 7.0 in classic mode?
The site has to be in a classic mode application pool because the Report Viewer controls crash when running in Integrated Mode. However in a classic mode application pool, webservices produce the following error message:
The requested content appears to be
script and will not be served by the
static file handler.
•If you want to serve this content as
a static file, add an explicit MIME
map
EDIT - Additional Error Message Info:
HTTP Error 404.17 - Not Found
Module: StaticFileModule
Notification: ExecuteRequestHandler
Handler: StaticFile
Error Code: 0x80070032
Note: This particular instance of the application will be running in a customers account on a shared hosting enviroment so access to IIS UI is not/will not be available. Specifically seeking configuration file adjustments.
In IIS Manager (Start -> Run -> inetmgr), select the website or virtual directory you want to set to classic mode.
In the right hand panel "Actions", click on "Basic Settings".
Next to application pool (that is defaulted to DefaultAppPool), click "Select" and change it to "Classic .Net AppPool".
Walkthrough is here.
Update: Sorry, I misread your question. There are a couple of things you can try:
The first is to double check the IIS installation features from the control panel (Programs and Features -> Turn Windows Features on and off -> Internet Information Services -> World Wide Web Services -> Application Development Features). I have everything bar CGI and Server-side includes checked).
Secondly, make sure that your site is correctly setup as an application (select website -> Actions -> View Applications). If it isn't there you'll need to add it.
Third thing to check is specifically the Handlers, which is accessed through IIS Manager -> Select website -> Handler Mappings -> Open Feature -> Make sure .asmx is there. I have it three times, WebServiceHandlerFactory-Integrated (handler System.Web.Handlers.WebAdminHandler), WebServiceHandlerFactory-ISAPI-2.0 (Isapi Module), and WebServiceHandlerFactory-ISAPI-2.0-64 (Isapi Module).
Finally you make sure you are using the correct .NET version for that application.
Again, apologies for the original duff answer.
Thanks Junto for the post! I tried so many things that other people were suggested but couldn't get my site to work. I followed your instructions and sure enough, my applications were listed under Sites in IIS, but were not shown in the Application Pools. I deleted the Applications and created them. Everything work as expected after that.
In case someone is interested of what I went through. I was migrating from IIS6 to IIS7. All the virtual directories and applications seem to be ported fine, but not all of them got into the Application Pools. So, if you're running into the same issue, "Error 400.17. If you want to serve this content as a static file, add an explicit MIME map", check your App Pool to make sure all your applications are shown.
This sounds like your HandlerMappings are a bit screwy. You can revert to known good a baseline (provided you haven't tinkered with the server wide Handler Mappings) by doing:
Open IIS Manager
Open the site in question
In the Features View for the site open the Handler Mappings feature
In the Actions pane (top right), click on "Revert To Parent"