【发布时间】:2016-03-08 09:55:24
【问题描述】:
我在尝试在同一站点上托管两个服务时遇到了问题。它们具有相同的基本 uri,但服务名称不同,并且每个都有自己的合同。
在我的 VS 环境 (IIS 7.5) 中进行测试时,一切正常。但是,当我部署到服务器(IIS 8.5)时,由于某种原因,两个 uri 都显示相同的 wsdl。似乎第二次服务的合同被忽略了。
有两个不同的 .svc 文件,后面有代码。 (为了保护无辜,所有名字都改了。)
网站:
https://mysite/services/Service1.svc
https://mysite/services/Service2.svc
这是我的配置:
<services>
<service name="Service1" behaviorConfiguration="DefaultBehavior">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="DefaultBinding" contract="Namespace.IService1"/>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
<service name="Service2" behaviorConfiguration="DefaultBehavior">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="DefaultBinding" contract="Namespace.IService2"/>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="DefaultBinding" receiveTimeout="00:05:00"
sendTimeout="00:05:00" bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" messageEncoding="Mtom"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:5:00" enabled="false"/>
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
<wsHttpBinding>
<bindings>
<serviceBehaviors>
<behavior name="DefaultBehavior">
<serviceMetadata httpsGetEnabled="true" httpsGetBindingConfiguration="true" />
<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<serviceThrottling maxConcurrentCalls="160" maxConcurrentInstances="160" maxConcurrentSessions="100" />
</behavior>
</serviceBehaviors>
问题是这两个站点都反映了相同的 WSDL,即 contract="Namespace.IService1" 的相同方法@ 有什么想法会导致这种情况吗?
【问题讨论】:
标签: c# .net web-services wcf iis