Hello Guys,
I’m using Relax to defined some web services, and I’ve added the resource which looks like this:
resource(
pattern = “/services”,
handler = “services”,
action = “{‘post’:‘save’, ‘put’:‘save’, ‘delete’:‘delete’}”,
Description = “I represent an account services.”,
methods = “POST,PUT,DELETE”,
parameters = [
{name=“service_group_id”,description=“I’m the ID of the service group to add the seivce too.”,required=“false”},
{name=“service_id”,description=“I’m the ID of the service to save/delete”,required=“false”},
{name=“name”,description=“The name of the service.”,required=“false”}
]
);
Which I intend to route different request types (PUT, DELETE) to different methods within the ‘services’ handlers.
Now, relax gives me a generated route which looks like this:
addRoute(pattern="/services", handler=“services”, action="{‘get’:‘list’, post’:‘save’, ‘put’:‘save’, ‘delete’:‘delete’}");
Which I have dropped into my routes.cfm file. However, when making requests to this, I get an exception thrown back at me.
Application Execution ExceptionError Type: Expression : [N/A]
Error Messages: Element services.{‘get’ is undefined in a CFML structure referenced as part of an expression.
Can anyone suggest what might be going wrong here?
I’ve been looking through the docs at the SES stuff trying to see if that route definition is right, but I can’t find the information I’m looking for.
Thanks.
Robert