Add a WCF service to an ASP.NET MVC project

I am trying to add a WCF service to an existing ASP.NET MVC web application, but with the WCF Test Client application, I continue to receive HTTP 404 for the URL of the .svc file.

When I added a new WCF service to the project, it seemed to automatically make a bunch of changes to the web.config file. I tried to crack my routes in the global.asax file to ignore the .svc file, see if that helped & mdash; this is not true.

I also edited the WCF configuration settings using the editor tool in Visual Studio to add the main thing to the http endpoint.

I only need the WCF service for a very small part of my project in order to integrate with another system that uses WCF extensively.

UPDATE: Here are some results from the WCF test client application when I add the http: //localhost/LabManagerDev/Development/SoftwareRequests.svc URL to the provided dialog box.

Error: Cannot retrieve metadata from http: //localhost/LabManagerDev/Development/SoftwareRequests.svc If this is a Windows (R) Communication Foundation service that you have access to, be sure to enable metadata publishing to the specified address. For help including metadata publishing, see the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455 . Error exchanging WS-metadata URI: http: //localhost/LabManagerDev/Development/SoftwareRequests.svc   Metadata contains a link that cannot be resolved: http: //localhost/LabManagerDev/Development/SoftwareRequests.svc'. The HTTP request is not authorized using the Anonymous client authentication scheme. The authentication header received from the server was Negotiate, NTLM. The remote server responded with an error: (401) Unauthorized. HTTP GET URI error: http: //localhost/LabManagerDev/Development/SoftwareRequests.svc   Error loading http: //localhost/LabManagerDev/Development/SoftwareRequests.svc '. Request error with HTTP status 404: not found.

+3
source share
2 answers

Two problems:

  • Anonymous authentication must be enabled.
  • WCF Modules Not Registered During IIS7 Installation

, ServiceModelReg -i "C: โ€‹โ€‹\ Windows\Microsoft.NET\Framework\v3. 0\Windows Communication Foundation".

0

( ) svc.

0

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


All Articles