Service Virtualization

Expand all | Collapse all

Why am I not seeing any request parameters when I create a REST VSI?

Jump to Best Answer
  • 1.  Why am I not seeing any request parameters when I create a REST VSI?

    Posted 07-31-2018 03:20 PM

    I am creating a REST virtual service from these R/R pairs:

     

    REQUEST:

     

    POST /TIBCO_ESIGN_UAT/bbtesign/v1/package/Dyr9MdXcpWt8xyw6glrUC9qj53=/documents HTTP/1.1

     

    <?xml version = "1.0" encoding = "UTF-8"?>
    <AddDocument>
    <AddDocumentRequest xmlns = "http://www.bbt.com/schema/BBT/Documents/1.0/UploadDocument">
    <channelID/>
    <packageGuid/>
    <attachmentGuid/>
    <documentGuid/>
    <vendorPackageId>Dyr9MdXcpWt8xyw6glrUC9qj53=</vendorPackageId>
    <packageName>MyPackage</packageName>
    <vendorDocumentId>9997666</vendorDocumentId>
    <index>0</index>
    <extract>true</extract>
    </AddDocumentRequest>
    <fileName>sampleDocumentExtract1.pdf</fileName>
    <fileContent>48werfvh78H49t45t4r9rfv954r9494Eijh49th4t4er8hfg48th4t8h4rhdfg8dihfg8dhfgr8h5gr9gehwDFifgii</fileContent>
    </AddDocument>

     

    RESPONSE:

    HTTP/1.1 200

    <?xml version = "1.0" encoding = UTF-8?>
    <ns0:addDocumentReply xmlns:ns0 = "http://www.bbt.com/schema/BBT/Documents/1.0/UploadDocument">
    <ns0:status>
    <ns0:statusCode>000</ns0:statusCode>
    <ns0:statusDesc>Success</ns0:statusDesc>
    </ns0:status>
    <ns0:vendorDocumentId>3456666</ns0:vendorDocumentId>
    </ns0:addDocumentReply>

     

    I use the REST Data Protocol when creating the service as /TIBCO_ESIGN_UAT/bbtesign/v1/package/Dyr9MdXcpWt8xyw6glrUC9qj53=/documents HTTP/1.1 needs to be dynamic where the highlighted text will change based on the request and I have URLPARAM0 set for that.

     

    However, when I create the VSI, in Workstation none of the request parameters appear except for URLPARAM0:

     

     

    Now if I run as is, I can get a successful response using any value for URLPARAM0.  What I really want to do is have the response return the vendorDocumentId that came from the request instead of it being hardcoded, but without the request parameters, I can't make it a magic string.

     

    I've tried manually adding the parameters but then it always returns no match.

     

     



  • 2.  Re: Why am I not seeing any request parameters when I create a REST VSI?
    Best Answer

    Posted 07-31-2018 08:49 PM

    I believe you want to add a "Generic XML" data protocol handler (DPH) after your REST DPH, and select the elements you want to include as parameters.

     

    It might be handy to find out how package ID and fileContent are encoded, to see whether there's any intelligence that can be added for those. Also the documentId doesn't match in the request and response you posted. Is that intentional?