Hello everyone,
I am referring from VSTS2008 (C# console application, using .Net 3.5) by using Add Service Reference function to add reference to a WCF service hosted in IIS 7.0 in another machine in the same LAN. I find the client side app.config generated automatically is very strange. Here is the content,
My confusion is the end point address is "http://labtest1/WcfDemo/service.svc/10.10.200.10/wcfDemo", but actually it should be "http://labtest1/WcfDemo/service.svc" (I can use http://labtest1/WcfDemo/service.svc in IE to get the WSDL from WCF hosting machine labtest1). But I cannot get WSDL from IE by using address "http://labtest1/WcfDemo/service.svc/10.10.200.10/wcfDemo". The machine labtest1 has an internal IP address 10.10.200.10. Any ideas what is wrong?
BTW: but the client functions works, i.e. the call to WCF endpoint methods could return expected results. How can a "wrong" endpoint address return a correct results?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IOrderManagement" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://labtest1/WcfDemo/service.svc/10.10.200.10/wcfDemo"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IOrderManagement"
contract="ServiceReference1.IOrderManagement" name="BasicHttpBinding_IOrderManagement" />
</client>
</system.serviceModel>
</configuration>
EDIT 1:
This is the configuration file (web.config) I am using at IIS 7.0 side. I put service.svc under WcfDemo sub-directory of machine labtest1's default web site (port 80). I think the correct endpoint address should be "http://labtest1/WcfDemo/service.svc" other than "http://labtest1/WcfDemo/service.svc/10.10.200.10/wcfDemo"?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service behaviorConfiguration="Foo.ServiceBehavior"
name="Foo.OrderManagement">
<endpoint address="" binding="basicHttpBinding" contract="Foo.IOrderManagement" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Foo.ServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>