我有ASDService.svc
:
namespace StatusSimulator
{
[ServiceContract]
public class ASDService
{
[OperationContract]
public void DoWork()
}
[ServiceContract]
public interface IScheduleTables
{
[OperatonContract]
string getTable(string l, int r, int c)
[OperatonContract]
string getTable(string test)
[OperatonContract]
string createTable(List<string> lst, int r, int bal)
}
public class ScheduleTables:IScheduleTables
{
//Interface Implementation
}
}
web.config
:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="NewBehavior0">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="NewBinding0" />
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="NewBehavior0" name="StatusSimulator.ASDService">
<endpoint address="http://localhost:2405/ASDService.svc" binding="basicHttpBinding"
bindingConfiguration="NewBinding0" name="ASDEndpoint" contract="StatusSimulator.ASDService" />
<endpoint address="http://localhost:2405/ASDService.svc" binding ="basicHttpBinding"
bindingConfiguration="NewBinding0" name="ScheduleTableEndPoint" contract="StatusSimulator.IScheduleTables" />
</service>
</services>
</system.serviceModel>
我尝试过的绝对不会将接口暴露给服务。我唯一能看到的是ASDService.DoWork
。如何在预先存在的服务中实现其他类或接口?
我在配置中尝试了两个服务,多个端点。我尝试将接口嵌套在 ASDService 中。我在这里阅读的教程和帖子比我想说的要多。当它坐下来时,我收到了错误
在服务“ASDService”实施的合同列表中找不到合同名称“StatusSimulator.IScheduleTables”。
我很困惑,没有想法,如果这种情况继续下去,我将需要专业的帮助。