Service Virtualization

  • 1.  Attributes Manipulation Using Request Data manager

    Posted Jun 02, 2016 05:49 AM

    How can we validate XML attributes in a request using "RequestDataManager" Protocol?



  • 2.  Re: Attributes Manipulation Using Request Data manager

    Posted Jun 02, 2016 08:35 AM

    I am not exactly sure what you mean by 'validate' an XML attribute.

    If you want to grab an XML attribute and populate an argument onto the request, you may want to consider the Generic XML DPH (allows you to XPath to your attributes) if the number of attributes is small.  Or, the XML DPH will convert the XML document on the incoming request into operation and arguments.  I don't recall the exact rules the XML DPH applies to attributes.  For example, if an attribute is empty, it may not populate -- not sure.



  • 3.  Re: Attributes Manipulation Using Request Data manager

    Posted Jun 02, 2016 10:22 AM

    Thanks Joel.

     

    But the need here is to have XML attributes as arguments in the request. On using XML Data Protocol we can only read XML elements but not take the attribute values as request arguments.

     

    We tried with Generic XML payload parser option and I was able to take the attributes as arguments. But when we tried merging two or more images into a single image and then try to execute we are getting "VSE request doesn't match the recorded request" error.



  • 4.  Re: Attributes Manipulation Using Request Data manager

    Broadcom Employee
    Posted Jun 02, 2016 10:29 AM

    When you merged two/more images into a single image - were these images created with the same Xpaths using Generic XML payload parser? What are the xpaths used in the corresponding VSMs?

     

    When you merge multiple VSIs using Generic XML payload parser - the VSM using this merged VSI would need to have a superset of all the paths used in individual models using Generic XML PP



  • 5.  Re: Attributes Manipulation Using Request Data manager

    Posted Jun 02, 2016 10:33 AM

    Please verify your deployed vsm file whether the Virtual HTTPS Listener step has Generic XML payload parser as one of the filter. there are chances that while merging, the incorrect vsm is deployed.



  • 6.  Re: Attributes Manipulation Using Request Data manager

    Posted Jun 02, 2016 10:34 AM

    Hi Prem,

     

    I did add all the other xpaths into the combined model which were used in each of the image. But still I was getting the same error.



  • 7.  Re: Attributes Manipulation Using Request Data manager

    Posted Jun 02, 2016 10:48 AM

    Best to look in the log files to see what your DPHs parsed into DevTest arguments.  If you are running in VSE, the log file that starts with VS_<yourServiceName>.log should contain some displays as to what the filters parsed into arguments. 

    The output will look something like this:

    2016-06-01 18:19:55,383Z (13:19)[<VS_NAME> [VS_<VS_NAME>_Run]/1] INFO  - Inbound Request {"id":0,"operation":"inputMessage","arguments":{"Arg1":"WS","ARG2":"2016-05-16T13:13:11-05:00","ARG3":"10000025","ARG4":"10000021",ARG5:"0"}}

    :

    2016-05-16 18:19:55,393Z (13:19)[<VS_NAME> [VS_<VS_NAME>_Run]/1] WARN  - No Match Request <?xml version="1.0" ?>

    <request operation="inputMessage" matchTolerance="EXACT">

      <arguments>

        <parameter name="ARG1">WS</parameter>

        <parameter name="ARG2">2016-05-16T13:13:11-05:00</parameter>

        <parameter name="ARG3">10000025</parameter>

        <parameter name="ARG4">10000021</parameter>

        <parameter name="ARG5">0</parameter>

      </arguments>

     

    I would compare the arguments and argument names on the signature above to the arguments and argument names in the combined VSI.  If one of your XML attributes happened to be empty or missing from the request, you may be missing an argument in the signature.  Also check the spelling of the args as case sensitivity applies as well.



  • 8.  Re: Attributes Manipulation Using Request Data manager

    Posted Jun 02, 2016 10:55 AM

    I tried doing this and I observed that one of the incoming requests for which the model was developed while creating that image  takes attributes correctly.

     

    But after repointing the model to the combined image and updating the Generic and Request data manager protocols for both the images, the incorrect response is getting displayed for the newly combined image.



  • 9.  Re: Attributes Manipulation Using Request Data manager
    Best Answer

    Posted Feb 14, 2017 11:33 AM

    Yasaswani,

     

    Are you still needing assistance with this issue? If so, open up a support case and we should be able to help you out.



  • 10.  Re: Attributes Manipulation Using Request Data manager

    Posted Feb 14, 2017 11:07 PM

    The issue ahs been resolved.

    Thanks for your inputs team!