Initiate Orchestrator workflow through REST/Post with JSON body

I am trying to initiate a workflow custom Orchestrator by issuing a MESSAGE from a client (in this case a violin) with the parameters in JSON format in the body.

So far, I have been unable to get what anyone other than a 400 Bad Request and a "the request sent by the client was syntactically incorrect ()." in response.

My environment is

vCenter Orchestrator 5.1.1 Build 2942

Java version 1.6.0.26

The rest 1.0.1 Plugin is installed

To verify that I am indeed able to initiate a workflow via a POST, I tested with XML in the MESSAGE body, just like a validation test. Given a data center TestDC2 I send the following

POST https://10.144.20.62:8281/api/stream/d7614e92-0578-42b6-9c1f-04bd8a0533d3/executions / HTTP/1.1

Authorization: Basic XXXXXXXXXXXXXXXXXXXX

User-Agent: Mozilla/5.0 (Windows NT; Windows NT 6.1; en - us) WindowsPowerShell/3.0

Content-Type: application/xml

Host: 10.144.20.62:8281

Content-Length: 311

Connection: Keep-Alive

" <-xmlns = execution context" http://www.VMware.com/VCO "> "

< Parameters >

< name of the parameter = "datacenterName" type = "string" >

< string > TestDC2 < / string >

< / parameter >

< name of the parameter = "customerVMFolder" type = "string" >

< string > aNewFolderVMFolder < / string >

< / parameter >

< / Parameter >

< / execution context >

I get a response of success

HTTP/1.1 202 accepted

Location: https://10.144.20.62:8281/api/stream/d7614e92-0578-42b6-9c1f-04bd8a0533d3/executions/ff8080813e847992013fa4ac4c2b046f /

ETag: "0d41d8cd98f00b204e9800998ecf8427e".

Content-Length: 0

Date: Wednesday, July 3, 2013 13:15:22 GMT

Server: vCO Server

and 'aNewFolderVMFolder' folder is created under TestDC2

The JSON equivalent

POST https://10.144.20.62:8281/api/stream/d7614e92-0578-42b6-9c1f-04bd8a0533d3/executions / HTTP/1.1

Authorization: Basic XXXXXXXXXXXXXXXXXXXX

User-Agent: Mozilla/5.0 (Windows NT; Windows NT 6.1; en - us) WindowsPowerShell/3.0

Content-Type: application/json

Host: 10.144.20.62:8281

Content-Length: 173

Connection: Keep-Alive

{

'settings':]

{'name': "datacenterName", "type": "string", "value": "TestDC2"},

{'name': "customerVMFolder", "type": "string", "value": "aNewFolderVMFolder"}

]

}

gives a bad request

HTTP/1.1 400 Bad Request

Content-Type: text/html; charset = utf-8

Content-Length: 965

Date: Wednesday, July 3, 2013 13:21:02 GMT

Connection: close

Server: vCO Server

< html > < head > < title > JBossWeb/2.0.1.GA - error report < / title > < style > <!-H1 {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76; do-size: 22px ;}} H2 {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76; do-size: 16px ;}} H3 {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76; do-size: 14px ;}} BODY {do-family: Tahoma, Arial, without serif; color: black; background-color: white ;}} B {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76 ;}} P {do-family: Tahoma, Arial, without serif;: white background; color: black; do-size: 12px ;}} A {color: black ;}} B.SID {color: black ;}} HR {color: # 525 76 ;} - > < / style > < / head > < body > < h1 > State HTTP 400 - < / h1 > < HR size = "1" = "noshade" noshade > < p-type > < b > < /b > < /p > < p > < b > report 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 >

After reading The POST CURL with vCO 5.1 REST API

I also tried

POST https://10.144.20.62:8281/api/stream/d7614e92-0578-42b6-9c1f-04bd8a0533d3/executions / HTTP/1.1

Authorization: Basic YWRtaW46U2E1YWRtMW4 =

User-Agent: Mozilla/5.0 (Windows NT; Windows NT 6.1; en - us) WindowsPowerShell/3.0

Content-Type: application/json

Host: 10.144.20.62:8281

Content-Length: 266

Connection: Keep-Alive

{

'settings':]

{'name': 'datacenterName', 'type': 'string', 'field': 'local', 'value': {"value": "TestDC2", 'objectType': 'chain'}},

{'name': 'customerVMFolder', 'type': 'string', 'field': 'local', 'value': {"value": "KamTestFolder", "objectType": "string"}}

]

}

with exactly the same results

What I am doing wrong?

Burke - State 415 code indicates the shift in the type of media, which is expected, because there is no Content-Type header

KeyboardSlappingMonkey - I think that the body of the request should be something like the following (note the difference in the format of the value)

{'settings': [{'name': 'datacenterName', 'type': 'string', 'value': {'chain': {'value': 'TestDC2'}}}, {"name": "customerVMFolder", "type": "string", "value": {'chain': {'value': 'KamTestFolder'}}}]}

and you must pass the Content-Type header with the value application/json;v=5.1.1

I hope this helps.

Tags: VMware

Similar Questions

  • Consume Web service REST to 8.52 PT with JSON body

    We are on tools 8.52 and try to consume a web service from REST to the external address.  I have successfully built a document and I am able to use the GET operation (where no body is necessary), but for the POST, I need to be able to provide the body in JSON format.  8.52 tools is not supported with native support for JSON, but it should always be possible generate the JSON string manually, it should not?

    Has anyone else done this?

    I thought you said you were on PeopleTools 8.52. Support JSON for Documents has not been added up to 8.53. Add an element with the attribute psnonxml to your load XML and put your JSON in this element. Integration Broker will remove XML Integration Broker exit. You can see an example here: http://jjmpsj.blogspot.com/2011/10/rest-like-peoplesoft-services.html.

  • MAF: Using rest with JSON

    Hi all

    I use jdev 12.1.3

    While practicing the CRG, I am facing a problem with the help of rest with JSON response.

    I followed this: https://blogs.oracle.com/adf/entry/simple_get_operation_with_json

    A slight difference is that I already have a Restful services with JSON response I have hace created in Oracle Apex.

    Following the example, I followed the steps but when I open the application in the Android emulator after deployment, I don't get all the lines, I dropped the data as MAF List View control.

    I don't get all the lines and I am showing 0 in the first row.

    Please let me know what could be the problem.

    Kind regards

    KP

    See your json output you can't edit it directly to the employee object.

    First you must get the json object, then json for the elements array, then one by one, you must create the Employee object.

    In addition, you see 0 because for a PGE no integer, the default value is 0 because the data are not filled the json output.

    Try the code below and your question should get solved:

    answer = restServiceAdapter.send("");

    JSONObject jsonObj = new JSONObject (response);

    JSONArray empList = (JSONArray) jsonObj.get ('items');

    int size = empList.length ();

    ArrayList empArray = new ArrayList();

    for (int i = 0; i)

    try {}

    Employee emp = new Employee();

    JSONObject result = empList.getJSONObject (i);

    String empno = (String) result.get ("empno");

    Ename string = (String) result.get ("ename");

    emp.setEmpno (Integer.parseString (empno));

    emp.setEname (ename);

    empArray.add (emp);

    } catch (System.Exception e)

    {}

    Employee [] e = (Employee []) empArray.toArray (New Employee [empArray.size ()]);

    e return;

    Your method signature must be:

    public employee [] fetchEmpDetails()

    With the signature above you return an employee table which can be used for a list view.

    Let me know if it helps.

    Kind regards

    Deepak

  • How to get the value of the predefined list of input parameters of a workflow of another workflow of operation REMAINS (element JSON) output. The pointers or the exisitng resource/code will be of great help

    I have a workflow in which one of the input parameters is a predefined list of element. The predefined list of items must come from another workflow of operation REMAINS to GET type (element JSON) output.

    You just wrap it in an action that has an output which is an array of the same type as input.  Instead of using the plugin of rest, you might be able to use the scriptable Url to take the exit that would work according to the rest interface with which you interact.  Something like this:

    var restOperation = 'yourrestservice.com/resoperation/... '. ' / / whatever your full url is if it requires no authentication

    var myUrl = new URL (restOperation); Create the object URL

    var result = myUrl.getContent (); get the content

    var jsonParsed = JSON.parse (result); assuming that the result is a string that must be converted to an

    treatment jsonParsed and return an array of the appropriate type

    return (myPreDefinedList);

  • APEX5, get feet wet with json?

    Instead of Googling happy myriad of hits from json apex SF, I dare ask for advice on getting my feet wet with json and APEX5.

    1 where should json-related question - forums APEX5 or ADR or SQL

    2. What is the best handson tutorial to start?

    3 What kind - of json application tests that APEX5 instance is configured correctly to provide & consume json (can I say so?).

    4th another point to ponder?

    Rgrds Paavo

    PS. I know it's really read the fantastic manual, but I'm sure there are a lot of things to operate

    Hi paavo.

    Paavo wrote:

    Instead of Googling happy myriad of hits from json apex SF, I dare ask for advice on getting my feet wet with json and APEX5.

    1 where should json-related question - forums APEX5 or ADR or SQL

    If you have any question regarding:

    Oracle documentation:

    Blog links:

    and you can find many others.

    Kind regards

    Kiran

  • How to extract all the accounts through REST field

    I'm fighting with the REST API calls, I want to extract all records with all of the fields available in them through REST. That's what I've tried so far:

    $client = new EloquaRequest ($eloqua_site, $eloqua_user, $eloqua_password, 'https://secure.eloqua.com/API/REST/1.0');

    $accounts = $client-> get ('/ data/accounts? search = * & count = 1000 & page = 1 & depth = complete ');

    now when I print $accounts it gives only this result:

    [1] = > stdClass Object

    (

    [type] = > account

    [id] = > 365

    [converted] = > 1372683444

    [depth] = > full

    [description] = >

    [name] = > Verkeer in Waterstaat

    [updatedAt] = > 1372683444

    [Address1] = >

    [address2] = >

    [address3] = >

    [businessPhone] = >

    [City] = >

    [country] = >

    [fieldValues can only be] = > Array

    (

    )

    [PostalCode] = >

    [province] = >

    )

    There are more number of fields available under 'Accounts' that which is visible here. All custom fields not is also not recovered, unknown reason!

    Your help is very appreciated to resolve this matter as soon as possible.

    Using version 2.0 of the rest what API should return all the field values:

    GET /Api/rest/2.0/data/accounts?depth=complete&count=1000

  • Hey guys, I just reset my mac OX system and wiped and Adobe, turned off my computer. I can go through re install with you?

    Hey guys, I just reset my mac OX system and wiped and Adobe, turned off my computer. I can go through re install with you?

    [Duplicate message deleted... post the same question more than once is confusing... MOD]

    [This is an open forum, not a direct line to Adobe support... you have to wait a response]

    You install exactly in the same way you did the 1st time... Put your disc in the drive, and enter your serial number when asked

    .

    Download & install instructions https://forums.adobe.com/thread/2003339 can help

    -includes a way to go to a page to download the Adobe programs if you do not have a disk or drive

    -Cloud desktop http://helpx.adobe.com/creative-cloud/help/creative-cloud-desktop.html

    -Cloud Getting Started https://helpx.adobe.com/creative-cloud.html

    -you will need to enter your original serial number during the installation for non-Cloud programs

    - or kglad links in response to #1 here can help https://forums.adobe.com/thread/2081216

    Also go to https://forums.adobe.com/community/creative_cloud/creative_cloud_faq

  • Example of a simple RESTful POST service?

    Hi all

    I wish Oracle had provided an example simple RESTful POST service and does part of the Apex 4.2.x documentation rather than put the only example of a POST in the Apex listener (now Oracle Data Services) developer documentation.  Also, why not complete the lovely examples in the "oracle.example.hr" with additional methods supported as POST instead of using a more complex example in the documentation for the listener - the sample picture gallery?

    So my question is: someone at-it a fine example of text, data digital POST method that includes the creation of RESTful services and then the code needed to perform the JOB to the RESTful service - with an example application Apex or even the content of the URL which must be passed to the RESTful service to get the data in the table (for example, EMP or models of tables DEPT).

    Thank you

    PM

    All,

    Decided to meet myself in case someone else was looking to meet that time - found a very good example, exactly as I described above.

    I was able to create the RESTful POSITION myself, but this thread has been very helpful in leading me to test the MESSAGE in an application and create the Web service reference.

    RESRful POST method

    I guess that it does not appear in the search because of the misspelling in the title of the question.

    Thanks Anthony!

    PM

  • addEventListener leads to 1119: access to property may be undefined "myEvent" through a reference with static type class

    I use a main application mxml and a component

    I said a metatag in the component

    [Event(name ="myEvent"type ="events.myEvent")]

    I have this hurry of the component

    I have a listener on the main application

    componentid.addEventListener (Event.MyEvent, gotoMyFunction, true);

    I get a compile error, no matter what I do

    1119: access of property may not set through a reference with static type class

    Any ideas. I had at least 3 examples and in all cases I end up with the same result

    Put [event (name = "myLoadDoneEvent" type = "events.loadDoneEvent")] before the class declaration:

    public class loadDoneEvent extends event

    [Event (name = "myLoadDoneEvent" type = "events.loadDoneEvent")]

    If this post answers your question or assistance, please mark it as such.

  • How do I get sound through my iMac with a USB turntable?

    How do I get sound through my iMac with a USB turntable?

    You need something like this:

    https://griffintechnology.com/us/iMic

  • Aspire V3 - 571 won't boot past POST with installed HARD drive

    I am a PC repair technician and work on computers for almost 20 years and this has me completely confused. My laptop Aspire V3-571-6643 was working fine until just recently. The show the Acer and the system will fit on screen, and then restarts immediately. He'll stay in this loop of reboot until stopped manually.

    I cleaned and reinstall the RAM module and also tried in both slots without change. I was able to access BIOS and determined the readers and all parameters are correct and even reset to the factory settings without change. I then removed the HARD drive used in a docking station to determine if the drive was salvagable. Everything reads well and passed short and long tests through SeaTools. With the disk installed HARD, the system attempts to start on CD/USB, but after his withdrawal the system boots on a CD very well. I then ran a full scan using Eurosoft Pc Check and all is well. I reinstalled the HARD drive and get immediately the loop of reboot again.

    At this point the motherboard and drive the two test very well independently but do not go to work together. My only guess is that the motherboard is no longer providing enough power for all components and crashing when the HARD drive try to launch at startup. Or the SATA controller is defective and only work for the STRANGE. Everyone knows this problem or have ideas of how to solve? My best guess is replaced to the needs of the motherboard, but I'm not sure that I have never seen it before.

    I would check with another HARD disk, if possible, as I agree it is probably most associated MB but... worth a try.

  • InDesign CS5 for windows only allow me to scroll through the functions with the mouse wheel

    Nice day

    InDesign CS5 for Windows only allow me to scroll through the functions with the mouse wheel and for example not allow me to access drop down menus, any help will be much appreciated

    https://helpx.Adobe.com/InDesign/KB/InDesign-tools-panels-Don ' t - respond.html

  • 1119: access of nativeWindow property possibly not defined through a reference with static type flash.display:Stage.

    I tried this code:

    http://help.Adobe.com/en_US/AS3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7e08.html

    but it displays error: 1119: access of nativeWindow property possibly not defined through a reference with static type flash.display:Stage.

    package

    {

    import flash.display.Sprite;

    import flash.events.MouseEvent;

    import flash.text.TextField;

    SerializableAttribute public class MinimizeExample extends Sprite

    {

    public void MinimizeExample (): void

    {

    var minTextBtn:TextField = new TextField();

    minTextBtn.x = 10;

    minTextBtn.y = 10;

    minTextBtn.text = "minimize";

    minTextBtn.background = true;

    minTextBtn.border = true;

    minTextBtn.selectable = false;

    addChild (minTextBtn);

    minTextBtn.addEventListener (MouseEvent.CLICK, onMinimize);

    var maxTextBtn:TextField = new TextField();

    maxTextBtn.x = 120;

    maxTextBtn.y = 10;

    maxTextBtn.text = "zoom";

    maxTextBtn.background = true;

    maxTextBtn.border = true;

    maxTextBtn.selectable = false;

    addChild (maxTextBtn);

    maxTextBtn.addEventListener (MouseEvent.CLICK, onMaximize);

    var restoreTextBtn:TextField = new TextField();

    restoreTextBtn.x = 230;

    restoreTextBtn.y = 10;

    restoreTextBtn.text = "restore";

    restoreTextBtn.background = true;

    restoreTextBtn.border = true;

    restoreTextBtn.selectable = false;

    addChild (restoreTextBtn);

    restoreTextBtn.addEventListener (MouseEvent.CLICK, onRestore);

    var closeTextBtn:TextField = new TextField();

    closeTextBtn.x = 340;

    closeTextBtn.y = 10;

    closeTextBtn.text = 'close this window ';

    closeTextBtn.background = true;

    closeTextBtn.border = true;

    closeTextBtn.selectable = false;

    addChild (closeTextBtn);

    closeTextBtn.addEventListener (MouseEvent.CLICK, onCloseWindow);

    }

    function onMinimize(event:MouseEvent):void

    {

    this.stage.nativeWindow.minimize ();

    }

    function onMaximize(event:MouseEvent):void

    {

    this.stage.nativeWindow.maximize ();

    }

    function onRestore(event:MouseEvent):void

    {

    this.stage.nativeWindow.restore ();

    }

    function onCloseWindow(event:MouseEvent):void

    {

    this.stage.nativeWindow.close ();

    }

    }

    }

    You can not force-close a browser with the exception of a window with javascript window.

  • Draw poster with continuous flow of photos

    Does anyone have a plugin or a software to make a poster with a provision of continuous flow, as what we get when we look at our mobile galleries on lightroom.adobe.com?

    ContactSheet page type grid too, I want cells sizes to adapt to this, to avoid spaces between photos.

    flowExample.jpg

    You can do this by using the custom Package and add and drag the photo boxes where you want.  It takes just a little extra work in contrast to the Contact Board.

  • JQuery autocomplete with json

    Does anyone have a full working example of Jquery autocomplete with json that works?

    I can't get any of the examples I found online at work.

    The thread here http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:64866 underway is really saying the same thing you and I are, to know that the data are not in the proper format (as you know). That thread made reference to this article: http://www.petefreitag.com/item/720.cfm. The attack "/ /" on the front of these data shows that ensure JSON is activated. This ' / / ' prefix should be removed from the data. Can you put this in your code to disable safe JSON and then see what response you get?

Maybe you are looking for