SVCUtil.exe自动生成的服务无法显示元数据

时间:2014-08-28 09:20:25

标签: wcf metadata svcutil.exe

我已经按照使用配置文件显示元数据的所有步骤进行了操作,但我仍然收到了

  

此服务的元数据发布目前已停用

以下是我的配置文件。

    <?xml version="1.0" encoding="utf-8"?>
  <configuration>
    <system.serviceModel>
      <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_IService1" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>

        </basicHttpBinding>
    </bindings>
    <services>
      <service name="RedPillJob_Raw.Service1" behaviorConfiguration="MyServiceTypeBehaviors">
        <endpoint address="http://xxx.xxx.xxx.xxx/DanRaw/Service1.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
            contract="IService1" name="BasicHttpBinding_IService1" />
        <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
      </service>
    </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="MyServiceTypeBehaviors" >
                    <serviceMetadata httpGetEnabled="true" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>
</configuration>

我现在迷路了,我希望有人可以帮助我。

2 个答案:

答案 0 :(得分:1)

我唯一建议的是尝试将您的终端地址设置为客户端设备将连接到的实际URL,例如:

http:/ / CatDogMouse:6666 / DanRaw / Service1

我没有看到任何带有.SVC地址的MEX示例。

答案 1 :(得分:0)

我找到了解决方案。实际上这是我自己的错。我的部署中有2个配置文件。我唯一要更新的是第一个(在SVCUtil.exe中生成的配置)。我应该更新的文件是第二个文件,即web.config