简体   繁体   中英

Does WCF Works without an address including baseaddress?

To be very surprised in this world today, I found a service (WCF) working without an address, including no base address specified. I am an mid level expert in WCF, however, was finding it so strange to see this behavior where we have address="" and no base address mentioned in config and also no other config files. When I asked this question to my colleague who was part of this development, he do not know the reason or logic, he just could make it work but do not know the reason. Any pointers please? Its WEBHTTP Binding

If your service is hosted in IIS you don't need to specify a fully-qualified endpoint address. This is because the base address used for the service always has to be the same as the address of the .svc file

When hosted in IIS, endpoint addresses are always considered to be relative to the address of the .svc file that represents the service

More here: https://msdn.microsoft.com/en-us/library/aa751792%28v=vs.110%29.aspx

When your service is self-hosted you can also leave the address empty. In this case, your service address will be the machine IP (or localhost) and .svc fine name.

You can launch a service host without providing any base address by omitting the base addresses altogether

More here: https://www.safaribooksonline.com/library/view/programming-wcf-services/0596526997/ch01s05.html

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