IT Process Automation

  • 1.  JSON support for REST

    Posted Oct 04, 2016 04:29 PM

    How do we call the REST api with json in our POST?  We get errors when we try.  Here's an example we tried calling QueryStartRequestFormsRequest.  It works fine with xml.

     

    Endpoint: http://hostname:7000/node/rest/CA:00074_CA:00074:01/_ops/QueryStartRequestForms 

    {
    "QueryStartRequestFormsRequest": {
    "@xmlns": "http://ns.ca.com/2011/09/pam-ops",
    "Filter": {
    "LookUpPath": "/GCC/SRF",
    "IsRecursive": "true"
    }
    }
    }

     

     

    and we get back:

    java.lang.RuntimeException: org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'QueryStartRequestFormsRequest' not found. (http:///temp.xml, 1, 73)



  • 2.  Re: JSON support for REST
    Best Answer

    Broadcom Employee
    Posted Oct 21, 2016 12:48 PM

    Try this payload:

     

    {
    "QueryStartRequestFormsRequest": {
      "@xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance",
    "@xsi:type":"p1:QueryStartRequestFormsRequest",
    "@xmlns:p1":"http://ns.ca.com/2011/09/pam-ops",
    "Filter": {
    "LookUpPath": "/GCC/SRF",
    "IsRecursive": "true"
    }
    }
    }



  • 3.  Re: JSON support for REST

    Posted Oct 27, 2016 07:59 AM

    that worked - thank you!!