2012-01-05 35 views
0

当我尝试从开发服务器运行服务时出现以下错误。它在本地主机上运行良好。SSO保护的环境上的WCF服务部署。在本地运行良好,但在开发服务器上部署时失败

ServiceMetadataBehavior的HttpGetEnabled属性设置为true,HttpGetUrl属性是相对地址,但没有http基地址。提供http基地址或将HttpGetUrl设置为绝对地址。

之前得到了错误:

服务XXXXXXXXXXXXXXXXXX具有零的应用程序(非基础设施)的端点。这可能是因为没有为您的应用程序找到配置文件,或者因为在配置文件中找不到匹配服务名称的服务元素,或者因为服务元素中没有定义端点。

<bindings> 
     <basicHttpBinding> 
     <binding name="Binding1"> 
      <security mode="TransportCredentialOnly"> 
      <transport clientCredentialType="Windows"/> 
      </security> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 


<serviceBehaviors> 
     <behavior name ="XXXXX"> 
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
      <serviceMetadata httpGetEnabled ="false" httpGetUrl = ""/> 
      <!-- 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> 
+0

这很可能是服务上的配置文件,而不是客户端的问题。您需要发布您的配置文件或您用于配置服务端点的代码,以便我们提供更具体的答案。 – 2012-01-05 19:08:27

+0

我已经添加了使用的Web.Config的一部分。 – 2012-01-05 19:13:01

回答

0

这可能是在配置文件中的服务的地址具有服务器名称“localhost”的

当您复制这severX并尝试使用serverX地址访问它,它无法使用该服务器名称在配置文件中找到地址。

0

您的客户端配置中没有任何<services/><clients/>定义在其中。你怎么能期望它的工作?