In class file
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "{ClientCode}/TTAddUKDividend?SAPersonCode={SAPersonCode}&SATaxYearCode={SATaxYearCode}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
SARestResponseInfo<SARestResponseBaseInfo> TTAddUKDividend(string ClientCode, int SAPersonCode, int SATaxYearCode, List<SADividendTranInfo> SADividendTranInfo);
in service file
public SARestResponseInfo<SARestResponseBaseInfo> TTAddUKDividend(string ClientCode, int SAPersonCode, int SATaxYearCode, List<SADividendTranInfo> SADividendTranInfo)
{
Logger.EnterFunction();
string AuthToken = string.Empty;
SARestResponseInfo<SARestResponseBaseInfo> response = new SARestResponseInfo<SARestResponseBaseInfo>();
try
{
IncomingWebRequestContext woc = WebOperationContext.Current.IncomingRequest;
AuthToken = woc.Headers["authtoken"];
RestNomismaSAManager manager = new RestNomismaSAManager(ClientCode);
response = manager.TTAddDividend(SAPersonCode, AuthToken, SATaxYearCode, SADividendTranInfo);
return response;
}
catch (RestException ex)
{
Logger.Error(ex);
}
catch (Exception ex)
{
Logger.Error(ex);
}
Logger.LeaveFunction();
return response;
}