Running the rest.extendedJSONConversion Example

    Procedure
  1. Launch ActiveMatrix Service Grid Administrator.
  2. Set the TRA property com.tibco.amf.runtime.bindingtype.rest.extendedJsonConversion to true for the appropriate Runtime Node (via Administrator UI or by adding the line java.property.com.tibco.amf.runtime.bindingtype.rest.extendedJsonConversion=true in the .tra file of the Runtime Node) and restart the Runtime Node.
  3. Enable the com.tibco.amx.bt.rest logger in the DEBUG level on the Runtime Node.
  4. Create an HTTP Connector Resource Template httpConnector with host as localhost and port as 9897.
  5. Create and install the corresponding HTTP Connector Resource Instance “httpConnector” on Runtime Node.
  6. For both REST-Java and REST-Java-REST appliations, deploy the following DAA:

    /rest-soa-projects/restbt.sample.extended.json.conversion/DeploymentArtifacts/restbt.sample.extended.json.conversion.daa

  7. To send a REST Request to the REST-Java (Provider) App, open the SOAP UI project REST-ExtendedJSONConversion-soapui-project.xml using SOAP UI 5.0.0, and use the “InvokeRESTProvider” service. This sends a REST request to the REST-Java app and demonstrates the Provider-side (Service) behavior.
    Note: Set the HTTP Request Header to Accept = application/json.

    GET method’s RESPONSE (returnOne)

    Request URL: http://localhost:9897/Sample/returnOne (HTTP method: GET)

    Sample Response (Standard JSON)

    {"returnOneResponse": {"Flights": [{
    "Arrival": "arrival",
    "Departure": "123"
    }]}}

    Note the [ ] indicating that Flights is an Array, based on the schema. Also, “123” is a string, which is schema-compliant.

  8. To send a REST Request to the REST-Java-REST (Client) App, open the SOAP UI project REST- ExtendedJSONConversion-soapui-project.xml using SOAP UI 5.0.0, and use the “InvokeRESTClient” service. This sends a REST request to the REST-Java-REST app, which in turn sends a rest to the REST-Java app. This demonstrates the client-side (Reference) behavior.

    POST method’s REQUEST (addOperation)

    Request URL: http://localhost:9897/SampleClient/addOperation (HTTP method: POST)

    Set HTTP Request Header:

    Accept = application/json and Content-Type = application/json

    SOAPUI Request to first REST Service Endpoint:

    {"addOperation": {"Arrays":[{"Key":"ABC","Value":"123"}]}}

    POST Request generated by REST Reference Endpoint:

    {"Arrays": [{"Key":"ABC","Value":"123"}]}

    Note the [ ] indicating that Arrays is an Array, based on the schema. Also, “123” is a string, based on the schema.

    Response (Standard JSON):

    {"addOperationResponse": {"Arrays": [{
    "Key": "ABC",
    "Value": "123"
    }]}}

    Note the [ ] indicating that Arrays is an Array, based on the schema. Also, “123” is a string, based on the schema.