Hello,
I'm writing a small custom app using the REST services for the first time. Everything was going great until I ran into a situation where I needed to call a local procedure. I can't seem to figure out how to pass the correct types into the Post call for the serialization to work. Does anyone have a code example for calling a local procedure with the REST services? Any help is greatly appreciated!
Thanks in advance,
Sean
I usually do it something like this!
//Create User Credentials based on user account accessing REST Services
UserCredentials userCredentials = new UserCredentials(strUsername, strSecurity, strMachine, strPassword);
String strServer = <Your Server>;
String strProcedureID = "22";
//Use the Execute Data Service to get data from the REST Service
var response = RestClient.At("https://" + strServer + "/TessituraService/Custom/Execute/").For(userCredentials)
.Post("<LocalProcedureRequest>" +
"<Parameters>@customer_no=" + strMembershipNo + "</Parameters>" +
"<ProcedureId>" + strProcedureID + "</ProcedureId>" +
"</LocalProcedureRequest>");
//Return the Response Code. This will determine if the request has been sucessful
String strResponseCode = response.StatusCode.ToString();
if (strResponseCode.Equals("OK"))
{
//GetData From the XML and Insert into a Dataset
DataSet dsResponse = new DataSet();
dsResponse.ReadXml(new XmlTextReader(new StringReader(response.ResponseBody.ToString())));
}