2012-02-10 4 views
0

私はWCFサービスを持っています。ここでWCFサービスリファレンスは、DuplexBindingのため空のreference.csを生成します

<service behaviorConfiguration="Default" name="Breeze.AppServer.Emergencies.EmergencyRegistrator"> 
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="EmergencyRegistratorBinding" 
     contract="Services.IEmergencyRegistrator" /> 
    </service> 

すべてがうまく働い設定

<basicHttpBinding> 
    <binding name="EmergencyRegistratorBinding"> 
     <security mode="TransportCredentialOnly"> 
     <transport clientCredentialType="Windows" /> 
     </security> 
    </binding> 
    </basicHttpBinding> 

とサービスの構成です。しかし、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

A WS-Metadata ExchangeまたはDISCOを使用して 'http://localhost/Breeze.Workstation/Emergencies/EmergencyRegistrator.svc?wsdl'からメタデータをダウンロードしないでください。 警告:次のポリシーアサーションはインポートされませんでした。 XPath:// wsdl:definitions [@ targetNamespace = 'http://tempuri.org/']/wsdl:binding [@ name = 'CustomBinding_IEmergencyRegistrator'] アサーション:。 。

ファイルの生成... C:\プログラムファイル(x86の)\のMicrosoft Visual Studioの10.0 \ VC \ EmergencyRegistrator.cs C:\プログラムファイル(x86の)\のMicrosoft Visual Studioの10.0 \ VC \ output.config

私はWCFサービスがとても新しくなっています。誰かが私を助けてくれることを願っています。おかげさまで

答えて

5

私はそれを解決しました。 空の参照は、あいまいな型に関するいくつかの問題が原因でした。それを修正すると、reference.csファイルがうまく生成されました。

解決策は、エラーだけでなく警告も見ることです。私は自分の問題に必要なすべての情報を見つけました。ハッピーコーディング

0

ポーリングデュプレックスHTTPバインディングは、Silverlightクライアントでのみサポートされています。参照を生成するためにsvcutilを使用しているので、私はサーバー用の「通常の」(つまり非SL)クライアントを構築していると仮定して動作しません。

Silverlight以外のアプリケーションでデュプレックスバインディングを使用する場合は、wsDualHttpBindingまたはnetTcpBindingのいずれかを参照してください。

+0

こんにちは。私はSLアプリケーションを使用します。私が以下に述べたように、唯一の誤りはあいまいなタイプでした。それはちょうど警告として示されていたことは奇妙です – Artiom

関連する問題