WCF Web Services Hosting in IIS - Works in VS but Not in IIS

I have a lot of new things in web programming, so my question is about the basics. I am developing a SilverLight application and need to access it from the database. I use LINQ to SQL to retrieve data from a database and the WFC web service to deliver it to my application.

Everything works fine when I run my application in Visual Studio. When you try to publish a web service to IIS, the web service call fails.

To make my question simple, I will focus on a completely new web service. Here are the steps I'm doing:

  • Launch Visual Studio 2008 -> File -> New -> Project -> Web -> WCF Service Application Project Name: MyWcfService

  • Result Visual Studio creates a sample project with the embedded web service "Service1"

  • Rebuild, start with Visual Studio (host on the ASP.NET development server) -> Everything works fine, I see my service under the http://localhost:52489/Service1.svclink

  • Now I want to host this service on my IIS (I have IIS7 on a Vista x86 PC) Visual Studio -> right-click Project -> Publish -> target location -> Create a new web application called "MyWcfService" -> Publish

  • Just to check my folder C:\inetpub\wwwroot\, now it contains a subdirectory of MyWcfService with all the necessary files.

  • Open IE on my PC http://localhost/MyWcfService/Service1.svc

Result:

HTTP Error 404.3 - Not Found The page you requested could not be completed due to the extension configuration. If> the page is a script, add a handler. If you need to download the file, add a MIME card.

"identity" web.config - . .

- ? ? , - ?

+3
4

Per , WCF/WWF, Silverlight @Microsoft:

IIS SVC ?
. ASP.NET, WCF. ASP.NET , ASP.NET ISAPI IIS. WCF , HTTP .

: "aspnet_regiis -i -enable" 2.0 "ServiceModelReg.exe -r" 3.0 .

"System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version = 3.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089" ISAPI- "% SystemRoot%\Microsoft.NET\Framework\v2. 0.50727\aspnet_isapi.dll" *.svc IIS. IIS ISAPI, .

HTTP- WCF.

+3

IIS ASP.NET , aspx, . , svc, asp.net. http://msdn.microsoft.com/en-us/library/bb515343.aspx.

+1

Silverlight - , ( xap)

clientaccesspolicy.xml, -. , .

<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
      <cross-domain-access>
            <policy>
                  <allow-from>
                        <domain uri="*" />
                  </allow-from>
                  <grant-to>
                        <resource path="/" include-subpaths="true" />
                  </grant-to>
            </policy>
      </cross-domain-access>
</access-policy>
+1

Source: https://habr.com/ru/post/1731246/


All Articles