2012-02-23 48 views
0

我想從WCF服務發送模式到WCF客戶端。我最好的選擇是什麼?我可以使用簡單的字符串發送嗎?或者我應該把它作爲一個文件發送?用WCF 4.0發送XSD消息

乾杯

回答

0

最好的辦法將使得元數據交換的端點將發佈WSDL。 如果您更改了代碼,那麼.NET將自動更新WSDL以提供最新版本。

您可以使用下面的配置來做到這一點。

<configuration> 
    <system.serviceModel> 
    <services> 
     <service name="Server.CounterService"> 
     <endpoint address="ws" binding="wsHttpBinding" name="wsDefault" 
      contract="IMyContract"> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name=""> 
      <serviceMetadata httpGetEnabled="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
</configuration>