简体   繁体   中英

WCF Service with Web Page not possible?

I have created a WCF Service and it's running just fine. I have the link that takes you to the Manager Service page in order for someone to get the URL for this service.

I have added a controller/cshtml page in order to test (ping) the databases that are used by the service so that we can check if they're up and running (the databases that is).

When I run the service locally with IIS Express, it works just fine.

www.domanin.com/ServiceName/Manager.svc is the URL.

When I run locally this ping (cshtml), it's localhost:XXXXX/Status .

Status is the name of the controller. And this works! (when I run locally).

Why does it not work when I publish it to a Server?

I try to go to www.domain.com/ServiceName/Status and I get a page cannot be found. I've also tried www.domain.com/Status and nothing. Can you not have a razor (cshtml + controller) hosted together with a service?

Thanks!

It sounds like your routing is not configured correctly most likely your mixing your wcf and mvc configurations and somehow it got messy. If you add .cshtml as an iis mime type on that remote server I suppose you could see a response.

I suggest that you create a folder under the root and make another iis application and place the test app and configuration in its own location if that is possible. You can still share code that way but will not have the overhead of opening the mvc pipeline for requests to your wcf service.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM