silverlight&x2B;wcf部署-开发端口干扰

silverlight&x2B;wcf部署-开发端口干扰,wcf,silverlight,Wcf,Silverlight,我有一个silverlight 5应用程序,在我的web项目中有一个(非RIA)WCF服务。 当然,它在我的机器上工作得很好;-)-Windows 7,但当我将其部署到我的开发服务器(一个上面有.NET 4的WinServer2008,使用IIS 6)时,应用程序似乎没有完成加载-我得到了最初的silverlight加载。。。然后我只有一个空白屏幕。我没有看到任何错误消息 我认为问题可能在于Silverlight应用程序假定WCF服务的端口与我机器上的端口相同(46133) 我在网上看到一些文章

我有一个silverlight 5应用程序,在我的web项目中有一个(非RIA)WCF服务。 当然,它在我的机器上工作得很好;-)-Windows 7,但当我将其部署到我的开发服务器(一个上面有.NET 4的WinServer2008,使用IIS 6)时,应用程序似乎没有完成加载-我得到了最初的silverlight加载。。。然后我只有一个空白屏幕。我没有看到任何错误消息

我认为问题可能在于Silverlight应用程序假定WCF服务的端口与我机器上的端口相同(46133)

我在网上看到一些文章说,应该在servicerences.ClientConfig中将端点的地址设置为../Service.svc。如果我将其更改为此并部署,则不会有任何更改

在web项目的属性中的web选项卡上,我已选中Use Visual Studio Development Server和特定端口46133虚拟路径=/

我认为部署的站点仍在尝试使用端口46133,因为Fiddler在clientaccesspolicy.xml文件中显示了一个502红色项,其中包含消息

[Fiddler]到本地主机的套接字连接失败
错误代码:10061
无法建立连接,因为目标计算机主动拒绝127.0.0.1:46133

有什么建议吗

以下是servicerences.ClientConfig文件:

<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IService" maxBufferSize="2147483647"
                    maxReceivedMessageSize="2147483647">
                    <security mode="TransportCredentialOnly" />
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="../Service.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IService" contract="ServiceReference1.IService"
                name="BasicHttpBinding_IService" />
        </client>
    </system.serviceModel>
</configuration>

我的web.config是

 <system.web>
    <httpRuntime executionTimeout="180" />
    <compilation debug="true" targetFramework="4.0" />
    <customErrors mode="Off"/>
  </system.web>

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpStreamingBinding" maxBufferSize="2147483647"
          maxReceivedMessageSize="2147483647" transferMode="Streamed" receiveTimeout="01:00:00" sendTimeout="01:00:00">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Ntlm" />
            <!--<transport clientCredentialType="Windows" />-->
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>

    <client />

    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <serviceHostingEnvironment
        multipleSiteBindingsEnabled="true" />

    <services>
      <service name="CitationAir.MissionPlanning.WebService.Service">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpStreamingBinding"
            contract="CitationAir.MissionPlanning.WebService.IService" />
      </service>
    </services>
  </system.serviceModel>

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>


我可能遗漏了一些内容,但我看不到可供服务侦听的地址或基本地址。我也不熟悉WCF,但我相信当您部署到生产服务器时,它应该有一个,并且客户端配置也需要在地址中看到这一点。我认为fiddler的结果是基于您的客户端配置设置的,我将其视为“./Service.svc”,这可能就是您看到localhost内容的原因。请尝试在部署服务器中将服务器和客户端配置设置为相同的内容。如果部署服务位于abc.com,请尝试将服务和客户端地址设置为:http://www.abc.com/service.svc(假设您的服务位于根目录,没有空格,stackoverflow会将其转换为链接)。它是在网页上的项目设置中配置的:在web项目的属性中的“web”选项卡上,我已选中“使用Visual Studio Development Server”,特定端口46133,虚拟路径=/添加ServiceReferences.clientconfig中的相对地址的功能正是为了我试图避免的事情而添加的。../Service.svc与XAP文件的位置有关。