.netwcf

Can you add WCF Endpoint to .NET API


Had a customer ask me this today. Honestly it threw me, so I wanted to put it out there for someone who has had more coffee than I have today to answer.

They have an old .NET Website Project (WSP) which has WCF endpoints in it. They also have a new "server" which is .NET API based.

Can we add WCF endpoints to the .NET API project?


Solution

  • Best solution in this case is to create a proxy between the API and WSP like this: API -> WCF proxy -> WSP.

    WSP calls the proxy which in turns calls the API. The proxy wraps the API response into a WCF contract and passes it to WSP.