无法从本地计算机的IIS上托管的WCF服务获取元数据

时间:2012-03-23 20:25:57

标签: web-services iis metadata config

我在本地计算机的IIS上托管了WCF Web服务,但是当我尝试使用svcutil获取元数据时,我得到以下内容:

Attempting to download metadata from 'http://mycomputer.mydomain:port#/R
eportsService/n_datafactory.svc?wsdl' using WS-Metadata Exchange or DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
Copyright (c) Microsoft Corporation.  All rights reserved.

Error: Cannot obtain Metadata from http://mycomputer.mydomain:port#/ReportsService/n_datafactory.svc?wsdl

If this is a Windows (R) Communication Foundation service to which you have acce
ss, please check that you have enabled metadata publishing at the specified addr
ess.  For help enabling metadata publishing, please refer to the MSDN documentat
ion at http://go.microsoft.com/fwlink/?LinkId=65455.


WS-Metadata Exchange Error
    URI: http://mycomputer.mydomain:port#/ReportsService/n_datafactory.svc?wsdl

Metadata contains a reference that cannot be resolved:
'http://mycomputer.mydomain:port#/ReportsService/n_datafactory.svc?wsdl'.

There was no endpoint listening at http://mycomputer.mydomain:port#/
ReportsService/n_datafactory.svc?wsdl that could accept the message. This is oft
en caused by an incorrect address or SOAP action. See InnerException, if present
, for more details.

The remote server returned an error: (400) Bad Request.


HTTP GET Error
URI: http://mycomputer.mydomain:port#/ReportsService/n_datafactory.svc?wsdl

There was an error downloading 'http://mycomputer.mydomain:port#/ReportsService/n_datafactory.svc?wsdl'.

The request failed with HTTP status 400: Bad Request.

If you would like more help, type "svcutil /?"

我的配置文件如下:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="WideTransferBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
  </basicHttpBinding>
</bindings>
<services>
  <service name="WebServSpace.n_datafactory" behaviorConfiguration="ServiceNameBehavior">
    <endpoint bindingConfiguration="WideTransferBinding" binding="basicHttpBinding" contract="WebServSpace.n_datafactory" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<!--For debugging purposes set the includeExceptionDetailInFaults attribute to true-->
<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceNameBehavior">
      <serviceMetadata httpGetEnabled="True" />
      <serviceDebug includeExceptionDetailInFaults="True" />
    </behavior>
  </serviceBehaviors>
</behaviors>

我做错了什么?非常感谢任何帮助。

0 个答案:

没有答案