Service Virtualization

  • 1.  Not getting proper response for virtualized service testing from postman UI.

    Posted Feb 07, 2017 03:05 PM
      |   view attached

    I am not getting proper response when I am testing virtualized service from postman UI. But the transaction is increasing in Server Console. I virtualised the RR pair of REST full webservice in DevTest workstaion. Also see the screenshot of inspection view.

    The below is response getting PostMan UI

    <html>
    <head>
    <title>404 Not Found</title>
    </head>
    <body>
    <h1>Not Found</h1>
    <p>The requested URL was not found on this server.</p>
    <hr/>
    <p>
    <i>The DevTest VSE service could not match your request to a recorded request.  Consider expanding your service image.</i>
    </p>
    <br/>
    <font size="-2">Produced by a DevTest virtualized web server.</font>
    </body>
    </html>

     

    And see the below message taken from inspection view from server console

    Did not get a valid response object so we ignore processing this transaction.
    net.sf.json.JSONException: nu.xom.ParsingException: The entity "nbsp" was referenced, but not declared. at line 7, column 96
    at com.itko.lisa.vse.stateful.protocol.json.LISAXmlSerializer.read(LISAXmlSerializer.java:352)
    at com.itko.lisa.vse.stateful.protocol.json.JSONHandlerJSONLibImpl.convertXMLToJSON(JSONHandlerJSONLibImpl.java:77)
    at com.itko.lisa.vse.stateful.protocol.json.JSONDataProtocolHandler.updateResponse(JSONDataProtocolHandler.java:103)
    at com.itko.lisa.vse.stateful.common.DataProtocolStandardControlFilter.subPreFilter(DataProtocolStandardControlFilter.java:170)
    at com.itko.lisa.test.FilterBaseImpl.subFilter(FilterBaseImpl.java:148)
    at com.itko.lisa.test.FilterBaseImpl.preFilter(FilterBaseImpl.java:95)
    at com.itko.lisa.test.TestNode.doFilters(TestNode.java:1464)
    at com.itko.lisa.test.TestNode.doPreFilters(TestNode.java:1417)
    at com.itko.lisa.test.TestNode.executeNode(TestNode.java:964)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1283)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1198)
    at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1183)
    at com.itko.lisa.test.TestCase.executeTest(TestCase.java:1127)
    at com.itko.lisa.coordinator.Instance.run(Instance.java:204)
    Caused by: nu.xom.ParsingException: The entity "nbsp" was referenced, but not declared. at line 7, column 96
    at nu.xom.Builder.build(Unknown Source)
    at nu.xom.Builder.build(Unknown Source)
    at com.itko.lisa.vse.stateful.protocol.json.LISAXmlSerializer.read(LISAXmlSerializer.java:329)
    ... 13 more
    Caused by: org.xml.sax.SAXParseException: The entity "nbsp" was referenced, but not declared.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    ... 16 more



  • 2.  Re: Not getting proper response for virtualized service testing from postman UI.

    Posted Feb 08, 2017 08:34 AM

    The key element of the message is the text: The DevTest VSE Service could not match your request.

     

    VSE is trying to tell you that the the input request operation and argument list sent from Postman does not match any of the operations and signatures defined in your VSI.  This error is called an Unknown Stateless Response.  

     

    Your service (VSM Listen Step) parsed the incoming request's operation and arguments.  It passed this list to the VSI. The VSI compared this list against each of the operations, argument lists, and the matching style criteria that are specified in the VSI.  The Service looked at every one of these and could not find a match, so it responded with the 404 error.

     

    The Transaction Count increased in the Server Console because the Service Listen/Respond steps actually received a request.  This count does not apply only to request/responses for which an actual response was found in the VSI.

     

    You need to carefully compare your service image (VSI) against the operation, input parameters (i.e., arguments), upper lowercase spellings of element names, Transaction Basics Match Style, etc.  I only saw 6 arguments in the Inspection View graphic that you included.  Does your VSI have exactly the same 6 arguments?  Are you applying any DPHs?

     

    And that latter exception appears to indicate there is some sort of issue with a payload.  Perhaps, there is a parse error due to incorrect formatted data.



  • 3.  Re: Not getting proper response for virtualized service testing from postman UI.

    Posted Feb 08, 2017 10:45 AM
      |   view attached

    Hi

     

    Thanks for your support!

     

       The below is the request and response which is a post method, in json format trying to virtualize. Once it is virtualized I am trying to hit the Virtualserver from PostMan UI with the same request.

    I am virtualizing Req-rsp pair from devtest workstation. I am missing anything?

     

    Request:

    {

       "input":{

          "addressInfo":{

             "address1":"6201 Windhaven Pkwy",

             "address2":"Apt 1025",

             "city":"Plano",

             "stateOrProvinceCode":"TX",

             "postalCode":"75093",

             "countryCode":"US",

             "residential":false

          }

       }

    }

     

    Response:

     

    {

      "output": {

        "hundredPercentMatch": true,

        "streetLineMatch": true,

        "cityStatePostalMatch": true,

        "cleansedAddress": {

          "address1": "6201 Windhaven Pkwy",

          "address2": "Apt 1025",

          "city": "Plano",

          "stateOrProvinceCode": "TX",

          "postalCode": "75093",

          "countryCode": "US"

        },

        "standarizedAddress": {

          "address1": "6201 WINDHAVEN PKWY",

          "address2": "APT 1025",

          "city": [

            "PLANO"

          ],

          "stateOrProvinceCode": "TX",

          "postalCode": "750932104",

          "countryCode": "US",

          "residential": false

        },

        "alerts": []

      },

      "successful": true

    }

     

     

    Thanks and Regards,

    Krishna Vattikuti,

    Mobile: 469-407-6061



  • 4.  Re: Not getting proper response for virtualized service testing from postman UI.
    Best Answer

    Posted Feb 08, 2017 04:44 PM
      |   view attached

    The solution (see attached zip file) shown was created using DevTest 9.5.1.

    I took your request / response and created R/R Pairs.  The Pairs are located under the Data directory in the ZIP.

    I used the Create From R/R Pairs option to spin up a RESTful service.

    I allowed DevTest to use the default JSON 2.0 DPH during both recording and Playback.  No other DPHs were implemented.

    I used Postman (see screenshot) to send the request to the service and I got the response that was recorded.

    Open the newimage.vsi and notice that the argument list contains each of the elements that is in the request below.

     

     

    If you were to send the request after removing one or more of the recorded arguments OR adding a new argument (SEE BLUE HIGHLIGHT BELOW) that was never recorded, notice what happens:

    This happens because the signature for the operation POST /my/rest/service does not match any signature for this operation in the VSI.

    Attachment(s)

    zip
    REST_Pairs.zip   14 KB 1 version


  • 5.  Re: Not getting proper response for virtualized service testing from postman UI.

    Posted Feb 08, 2017 06:34 PM

    Thanks Joel. We are using 9.0 and it’s working now when tried as you said.

     

    Thanks and Regards,

    Krishna Vattikuti,

    Mobile: 469-407-6061