Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用WCF 4.0发送XSD消息_Wcf_Xsd - Fatal编程技术网

使用WCF 4.0发送XSD消息

使用WCF 4.0发送XSD消息,wcf,xsd,Wcf,Xsd,我想将架构从WCF服务发送到WCF客户端。我最好的选择是什么?我可以用一个简单的字符串发送它吗?或者我应该把它作为文件发送 干杯最好的方法是启用元数据交换端点,该端点将发布WSDL。 如果您更改代码,该WSDL将由.NET自动更新以提供最新版本 您可以使用下面的配置来实现这一点 <configuration> <system.serviceModel> <services> <service name="Server.Counte

我想将架构从WCF服务发送到WCF客户端。我最好的选择是什么?我可以用一个简单的字符串发送它吗?或者我应该把它作为文件发送


干杯

最好的方法是启用元数据交换端点,该端点将发布WSDL。 如果您更改代码,该WSDL将由.NET自动更新以提供最新版本

您可以使用下面的配置来实现这一点

<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>