ItsJason
ItsJason

Reputation: 747

WCF showing the "You have created a service." page instead of WSDL

I have a WCF service running inside an ASP.NET MVC 4 application. The site is running on IIS8 on Server 2012. Until recently, the WSDL pages loaded without any problems. This week, the WSDL no longer loads. The link from the "Welcome" page is correct, but when I click it or attempt to generate a client, the same Welcome page is returned.

I have tried this using a ServiceRoute and also using an .svc file.

The ServiceRoute looks like this:

/DataService

Its WSDL link is:

/DataService?wsdl

The .svc file looks like:

/directory/otherdir/DataService.svc

The WSDL link is

/directory/otherdir/DataService.svc?wsdl

I never needed any configuration in the web.comfic section before, using the SerivceRoute.

How can I get WCF to show the WSDL correctly?

Upvotes: 0

Views: 782

Answers (1)

oddmike
oddmike

Reputation: 315

I ran into this before and there can be multiple reasons, the service is not functioning due to errors in the operations or you may be using WebServiceHostFactory instead of ServiceHostFactory

RouteTable.Routes.Add(new ServiceRoute("DataService", new ServiceHostFactory(), typeof(MyServiceType)));

Upvotes: 2

Related Questions