WCF webservice hosting in a subdirectory

Our organization has several WCF web services that should be hosted as their own applications, but we would like to serve one subdomain.

webservs.domain.edu/service1/ webservs.domain.edu/service2/ 

The service1 and service2 subdirectories are configured as native applications in the main folder (webservs). The problem is that the subdirectories are their own applications (which is necessary because services are all separate projects with very different functions / code bases), they do not recognize the correct directory structure.

In the wsdl document, schemaLocation:

 <xsd:import schemaLocation="http://server.department.domain.edu/service1/Service.svc?xsd=xsd0"> 

However, the correct way:

 <xsd:import schemaLocation="http://server.department.domain.edu/webservs/service1/Service.svc?xsd=xsd0"> 

Someone suggested setting the serviceBehavior httpGetUrl attribute to the correct path, but when I do this, I get an exception: "Registration already exists for the URI."

Does anyone come across this problem or have any ideas on how to implement it?

+4
source share
1 answer

You need to define each corresponding service as an application in IIS in the "webservs" virtual directory (that is, nested under it). If you have already done this, you can get wsdl by calling http://server.department.domain.edu/webservs/service1/Service.svc?wsdl

If this works, but schemaLocation is still wrong, check out this thread: http://forums.silverlight.net/t/20767.aspx/1

0
source

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


All Articles