0
我有一個具有多個服務合同的服務,當我運行svcutil.exe時,它只生成一個合同或另一個合同的客戶端代碼(似乎每次運行時都會切換它)。一些更多的信息: 服務:svcutil只爲多個服務合同中的一個生成客戶端代碼
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Single)]
public class BackendService : IBackendService, IFitContract
{
//implementation
}
我的web.config看起來像:
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- 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="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsDualHttpBinding/>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<protocolMapping>
<add scheme="http" binding="wsDualHttpBinding"/>
</protocolMapping>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
SvcUtil工具電話:
svcutil.exe /config:App.config /out:BackendService.cs /n:*,BackendServer /r:bin/Debug/CSCommon.dll http://localhost:56725/BackendService.svc?wsdl
任何想法,爲什麼發生這種情況?
有道理。我認爲協議映射的目的是,我們不需要手動添加端點(在4.0中) –