10 Replies Latest reply on Jun 24, 2014 2:50 PM by Steven Hawkins

    Pass form data in http message body using ws translator

    Yongxin Liu Newbie

      We are using the webservice translator to invoke a REST service, our vdb looks like below:

       

      <model name="command" type="VIRTUAL">

        <metadata type="DDL"><![CDATA[

             CREATE VIRTUAL PROCEDURE request

             (requestURL varchar)

             RETURNS (message varchar(100), jobids varchar(100), success varchar(10))

             AS (

                  select request.* from 

                  (call restBDM.invokeHttp(action => 'POST', endpoint =>  (select restURL || requestURL FROM config.base_url where TenantId = 1))) AS ws,

                  XMLTABLE('Request' PASSING jsonToXml('Request', ws.result) columns

                  Message   string PATH './message',

                  JobIDs  string PATH './jobids',

                  Success   string PATH './success'

             ) AS request

             );

              ]]>

        </metadata>

      </model>

       

      So right now we are not passing any data as part of the request, we want to pass 2 key value pairs as part of the http message body. Assuming that would go into "request" parameter of the invokeHttp procedure, I need some help with how to put that into this VDB definition. The two parameters we need to pass as part of the http message body are:

      clusterid:<value>

      params:<value>

       

      Thanks,

      Yongxin Liu