在单个服务中提供多个接口

时间:2012-03-02 15:20:15

标签: wcf web-services

我想将服务合同与其属性分开。

示例:

IWirelessService 
IWiredService 

我想在IWirelessService中实现IRasadService,但是当我将wsdl添加到wcf测试客户端时,会出现以下错误:

Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata.

我只想提供IRasadService作为我的主要网络服务。我怎么能这样做?

相关守则:

[ServiceContract]
public interface IWirelessService
{
    [OperationContract]
    void AddUser();
}

public class WirelessService : IWirelessService
{
    UserProvider userProvider;

    #region User Operations
    public void AddUser()
    {
        throw new NotImplementedException();
    } 
}

[ServiceContract]
public interface IRasadService :IWirelessService
{
    [OperationContract]
    BoxRasadWCFReturn GetDataUsingDataContract(CompositeType composite);

    // TODO: Add your service operations here
}

0 个答案:

没有答案