尝试查找服务时发生错误 [英] an error occurred while attempting to find services

查看:196
本文介绍了尝试查找服务时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
创建WCF服务以及添加参考服务时
出现此消息(尝试查找服务时发生错误)
详细说说确保您的元数据
我的网络配置是:

Hello
When I create WCF service and when I add reference service
This message appear ( an error occurred while attempting to find services)
and in details is say make sure about your metadata
My web Config is:

<?xml version="1.0"?>
<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="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="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>


我的CS文件是


and my CS file is

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace MService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IMService
    {
        [OperationContract]
        string GetTime(int timeStrength);
    }
}




我不明白这个问题
有任何人知道和帮助吗

谢谢
最好的问候
Noor




I do not understand the problem
There are anyone know and help please

Thanks
Best regards
Noor

推荐答案

我认为您的WCF服务存在错误.尝试先构建WCF服务,然后检查是否有错误,然后进行修复.一旦能够正确编译WCF服务,就可以尝试添加服务引用.
I think there is an error in your WCF service. Try building the WCF service first and check if there are errors then fix it. Once you are able to compile your WCF service without an error, then you can try adding the service reference.


似乎您只定义了服务行为,而不是服务端点. web.config.

VS2010中的goto
是管理此配置的有用工具

>>工具| WCF服务配置编辑器

这将打开一个不错的小型经理应用程序,以帮助您使用web.config
It Looks like you have only defined a service behavior not the service, endpoint in the web.config.

a helpful tool to manage this config is in VS2010 goto

>> Tools | WCF Service Configuration Editor

that will open a nice little manager app to help you with your web.config


这篇关于尝试查找服务时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆