Service Virtualization

  • 1.  Response is not recorded in VSI due to namespaces present in Response XML

    Posted Nov 24, 2016 07:57 AM

    Hello ,

     

    I am trying to virtualize a  JMS service using Request- Response pair. My requirement is to create a service which will validate the XML schema of incoming request and on the basis of validation results , response needs to be placed on two different topics like if validation passes then positive response should be passed to PASS topic and if it fails then it should be passed to FAIL topic.

     

    Approach - I created a virtual service using req-resp pairs and configured JMS protocol to receive request and send response on two different channels i.e. PASS and FAIL. After this I followed all the required steps and when i click on Finish . Response body is empty in VSI , this is due to namespaces present in response XML (as Response XML without namespaces is getting recorded).

     

     

    Can anybody assist here how to resolve this problem in DevTest 9.5.1 , how can we create virtual service with responses having namespaces?

     

    Thanks in advance.



  • 2.  Re: Response is not recorded in VSI due to namespaces present in Response XML

    Posted Nov 24, 2016 01:51 PM

    Are you sure it's the namespace?  In 9.5.1 I'm able to successfully create a JMS service from RR pairs with namespaces in the response.  Even when some responses have namespaces and some don't, it still works for me.

     

    Are you virtualizing a real service with legitimate responses and adding in XML schema validation on top of that, or is this service just for the purpose of validating XML schema? 

     

    If it's the former, then I have some questions. 

     - What data protocols are you using? 

     - Are you sure the RR pair format/filenames are correct?

     - Depending on the DPH you're using and whether you selected 'Treat all transactions as Stateless' at the beginning, there is probably a screen during the recording process where you can inspect your transactions' responses to make sure they're present before the VSI is generated. Do you see the response bodies at this stage?

     - Where do your multiple response channels come into play?  By default, when importing RR pairs it will assign each response to the first response channel in your list.  Is your plan to post-process the VSI and modify the responses' 'channel.name' property accordingly, or are you planning on adding something to the VSM to validate the XML schema of the request and then modify the response's channel?

     

    If it's the latter, and your service is just for the purposes of validating XML schema, then you probably don't even need a service image for that.



  • 3.  Re: Response is not recorded in VSI due to namespaces present in Response XML

    Posted Nov 25, 2016 06:15 AM

    Hi Kevin,

     

    Thanks for your reply. Please find inline comments to your questions below -

    Are you sure it's the namespace?  In 9.5.1 I'm able to successfully create a JMS service from RR pairs with namespaces in the response.  Even when some responses have namespaces and some don't, it still works for me. -------- I guess it's because the responses are referring to different namespaces and schemas, as I am able to create VSI for Response which don't have references to namespace and schema .

     

    Are you virtualizing a real service with legitimate responses and adding in XML schema validation on top of that, or is this service just for the purpose of validating XML schema?  ----- I have system which generate response on the results of schema validation and place accordingly the response message to topic. An this service will be used in performance testing requirements.

     

    If it's the former, then I have some questions. 

     - What data protocols are you using? --- I am using XML , Request Data manager, Generic XML payload parser.

     - Are you sure the RR pair format/filenames are correct? -- Yes, Request-req.xml and Response1-rsp1.xml , REsponse2-rsp2.xml

     - Depending on the DPH you're using and whether you selected 'Treat all transactions as Stateless' at the beginning, there is probably a screen during the recording process where you can inspect your transactions' responses to make sure they're present before the VSI is generated. Do you see the response bodies at this stage? ---- No I can't see responses in that stage.

     - Where do your multiple response channels come into play?  By default, when importing RR pairs it will assign each response to the first response channel in your list.  Is your plan to post-process the VSI and modify the responses' 'channel.name' property accordingly, or are you planning on adding something to the VSM to validate the XML schema of the request and then modify the response's channel? ----- I am planning to validate XML schema of incoming request at listen step and accordingly update modify the responses' 'channel.name' property.

     

     

    Thanks 



  • 4.  Re: Response is not recorded in VSI due to namespaces present in Response XML

    Posted Nov 25, 2016 10:43 AM

    > - Are you sure the RR pair format/filenames are correct? -- Yes, Request-req.xml and Response1-rsp1.xml , REsponse2-rsp2.xml

     

    The names of the request/response files belonging to the same transaction must have the same "prefix", followed by "-req" or "-rsp[N]".  For example:  Validate1-req.xml, Validate1-rsp1.xml, Validate1-rsp2.xml.  A second transaction would be Validate2-req.xml, Validate2-rsp1.xml, Validate2-rsp2.xml.  See the documentation for more details.

     

    > I have system which generate response on the results of schema validation and place accordingly the response message to topic. An this service will be used in performance testing requirements.

     

    I'm now even more confused about this scenario.  Does this service actually produce multiple responses?  It sounds like it produces a single response and puts it on one of two response queues.  What are the two responses in your RR pair?



  • 5.  Re: Response is not recorded in VSI due to namespaces present in Response XML

    Posted Nov 28, 2016 08:12 AM

    Hi Kevin,

     

    thanks for your reply.

     

    Requirement --- there would be validation of incoming request and on the basis of schema validation results response will be triggered pass or fail to the respective queue i.e different response channels. yea you are right , there would be one response returned (sorry my mistake). Can you tell me how to store assertion - schema validation results in devtest 9.5.1 , as i need to send response and response channel name accordingly?

     

     

    Regards,

    Kshama 



  • 6.  Re: Response is not recorded in VSI due to namespaces present in Response XML
    Best Answer

    Posted Nov 30, 2016 01:44 AM

    Sorry, but I'm still confused.  Is there an actual, already existing service that validates XML, and you are using DevTest to virtualize this service?  Or are you using DevTest to build a *brand new* service whose purpose is to validate XML?  What is in the responses?  Does it include data or some kind of report related to the request body?  I'm struggling to understand how the RR pairs and a service image are even applicable in this scenario. 

     

    I suspect you could skip the recorder and manually build a VSM that receives a message on one queue, does XML validation, and sends something to one of two other queues based on the results.  No RR pairs or recording required.