MDS Services.svc web service gives HTTP Error 404.3 – Not Found after I just installed it successfully

MDS Services.svc web service gives HTTP Error 404.3 – Not Found after I just installed it successfully

Rate This
  • Comments 2

If you use a Windows server to host IIS, and you installed IIS as an additional feature after Windows was already installed for a while, its likely that if you try to use the SQL Server 2008 R2 or SQL Server “Denali” Master Data Services web service it will fail to work.

Why? Order of operations matters, because MDS relies on Windows Communication Foundation technology (WCF) and if you install IIS after the WCF pieces were installed, then WCF doesn’t know to register itself into IIS list of handlers. What is WCF? Read here if you are curious… http://msdn.microsoft.com/en-us/library/ms731082.aspx

The MDS Configuration Manager installed the website, and the service, but it did not check if the service actually functions! darn.

This is the error I get when I visit the MDS’s web service in my browser at the website URL, something like http://localhost:80/Service/Service.svc

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.

 

image

This error usually indicates that the *.svc Handler is not installed.

1. To check this, look in your IIS Manager (this happens to be IIS 7.5 from Windows 7).

2. Click on the Server name (the top most node in the Connections tree on the left)

3. Click on Handler Mappings icon under the IIS category in the middle Features View pane

image

4. Notice there is no *.svc handler mentioned. I sorted by Path column to make it easier to spot that. R’s then S’s but no *.svc…

  • image

Solution

I found the common solution is documented here.
http://msdn.microsoft.com/en-us/library/ms752252(VS.90).aspx

If you installed IIS after Windows Communication Foundation (WCF) was installed you must run the following command.

"%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r 


This registers the required script maps in IIS so it can run WCF based web services. You must also make sure that the .svc file type is mapped to aspnet_isapi.dll.

We did the 64-bit one because my server was 64-bit.

"%WINDIR%\Microsoft.Net\Framework64\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r 

1. To run it, start an elevated Command prompt. Start > cmd

image

2. Had to confirm Y (Yes)  I will accept this risk that it may damage something that’s already working with WCF technology.

image

3. It ran for a minute, and then returned to the prompt…

image

4. Now I revisit the Handler Mappings in IIS manager. Notice that *.svc is a supported handler now. F5 to refresh the list I think.

image

5. Double Click on the svc-Integrated item. It will hang for a second, then finally open to show this kind of thing…

It points to .Net 3.0 on my box, which is what I expect because I ran the installer for WCF from .Net 3.0 version "%WINDIR%\Microsoft.Net\Framework64\v3.0

System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

image

 

Now I test my MDS Web service again via the browser, and it works. Well, it gives a warning about Metadata being disabled, but that’s normal.  “Metadata publishing for this service is currently disabled.” That’s the default behavior, but at least the service seems alive now, with no 404 or 403 errors.

image

Show the Metadata if you want to develop against this Service

I like to get rid of this warning, for development purposes you would need to see the metadata presented by the Web Service to write you code against.

If its a production server, you probably don’t need to do anything, because exposing metadata is unnecessary if the client application is already written.

1. Since my Program Files folder is protected by UAC in this version of Windows, I run Notepad as elevated Administrator. 

image

2. In Notepad, open the web.config file that lives underneath the virtual directory used for MDS. By default that is something like  C:\Program Files\Microsoft SQL Server\Master Data Services\WebApplication  then point to web.config  (show all files *.* to see it in the browse dialogue)

image

3. Control+F to Find the tag <serviceMetadata

Set one of the options to true, depending on if you are using http or https for your website/service.

httpGetEnabled="true"  or httpsGetEnabled="false"

I just did the httpGetEnabled, since I only am using http on my machine.

<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false"/>

image

4. Save the change.

5. Refresh your browser pointed at your web service URL http://localhost:8080/Service/Service.svc

image

Note it gives you a test command line to try now…

svcutil.exe http://servername.com:8080/Service/Service.svc?wsdl

6. Run a test of your web service to make sure it functions. Open an elevated command prompt again or you will get access denied to your .cs and .tmp files because program files is locked down tightly.

cd C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\
svcutil.exe http://localhost:8080/Service/Services.svc?wsdl

image

SvcUtil is explained here http://msdn.microsoft.com/en-us/library/aa347733.aspx

It lives in an SDK folder, such as

C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin

7. Check the output if you are curious. Output defaults to the same folder where the svcutil.exe was called from, or you can do /out to redirect it to another file location.

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin

image

Output.config output:

image

Services.cs output:

image

8. I didn’t go as far as to code a sample app to talk to this web service, but I’ll save that for another day. Here a nice blog to get you started using your working web service.

http://sqlblog.com/blogs/mds_team/archive/2010/01/12/getting-started-with-the-web-services-api-in-sql-server-2008-r2-master-data-services.aspx

Leave a Comment
  • Please add 4 and 4 and type the answer here:
  • Post
  • YOU THE MAN, Jason!  I was about to start tearing my hair out, until I found your solution.  I followed the directions, and it fixed the problem!  Thanks a million, dude!

  • Thank. That what i find for hour @@!!!

Page 1 of 1 (2 items)