简体   繁体   中英

Best Practice for Adding WCF Web Service to Existing Web site

I have searched quite a bit for coverage of this topic and can't find very much on it.

If I have a website (intranet to my company) MySite.company.com/ And I want to implement a web service associated with that website {GetProductDetails.svc}

Can I make the URL (endpoint) for accessing the services something like: MySite.company.com/Services/GetProductDetails.svc I want to keep the base address the same and not have to direct users of the service to some other address.

I have been told it would need to be something like this (basically a separate web site): MySite.company.com:1858/GetProductDetails.svc

Or should I create a separate site like this: MySiteServices.company.com/GetProductDetails.svc

If your service is within a service folder in your existing website, then the url MySite.company.com/Services/GetProductDetails.svc will work. Depending on the .NET version you're using, you will need to specify the service bindings in the web.config of the current website.

If you are only exposing Product Details, and this is over HTTP to other applications, you could also use a Web API , Learn Web API .

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