Service Virtualization

  • 1.  JSON response, invalid property id and beanshell

    Posted Mar 28, 2018 09:28 AM

    Hello All,

     

    I have the following response in a vsi file : 

    {
    "iden" : {{= com.ca.sv.devtest.util.GenerateString.forRegex("[0-9]{10}");}}
    }

     

    The virtual service works. But in the workstation, while editing the response, there is an error message : "invalid property id" .

     

    How can I solve this error message ?

     

    I'm working with DevTest 10.1 and patch_DE331269_10.1.0_GA.

     

    Thanks,

     

    Benoit



  • 2.  Re: JSON response, invalid property id and beanshell

    Broadcom Employee
    Posted Apr 05, 2018 11:19 AM

    Hi Benoit,

     

    I've been trying to reproduce this problem in order to investigate.

     

    What triggers the error message?  Is simply opening the response panel?  Are you using the general text editor or the JSON tree?  Is there an associated stack trace?

     

    --Mike



  • 3.  Re: JSON response, invalid property id and beanshell

    Posted Apr 06, 2018 03:30 AM

    Hi Mike,

     

    The message appears simply when updating response body.

    I am using the general text editor. With the tree view, there is no error.

    There is no associated stack trace in workstation.log.

     

    For information : case 01004743 has been opened for this.

     

    Thanks.

     

    Benoit



  • 4.  Re: JSON response, invalid property id and beanshell

    Broadcom Employee
    Posted Apr 05, 2018 04:21 PM

    Benoit,  I am not able to reproduce the issue either with or without the patch.. 

     

    I am getting the right value  "iden" : 2046412182



  • 5.  Re: JSON response, invalid property id and beanshell

    Posted Apr 06, 2018 03:34 AM

    Hi Shiney,

     

    The virtual service works and send a good value.

    But in the workstation, in the response panel, there is an error message. Screenshot added with the message.screenshot of error message.

     

    Thanks.

     

    Benoit



  • 6.  Re: JSON response, invalid property id and beanshell

    Broadcom Employee
    Posted Apr 06, 2018 09:32 AM

    Oddly, I can't reproduce the problem, either.

     

    However, I suspect the error is legitimate.  Prior to evaluation, it's not a valid JSON document due to the {{}} notation.  That could only be a JSON string which would need to be quoted.

     

    Of course, when the {{}} is evaluated, it becomes an integer which isn't supposed to be evaluated.

     

    So, it evaluates to a valid JSON document - but it's not valid in the editor prior to the evaluation.

     

    This is probably just the intended behavior of the editor.

     

    --Mike



  • 7.  Re: JSON response, invalid property id and beanshell

    Broadcom Employee
    Posted Apr 06, 2018 09:27 AM

    Benoit, I did exactly the same and not seeing the error. 



  • 8.  Re: JSON response, invalid property id and beanshell

    Posted Apr 09, 2018 06:11 AM

    Hi Shiney, Hi Mike,

     

    I've made new tests today, on Linux (the previous was on Windows).

    Without the patch patch_DE331269_10.1.0_GA, there is no error message. But once the patch is installed, the message appears. And the message appears only when the focus is on the "body response" area.

     

    What information can I provide to help you move forward?

     

    Benoit



  • 9.  Re: JSON response, invalid property id and beanshell
    Best Answer

    Posted Jul 25, 2018 02:50 AM

    Solved with patch DE359792.

     

    Benoit