Try our conversational search powered by Generative AI!

How to add WebServiceHost (POST/GET) support in EPIServer plugin?

Vote:
 

I have a C# class project which is my EpiServer plugin. I added a reference to my plugin from the standard Alloy web service project in order to debug.

I wonder how I can set up a WebServiceHost in my plugin, so that I from my plugin's JavaScript code can post and get data based on user's interaction. The reason I need this is that I have some javascript UI interaction with the user, and when user hits a button I need to create a token which I only cna do in C#.

Do I have to add a new web service project and bundle that with my plugin (if this is possible), or does my plugin have access to set up an endpoint through Epi framework?

There is also the possibility to get points for answers: http://stackoverflow.com/questions/31786325/how-to-add-webservicehost-post-get-support-in-episerver-plugin

#131748
Aug 04, 2015 17:05
Vote:
 

Have you looked into using ASP.NET Web API for your endpoints? It's much easier to get up an running than anything WCF in my experience: https://www.epinova.no/en/blog/aspnet-web-api-in-episerver-cms-7-projects/

#144581
Feb 15, 2016 21:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.