1

我有一个在 IIS 上运行的 wcf 项目,该项目无法从 Internet 上的客户端访问。第二个项目是用 MVC c#4 razor 引擎编写的对互联网开放的网站。我做了很多工作,只是将数据从 api 控制器传递到服务客户端并返回。有没有办法生成代码?

假设我的 wcf 服务中的代码位于无法访问 Internet 的服务器上:

[ServiceContract]
    public interface IAlertsService
    {
        [OperationContract]
        void ApproveAlert(int ID);
        [OperationContract]
        bool IsAdditionalPackageRequired(int AlertID);
        [OperationContract]
        bool RemoveAlert(int ID);
        //ApproveAllAlerts
        [OperationContract]
        bool ApproveAllAlerts(int[] ID);
    }

我从网站 mvc4 做了服务参考,并想做控制器 api:

public class AlertsController : ApiController
{
   //here all methods to invoke wcf ...
}

有没有办法从服务参考生成 ApiControllers 代码?

4

0 回答 0