I am trying to develop a webservice that will be called by a button or link in an email. So the webservice call needs to be contained within one URL link.
I can get this working as a GET, but as a POST I am having trouble with the syntax.
I need to pass it a passenger ID as follows:
[creatio URL]/0/rest/UsrManifestPassengerFeedback/insertPassengerFeedback?passengerID=abcd
I am getting Method Not Allowed and I'm pretty sure it is just an issue with my URL syntax or something about the method definition, since as a GET it works fine.
namespace Terrasoft.Configuration.UsrManifestPassengerFeedback { using System; using System.ServiceModel; using System.ServiceModel.Web; using System.ServiceModel.Activation; using Terrasoft.Core; using Terrasoft.Web.Common; using Terrasoft.Core.Entities; [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] public class UsrManifestPassengerFeedback: BaseService { // Link to the UserConnection instance required to access the database. private SystemUserConnection _systemUserConnection; private SystemUserConnection SystemUserConnection { get { return _systemUserConnection ?? (_systemUserConnection = (SystemUserConnection)AppConnection.SystemUserConnection); } } // A method that returns the contact's ID by its name. [OperationContract] [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insertPassengerFeedback(string passengerID){ return "failure"; } } }
Like
1 comments
17:06 Sep 09, 2022
Hello Heather,
Please take a look at this article. There you can find an example on how to call your web service.
Show all comments