Im running a C# workflow
application.
I've added an aspx page UserUpdate.aspx
Also added a web api controller SynchronisePersonnelXmlFromAwsServiceController.cs
Using postman on a POST call if I enter
http://localhost/Workflow/RefreshPersonnel.aspx
I get the correct response the page is displayed in html.
However If I try to call the function TestCall()
in the SynchronisePersonnelXmlFromAwsServiceController.cs page with the following call
http://localhost/Workflow/SynchronisePersonnelXmlFromAwsServiceController/TestCall
I get a 404 not found -
<legend>Error Summary</legend>
<h2>HTTP Error 404.0 - Not Found</h2>
<h3>The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.</h3>
<legend>Most likely causes:</legend>
<ul>
<li>The directory or file specified does not exist on the Web server.</li>
<li>The URL contains a typographical error.</li>
<li>A custom filter or module, such as URLScan, restricts access to the file.</li>
</ul>
</fieldset>
</div>
<div class="content-container">
<fieldset>
<legend>Things you can try:</legend>
<ul>
<li>Create the content on the Web server.</li>
<li>Review the browser URL.</li>
<li>Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click
code is as follows:
namespace Workflow
{
public class SynchroniseFromAwsServiceController: ApiController
{
//// POST api/<controller>
[HttpPost]
public string TestCall()
{
string xmlFile = "Test XML Test";
string responseMsg = "Failed Import User";
if (!IsNewestVersionOfXMLFile(xmlFile))
{
responseMsg = "Not latest version of file, update not performed";
}
else
{
Business.PersonnelReplicate personnelReplicate = BusinessLogic.SynchronisePersonnel.BuildFromDataContractXml<Business.PersonnelReplicate>(xmlFile);
bool result = Service.Personnel.SynchroniseCache(personnelReplicate);
if (result)
{
responseMsg = "Success Import Sap Cache User";
}
}
return "{\"response\" : \" " + responseMsg + " \" , \"isNewActiveDirectoryUser\" : \" false \"}";
}
}
}