本文介绍了尝试查找服务时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
创建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
推荐答案
这篇关于尝试查找服务时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!