У меня есть сервис WCF.Вот конфигурация
<basicHttpBinding>
<binding name="EmergencyRegistratorBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
И конфигурация сервиса
<service behaviorConfiguration="Default" name="Breeze.AppServer.Emergencies.EmergencyRegistrator">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="EmergencyRegistratorBinding"
contract="Services.IEmergencyRegistrator" />
</service>
Все работало нормально.Но мне нужно было изменить basicHttpBingind на DuplexBinding.Я добавил расширение:
<extensions>
<bindingElementExtensions>
<add name="pollingDuplex" type="System.ServiceModel.Configuration.PollingDuplexElement, System.ServiceModel.PollingDuplex"/>
</bindingElementExtensions>
</extensions>
И изменил вышеупомянутые строки на:
<customBinding>
<binding name="DuplexmergencyRegistratorBinding">
<binaryMessageEncoding/>
<pollingDuplex maxPendingSessions="2147483647" maxPendingMessagesPerSession="2147483647" inactivityTimeout="02:00:00" serverPollTimeout="00:05:00"/>
<httpTransport authenticationScheme="Negotiate"/>
</binding>
</customBinding>
и
<service behaviorConfiguration="Default" name="Breeze.AppServer.Emergencies.EmergencyRegistrator">
<endpoint address="" binding="customBinding" bindingConfiguration="DuplexmergencyRegistratorBinding" contract="Breeze.Core.Services.IEmergencyRegistrator" />
<endpoint address="mex" binding="customBinding" bindingConfiguration="DuplexmergencyRegistratorBinding" contract="IMetadataExchange"/>
</service>
Я добавил ссылку на службу в WCFпроект.Ссылка была успешно добавлена, но Reference.cs был почти пуст.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.225
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
Когда я снимаю флажок с опции " Повторное использование типов в ссылочных сборках " Код генерируется, но там больше 10 тысяч строк вместо ~ 500
Я запускаю svcutil и яПолучено следующее:
svcutil.exe http://localhost/Breeze.Workstation/Emergencies/EmergencyRegistrator.svc?wsdl
Попытка загрузки метаданных из 'http://localhost/Breeze.Workstation/Emergencies/EmergencyRegistrator.svc?wsdl' с использованием WS-Metadata Exchange или DISCO.Предупреждение. Следующие утверждения политики не были импортированы: XPath: // wsdl: определения [@targetNamespace = 'http://tempuri.org/']/wsdl:binding[@name='CustomBinding_IEmergencyRegistrator'] Утверждения: ..
Создание файлов ... C: \ Program Files (x86) \ MicrosoftVisual Studio 10.0 \ VC \ EmergencyRegistrator.cs C: \ Program Files (x86) \ Microsoft Visual Studio 10.0 \ VC \ output.config
Я довольно новичок в службах WCF.Я надеюсь, что кто-нибудь сможет мне помочь.Спасибо.