2012-05-30 177 views
0
<system.serviceModel> 
    <services> 
     <service 
      name="myClass.IService1" behaviorConfiguration="myService"> 
     <endpoint 
      name="ep1" 
      address="http://localhost:57582/Service1.svc" 
      contract="IService1" 
      binding="basicHttpBinding" 
      /> 
     <endpoint 
      address="mex" 
      binding="mexHttpBinding" 
      contract="IMetadataExchange" /> 
     </service> 
    </services> 

    <behaviors> 
     <serviceBehaviors> 
     <behavior name="myService"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 

但我仍然收到以下錯誤:: 無法添加服務。服務元數據可能無法訪問。確保您的服務正在運行並展示元數據。如何配置wcf端點?

+0

我猜的服務來服務可能沒有運行 – VJAI

+0

如何我可以確定它是否在運行? – lovin

回答

1
  1. 您的服務名稱IService1 - 這看起來像它實際上可能 合同。如果您使用的是正常的模板,然後從IService1

  2. 刪除 I如果你是託管,您可以刪除address爲.svc文件的位置是自動的地址IIS。

  3. 合同必須是完全合格的,包括合同接口

與此命名空間中的位置元數據應該從<.svc file location>?wsdl

+0

...感謝曼恩......它的工作。我與合同名稱和服務名稱混在一起,現在已經修好了。 – lovin