2011-06-23 70 views
1

我一直在试图解决这个问题近2天,似乎没有取得很大进展。我有一个WCF服务(在VWD2008中用VB开发)。在本地运行时,我可以通过指向WSDL页面的链接查看标准的.svc帮助页面。WCF/SSL返回IIS7中的空白页

我把它移到了一个服务器,并在尝试加密之前重新测试 - 仍然可以正常工作。

然后我建立了自签名证书,这是问题似乎开始的地方。我知道我的服务器和我的电脑之间的证书认证正常(客户端证书在IIS7上设置为必需),因为我可以在使用https时访问简单的.aspx页面。在这个阶段,当我尝试浏览到的.svc第2点的事情发生 - 在IE中一个空白页将被返回,并在FF我收到以下消息黄色背景

XML Parsing Error: no element found 

Location: https://www.database-direct.com/vs.svc 

Line Number 1, Column 1: 

从我已经读过,区别仅在于FF处理空白页的方式不同。

我很确定我的web.config文件是正确的,因为它几乎是成功运行的其他服务的副本(尽管在运行IIS6的不同服务器上 - 配置文件中是否有任何区别? )

<?xml version="1.0"?> 

<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use 
    the Website->Asp.Net Configuration option in Visual Studio. 
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
--> 
<configuration> 
    <configSections> 
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
     <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
     <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
     <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
      <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> 
      <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
      <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
      <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
     </sectionGroup> 
     </sectionGroup> 
    </sectionGroup> 
    </configSections> 
    <appSettings/> 
    <connectionStrings /> 
    <system.web> 
    <!-- 
      Set compilation debug="true" to insert debugging 
      symbols into the compiled page. Because this 
      affects performance, set this value to true only 
      during development. 

      Visual Basic options: 
      Set strict="true" to disallow all data type conversions 
      where data loss can occur. 
      Set explicit="true" to force declaration of all variables. 
     --> 
    <compilation debug="true" strict="false" explicit="true"> 
     <assemblies> 
     <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
     <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
     </assemblies> 
    </compilation> 
    <pages> 
     <namespaces> 
     <clear/> 
     <add namespace="System"/> 
     <add namespace="System.Collections"/> 
     <add namespace="System.Collections.Specialized"/> 
     <add namespace="System.Configuration"/> 
     <add namespace="System.Text"/> 
     <add namespace="System.Text.RegularExpressions"/> 
     <add namespace="System.Linq"/> 
     <add namespace="System.Web"/> 
     <add namespace="System.Web.Caching"/> 
     <add namespace="System.Web.SessionState"/> 
     <add namespace="System.Web.Security"/> 
     <add namespace="System.Web.Profile"/> 
     <add namespace="System.Web.UI"/> 
     <add namespace="System.Web.UI.WebControls"/> 
     <add namespace="System.Web.UI.WebControls.WebParts"/> 
     <add namespace="System.Web.UI.HtmlControls"/> 
     </namespaces> 
     <controls> 
     <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
     </controls> 
    </pages> 
    <!-- 
      The <authentication> section enables configuration 
      of the security authentication mode used by 
      ASP.NET to identify an incoming user. 
     --> 
    <authentication mode="Windows"/> 
    <customErrors mode="Off"/> 
    <!-- 
      The <customErrors> section enables configuration 
      of what to do if/when an unhandled error occurs 
      during the execution of a request. Specifically, 
      it enables developers to configure html error pages 
      to be displayed in place of a error stack trace. 

     <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> 
      <error statusCode="403" redirect="NoAccess.htm" /> 
      <error statusCode="404" redirect="FileNotFound.htm" /> 
     </customErrors> 
     --> 
    <httpHandlers> 
     <remove verb="*" path="*.asmx"/> 
     <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
     <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
     <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> 
    </httpHandlers> 
    <httpModules> 
     <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    </httpModules> 
    </system.web> 
    <system.codedom> 
    <compilers> 
     <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 
     <providerOption name="CompilerVersion" value="v3.5"/> 
     <providerOption name="OptionInfer" value="true"/> 
     <providerOption name="WarnAsError" value="false"/> 
     </compiler> 
    </compilers> 
    </system.codedom> 
    <!-- 
     The system.webServer section is required for running ASP.NET AJAX under Internet 
     Information Services 7.0. It is not necessary for previous version of IIS. 
    --> 
    <system.webServer> 
    <validation validateIntegratedModeConfiguration="false"/> 
    <modules> 
     <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    </modules> 
    <handlers> 
     <remove name="WebServiceHandlerFactory-Integrated"/> 
     <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
     <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
     <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    </handlers> 
    </system.webServer> 
    <system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="wsHttpEndpointBinding"> 
      <security mode="Transport"> 
      <transport clientCredentialType="Certificate"/> 
      <message clientCredentialType="None"/> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="VSco.VSBehavior" name="VSco.VS"> 
     <endpoint address="https://www.url.com/VS.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpEndpointBinding" name="wsHttpEndPoint" contract="VSco.IVS"/> 
     <endpoint address="mex" binding="wsHttpBinding" bindingConfiguration="wsHttpEndpointBinding" name="mexEndpoint" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="VSco.VSBehavior"> 
      <serviceCredentials> 
      <serviceCertificate findValue="client" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/> 
      </serviceCredentials> 
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
      <serviceMetadata httpGetEnabled="false" 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> 
    </system.serviceModel> 
</configuration> 

从我已经从寻找到这个看,它会建议某种IIS的设置问题,我认为,作为实际的服务似乎工作确定。我能想到的唯一的另一件事来检查是处理程序映射,但他们检查了OK - svc-ISAPI-2.0-64映射对*.svc

如果任何人有任何进一步的建议,我怎么能调试这(我已经使用Fiddler检查,很简单地获得页面加载状态200)或可能导致它我会非常感激!

+0

你最终解决了这个问题吗? – John

回答

1

我刚刚有这个问题。我认为是因为在IIS中MIME映射中缺少svc。

为了解决此问题,您需要运行“\%windir%\ Microsoft.NET \ Framework \ v3.0 \ Windows Communication Foundation \ ServiceModelReg.exe -i”。它会创建所需的.svc映射。

如果你在64位,它的Framework64

+0

感谢您的回答 - 我将有机会在本周晚些时候进行测试,并会回复您。 – allanmayberry88

+0

不幸的是,这对我来说没有什么不同 – allanmayberry88

+0

我跑了这个相同的声明,并没有为我解决这个问题。我为Framework 64和x86运行了这个,没有运气 –