Created
July 3, 2017 14:47
-
-
Save davecra/04df2b3a841bbc8014ba9573b448d613 to your computer and use it in GitHub Desktop.
Web Service Controller for an OfficeJS Add-in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// CORE SERVICE FUNCTION | |
/// This function will take a web request which will contain the command the caller wants | |
/// to initate and then the paramaters needed for that call. We enter a SELECT statement | |
/// below to determine the command given and we then call the proper helper function | |
/// </summary> | |
/// <param name="request"></param> | |
/// <returns></returns> | |
[HttpPost()] | |
public WebServiceResponse WebService(WebServiceRequest request) | |
{ | |
WebServiceResponse response = null; | |
switch(request.Command) | |
{ | |
case "DoFunctionA": | |
return functionA(request.Params); | |
case "DoFunctionB": | |
return functionB(request.Params); | |
case "DoFunctionC": | |
return functionC(request.Params); | |
case "DoFunctionD": | |
return functionD(request.Params); | |
} | |
response = new WebServiceResponse(); | |
response.Message = "Unknown command"; | |
return response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment