2013-01-15 65 views
0

我已经在.NET框架开发的WCF服务4.我的开发机运行的是Windows 8时,Visual Studio 2012和我已经在IIS 8WCF应用程序没有在IIS运行快车7.5

出版服务现在我需要在Windows XP机器上发布该服务。我在IIS 5.1上遇到了几个错误,所以我放弃使用这个版本,并试图在VS2010中使用IIS Express 7.5。

该服务起床没有问题,但我不能访问WSDL因为它说元数据被禁用。

我能做些什么来激活我的WCF服务的元数据?

跟随在web.config:

<?xml version="1.0"?> 
    <configuration> 
     <configSections> 
      <sectionGroup name="SAP.Middleware.Connector"> 
      <sectionGroup name="ClientSettings"> 
       <section name="DestinationConfiguration"      type="SAP.Middleware.Connector.RfcDestinationConfiguration, sapnco"/> 
      </sectionGroup> 
      </sectionGroup> 
     </configSections> 
     <SAP.Middleware.Connector> 
      <ClientSettings> 
      <DestinationConfiguration> 
       <destinations> 
       <add NAME="XXX" USER="XXX" PASSWD="XXX" CLIENT="XXX" LANG="EN"   ASHOST="mc0.sap.XXX.com" SYSNR="XXX" MAX_POOL_SIZE="XXX" IDLE_TIMEOUT="XXX"/> 
       <add NAME="QA" USER="XXX" PASSWD="XXX" CLIENT="XXX" LANG="EN"   ASHOST="XXX" SYSNR="XXX" MAX_POOL_SIZE="XXX" IDLE_TIMEOUT="100"/> 
       </destinations> 
      </DestinationConfiguration> 
      </ClientSettings> 
     </SAP.Middleware.Connector> 
     <startup useLegacyV2RuntimeActivationPolicy="true"> 
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> 
     </startup> 
     <appSettings/> 
     <system.web> 
      <compilation targetFramework="4.0" debug="true"/> 
      <httpRuntime/> 
     </system.web> 
     <system.serviceModel> 
      <behaviors> 
      <serviceBehaviors> 
       <behavior> 
       <!-- To avoid disclosing metadata information, set the values below to false before deployment --> 
       <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> 
       <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
       <serviceDebug includeExceptionDetailInFaults="true"/> 
       </behavior> 
      </serviceBehaviors> 
      </behaviors> 
      <protocolMapping> 
      <add binding="basicHttpsBinding" scheme="https"/> 
      </protocolMapping> 
      <serviceHostingEnvironment aspNetCompatibilityEnabled="true"   multipleSiteBindingsEnabled="true"/> 
     </system.serviceModel> 
     <system.webServer> 
      <modules runAllManagedModulesForAllRequests="true"/> 
      <!-- 
       To browse web app root directory during debugging, set the value below to true. 
       Set to false before deployment to avoid disclosing web app folder information. 
      --> 
      <directoryBrowse enabled="true"/> 
     </system.webServer> 
     </configuration> 
+0

你能分享为您服务,服务和端点行为的配置信息。 –

回答

0

您应该检查是否在你的配置文件中启用MEX。

例如(mex虽然http)。

在您的服务行为,你应该启用下列选项

<serviceMetadata httpGetEnabled="true" /> 

在您的端点列表,你应该添加以下

<endpoint address="/mex" binding="mexHttpBinding" 
     contract="IMetadataExchange" /> 

保存配置并重新运行。

+0

Tks,但我已经尝试过这个conf。没有成功。 – Andrew