I am developing a WCF service hosted by IIS using VSTS2008 + C # + .Net 3.5. I find that when accessing a service with a client using the Add Service Reference ... the client should be able to resolve the computer name by IP address, because the WSDL refers to some schema file by machine name. Here is an example of a part of the WSDL file, in order to parse the WSDL file from the client side to create a proxy server, we should be able to resolve the testmachine1 machine name for the corresponding IP address,
<xsd:import schemaLocation="http://testmachine1/service.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
My question is, for some reason, the machine name cannot be resolved all the time (for non-technical reasons), so I want to bind to the IP address of the IIS server hosting. Is it possible? If so, appreciate if anyone can advise. Here is my current WCF web.config file, I want to know how to change it so that it works with the IP address,
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <services> <service behaviorConfiguration="Foo.WCF.ServiceBehavior" name="Foo.WCF.CustomerManagement"> <endpoint address="" binding="basicHttpBinding" contract="Foo.WCF.ICustomerManagement"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="Foo.WCF.ServiceBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>
thanks in advance George
source share