I'm trying to develop a simple REST client to execute a workflow in vCO. I'm using perl and the REST::Client module, which is pretty straight forward. I can retrieve the inventory and definition objects for my target workflow, but when I try to POST an execution, I get an error report back stating:
The request sent by the client was syntactically incorrect ().
I am using JSON (as that is both the default output from vCO if no Content-Type is specified and my personal preference), and the documentation on JSON formatting is quite sparse compared to the supplied XML documentation. The docs describe the execution-context as follows:
{ "parameters" : [ { "name" : "...", "type" : "...", "description" : "...", "scope" : "local", "value" : { } }, ... ] }
My workflow accepts two string parameters for input and returns one string parameter as output. I've read that the scope and description fields are optional, and I am omitting both. Clearly however, I am missing something necessary about the structure of the execution-context. Can anyone help shed some light on this?
Full debugging:
<html><head><title>JBossWeb/2.0.1.GA - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The request sent by the client was syntactically incorrect ().</u></p><HR size="1" noshade="noshade"><h3>JBossWeb/2.0.1.GA</h3></body></html>
There was an issue with the deserialization of the value from JSON format, it is fixed and will be available in 5.1 U1 release.
This is a total shot in the dark, because I don't know JSON, but the returns I get from XML gets on previous executions of workflows return string parameters similiar to this:
I suspect the real issue is the format of value is "value":{....} but again... I don't know JSON.
HTH
Just noticed a critical typo in my reply, dropped a colon... corrected below
FWIW this is the actual return from a workflow for a string parameter named "description":
{"name":"description","value":{"value":"Your text goes here","objectType":"string"},"type":"string","scope":"LOCAL"}
Good insight on the structure of the value parameter, BillSkulley, thank you for that. Sadly, the documentation completely omits this detail. However, I tried amending my code accordingly and am still getting the same error back from Orchestrator. I think I will follow this up with a ticket to my support representative.
There was an issue with the deserialization of the value from JSON format, it is fixed and will be available in 5.1 U1 release.
Thank you for the information! Looking forward to U1's release.