Network reference: http://topic.csdn.net/u/20080423/15/4bbf1e34-7419-44e2-96d1-dfa29300d2be.html
Recently, I have been learning about WCF and have been confused about address issues. I use IIS as the host. Assume that the server address is 10.8.8.8, the server host name is mycoputer, And the. SVC file address is http: // localhost/WCF/service. SVC.
Access http: // localhost/WCF/service. SVC on the server. The help page appears, prompting me to use
Svcutil.exe http: // mycoputer/WCF/service. SVC? WSDL
Reference Service, which is no problem on the server. It can identify its own domain name http: // mycoputer, but it cannot resolve the domain name http: // mycoputer on other machines, therefore, http: // mycoputer/WCF/service cannot be referenced. SVC? WSDL. Later, I set the httpgeturl attribute and forcibly set the httpget address of the metadata to http: // 10.8.8.8/WCF/service. SVC/meta, you can use http: // 10.8.8.8/WCF/service on other machines. SVC/meta? WSDL reference service.
However, the base address in the operation is still http: // mycoputer/WCF/service. SVC, an exception occurs when other machines call the service. It does not work if I use the
After testing, I found that the host name bound to the website can be filled in with an IP address in IIS, which can avoid the problem of mismatch between host domain name resolution and IP address.