嗨,我试图在测试客户端的win 8计算机上运行我的WCF服务,然后收到该消息:
无法添加服务。可能无法访问服务元数据。确保您的服务正在运行并公开元数据。
错误:无法从http:// local host:50024 / PulpoService.svc获取元数据如果这是您有权访问的Windows(R)Communication Foundation服务,请检查您是否已在指定地址启用了元数据发布。有关启用元数据发布的帮助,请参阅http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange错误URI上的MSDN文档:http://本地主机:50024 / PulpoService.svc元数据包含无法解析的引用:'http:// local host :50024 / PulpoService.svc”。远程服务器返回意外响应:(405)方法不允许。远程服务器返回错误:(405)方法不允许.HTTP GET错误URI:http://本地主机:50024 / PulpoService.svc下载'http://本地主机:50024 / PulpoService.svc'时出错。请求失败,HTTP状态为404:Not Found。
我尝试了很多我在网上找到但没什么用的东西,事情是服务在Windows 7电脑上工作!
这是我的代码:
public class PulpoService : IPulpoService
{
PulpoBUS _pulpoBUS;
public PulpoService()
{
_pulpoBUS = new PulpoBUS();
}
public List<string> Register(UserVO user,string activationCode)
{
return _pulpoBUS.Registration(user,activationCode);
}
public List<ProductVO>[] Login(string UserName, string Password)
{
return _pulpoBUS.Login(UserName,Password);
}
public bool AddDevice(ProductVO product)
{
return _pulpoBUS.AddDevice(product);
}
public int[] ShowStatistics(UserVO client)
{
return _pulpoBUS.ShowStatistics(client);
}
public List<string> GetCommands(BoardVO Board)
{
return _pulpoBUS.GetCommands(Board);
}
public bool RunCommand(UserVO client, CommandVO command)
{
return _pulpoBUS.RunCommand(client, command);
}
public string GetData(int value)
{
return string.Format("You entered: {0}", value);
}
public CompositeType GetDataUsingDataContract(CompositeType composite)
{
if (composite == null)
{
throw new ArgumentNullException("composite");
}
if (composite.BoolValue)
{
composite.StringValue += "Suffix";
}
return composite;
}
}
这是我的配置
<services>
<service behaviorConfiguration="PulpoService.Service1Behavior"
name="PulpoService.PulpoService">
<endpoint address="" binding="basicHttpBinding" contract="PulpoService.IPulpoService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="PulpoService.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false 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>
请帮帮我,我真的不知道该怎么做了:(