Service Virtualization

Expand all | Collapse all

auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

  • 1.  auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 15, 2017 05:13 AM

    Hello Team,

     

    Need details on auto generation of VSE - VSM using some config file / command prompt where I can give Payload and protocol to use.

    Any way to create Basic stubs automatically, without following steps in Dev Test.



  • 2.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 15, 2017 11:48 AM

    DevTest has built-in support for a command line interface called ServiceImageManager or SI Manager

    Check these references to get you started: 

    ServiceImageManager Command - Manage Service Images - DevTest Solutions - 10.0 - CA Technologies Documentation  

     

    Create a Service Image from Request-Response Pairs from the Command Line - DevTest Solutions - 10.0 - CA Technologies Do…   

     

     

    The VRS (virtual recording session) files mentioned in the documentation contains the various parameters one typically selects when using the Workstation / Portal recording wizards. The makeup of a VRS file and required values changes from protocol to protocol.

     

    To get a look at examples of the content and structure of a VRS file, use the DevTest Workstation to record a service from R/R pairs and save the VRS file before completing the recording. Similarly, save a VRS after recording live system traffic. You will notice there is a difference between the R/R pair VRS and live recording VRS. This is important.

     

    Repeat these steps for other transport protocols and you will see how the values change in support of those protocols.



  • 3.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 16, 2017 05:49 AM

    Now the new error is 

     

    You need to specify the name of the service image file to record/import into.

     

    My command is : ServiceImageManager --vrs=C:\swdtools\DevTest8.3\testsample.vrs C:\swdtools\DevTest8.3\FINENQINTRTMNC.vsi C:\swdtools\DevTest8.3\FINENQINTRTMNC.vsm --record 



  • 4.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 16, 2017 07:03 AM

    Hello Joel ,

     

    little progress here

     

    Using ServiceImageManager  -d -v C:\swdtools\DevTest8.3\testsample.vrs  -s C:\swdtools\DevTest8.3\generatedImage.vsi  -m C:\swdtools\DevTest8.3\generatedModel.vsm -P 3366 -G

     

    getting error as 

     

    An error occurred processing the command.
    java.lang.RuntimeException: An error occurred trying to perform the record opera
    tion.
    at com.itko.lisa.vse.stateful.ServiceImageManager.doRecording(ServiceIma
    geManager.java:254)
    at com.itko.lisa.vse.stateful.ServiceImageManager.main(ServiceImageManag
    er.java:140)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
    at com.exe4j.runtime.WinLauncher.main(Unknown Source)
    at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
    Caused by: java.lang.RuntimeException: java.lang.NullPointerException
    at com.itko.lisa.vse.stateful.recorder.RecordingManager.run(RecordingMan
    ager.java:280)
    at com.itko.lisa.vse.stateful.ServiceImageManager.doRecording(ServiceIma
    geManager.java:249)
    ... 8 more
    Caused by: java.lang.NullPointerException
    at java.io.File.<init>(Unknown Source)
    at com.itko.lisa.vse.stateful.recorder.DefaultRecordingSession.writeVirt
    ualServiceModel(DefaultRecordingSession.java:932)
    at com.itko.lisa.vse.stateful.recorder.DefaultRecordingSession.writeVirt
    ualServiceModel(DefaultRecordingSession.java:914)
    at com.itko.lisa.vse.stateful.recorder.RecordingSession.writeVirtualServ
    iceModel(RecordingSession.java:559)
    at com.itko.lisa.vse.stateful.recorder.RecordingManager.run(RecordingMan
    ager.java:269)

     

     

    Can you please help on this ? what is missing in the command ?



  • 5.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 16, 2017 03:41 AM

    This helped Joel. but getting error :

     

    I'm running the command 

     

    ServiceImageManager --vrs=C:\swdtools\DevTest8.3\testsample.vrs --vsi-file=C:\swdtools\DevTest8.3\FINENQINTRTMNC.vsi --vsm_file=C:\swdtools\DevTest8.3\FINENQINTRTMNC.vsm --record 

     

     

    but getting error - 

     


    log4j:WARN No appenders could be found for logger (com.itko.lisa.editor.Intersec
    tions).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more in
    fo.
    Locale: en_US
    Setting System.out and System.err to: Cp1252
    LISA_HOME set to C:\swdtools\DevTest8.3\
    DevTest temporary directory is C:\Users\44023577\lisatmp_8.3.0
    Configuring logging from 'C:\swdtools\DevTest8.3\logging.properties'
    DevTest Solutions, Copyright (c) 2002-2017 CA, All rights reserved.
    DevTest Service Image Manager
    DevTest Solutions Version :: 8.3.0 (8.3.0.241)
    Installed patches:
    .... patch_RTC-228284_8.3.0_LTD.jar: iteration 1 built for version 8.3.0 of DevT
    est
    .... RTC-228284: 00126716 - - Can't run Suite Locally
    .... patch_RTC-235451_8.3.0_GA.jar: iteration 1 built for version 8.3.0 of DevTe
    st
    .... RTC-235451: Making sure IBM MQ Message payload's default field values m
    atch the actual defaults in the MQMessage class, fixes to account for numeric fi
    elds with nonzero defaults, JUnit test"
    .... patch_TA328809_8.3.0_GA.jar: iteration 1 built for version 8.3.0 of DevTest

    .... TA328809: Fixing JMS/MQ Native VSM backwards compatibility with old VSI
    s"

    Unsupported argument "--vsi-file" found.

    Use --help for help.

    C:\swdtools\DevTest8.3\bin>



  • 6.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use
    Best Answer

    Posted Jun 16, 2017 10:01 AM
      |   view attached

    Here is an example of a CLI command that I have run from a bat file to launch the recorder.  

    The command below should be on one continuous line. I used line separators below to make the command structure easier to read.  Obviously, you need to change the paths around to suit your needs.  

    I also attached a sample SOAP-based VRS file.  The structure and content of the VRS file changes on the basis of transport protocol and how the recording is being built -- for example, an R/R pairs VRS is different from a Recording VRS.

     

    <path_to_LH>\bin\ServiceImageManager.exe  

    --vrs=c:\swdtools\DevTest8.3\<project_path>\testsample.vrs

    -d

    -s C:\swdtools\DevTest8.3\<project_path>\FINENQINTRTMNC.vsi

    -m C:\swdtools\DevTest8.3\<project_path>\FINENQINTRTMNC.vsm

    -G

     

    To execute the CLI from a bat file, one can do something like this:

    @echo off
    setlocal enabledelayedexpansion
    cmd.exe /C start "RcrdrName" C:\DevTest8.3\bin\ServiceImageManager.exe --vrs=C:\<project_path>\VRSessions\demo.vrs -d -s C:\<project_path>\VServices\Images\demo.vsi -m C:\<project_path>\VServices\demo.vsm -G
    TIMEOUT /T 5 /NOBREAK

     

    If you get an error using the above, then check your VRS file as there may be a mistake or missing configuration.

    Attachment(s)

    zip
    demo.vrs.zip   481 B 1 version


  • 7.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 19, 2017 01:50 AM
      |   view attached

    Hey Joel,

     

    This helped. VSI is getting generated but VSM is not.. No errors are logged. Any particular reason you see?

     

    Attached is VRS file. This was saved while crating the stubs. 

    Attachment(s)

    zip
    test1.vrs.zip   1 KB 1 version


  • 8.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 19, 2017 03:01 AM

    I tried few things, with -m C:\<project_path>\VServices\demo.vsm  doesn't work. 

    if I give -s C:\<project_path>\VServices\demo.vsm it creates vsm but it's a copy of VSI file. 

     

    something with the command, as it's not creating VSM file? 

     

    Deve test 8.3 is being used.



  • 9.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 19, 2017 07:22 AM
      |   view attached

    Joel,

     

    Issue seems to be with <Protocol type="com.itko.lisa.messaging.providers.ibmmq.vse.IbmMqTransportProtocol">

     

    When used http, it works fine. but not with ibmmqTransportProtocol.

     

    Error : 

    java.lang.RuntimeException: An error occurred trying to perform the record opera
    tion.
    at com.itko.lisa.vse.stateful.ServiceImageManager.doRecording(ServiceIma
    geManager.java:254)
    at com.itko.lisa.vse.stateful.ServiceImageManager.main(ServiceImageManag
    er.java:140)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
    at com.exe4j.runtime.WinLauncher.main(Unknown Source)
    at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
    Caused by: java.lang.RuntimeException: java.lang.NullPointerException
    at com.itko.lisa.vse.stateful.recorder.RecordingManager.run(RecordingMan
    ager.java:280)
    at com.itko.lisa.vse.stateful.ServiceImageManager.doRecording(ServiceIma
    geManager.java:249)
    ... 8 more
    Caused by: java.lang.NullPointerException
    at com.itko.lisa.messaging.vse.AbstractMessagingTransportProtocol.create
    ListenStep(AbstractMessagingTransportProtocol.java:551)
    at com.itko.lisa.vse.stateful.protocol.rrpairs.VSFromRRPairsTransportPro
    tocol.createListenStep(VSFromRRPairsTransportProtocol.java:375)
    at com.itko.lisa.vse.stateful.protocol.DefaultVSMFactory.createListenSte
    p(DefaultVSMFactory.java:261)
    at com.itko.lisa.vse.stateful.protocol.DefaultVSMFactory.createVSM(Defau
    ltVSMFactory.java:133)

    Attachment(s)

    zip
    demo1.vrs.zip   1 KB 1 version


  • 10.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 19, 2017 11:06 AM

    You are seeing the differences I mentioned in my original reply.  The parameters a VRS needs for HTTP are vastly different from those used in JMS recording.  You cannot use VRS configured for one transport as a skeleton for a different transport. The VRS would be missing too much information.  For example, an HTTP VRS knows nothing about queue names and connection assets, but these are critical for a JMS VRS.

     

    The information specified in VRS files can also differ between R/R recording and live recording. As you noted, the class that is invoked by the recorder is different.  

     

    The best shot at getting the VRS correct is the use the Workstation Recorder Wizard to record a sample.  Before completing the recording, save the information off into a VRS.  This will give you a proper pattern.  Once you do this, you will have a template that you can build off.

     

    If you need both RR pair and Live recording, do this step twice to pick up the correct recorder class. 



  • 11.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 19, 2017 12:08 PM

    Hello Joel,

     

    The VRS file I shared is saved after creating stubs with IBM MQ Native Protocol itself. Nothing manually is entered in vrs file. So, Basically, this should work from cmd.

     The VRS has queue details and evrything. It's perfectly creating the VSI but not able to generate the VSM. 

    I do not have data ready on Queue. This is without UI.

    So, I have to use RR Pair & Copybook to create the VRS using IBMMQNative Transport Protocol. Can;t do it with recording for now. Do you have any sample handy with RRPair using IBMMQNative protocol ? 



  • 12.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 19, 2017 12:25 PM

    No, sorry, I do not have an IBM MQ VRS file.  I do not know exactly what goes in the MQ VRS as far as properties go.

     

    Wondering about two things I saw in the VRS:

    1) Try changing {{LISA_RELATIVE_PROJ_ROOT}} in the VRS to a real path 

    2) Try adding a pointer to your project Config file in the command line, e.g., 

    -C C:\<path_to_config>\Configs\project.config



  • 13.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 19, 2017 12:50 PM

    Both the solution provided above  Doesn't solve the problem. 

    If the path was issue, it would not have configured the correct vsi at the first place. 

    I need the solution.



  • 14.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 19, 2017 03:57 PM

    I think it best to open a ticket with CA Support so someone can Webex with you to look at the problem in the context of the entire DevTest setup. 



  • 15.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 20, 2017 12:45 AM

    Doesn't have an Enterprise account. So, not able to open the case. Any other way to get this question solved?



  • 16.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 20, 2017 10:43 AM

    I saw in your earlier error log that your version of DevTest has several patches and some of those address IBM MQ issues. Perhaps, one of these patches is causing an issue or maybe they are not.

     

    Is there any way for you to contact the CA Account leadership team associated to this license of DevTest? That would be your next course of action.  



  • 17.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Jun 21, 2017 06:26 AM

    Thank you for the support Joel!

    Seems to be 8.3 issue.



  • 18.  Re: auto generation of VSE - VSM (Stubs) using some config file / command prompt where I can give Payload and protocol to use

    Posted Sep 24, 2018 03:05 AM

    Hi Everyone,

     

    I am getting the below error when i am using the below command.

    Could you please let me know if the syntax is correct or not. 

     

    ServiceImageManager.exe -v H:\Desktop\VSRRRPairs.vrs -d -s H:\Desktop\CMD\NewImage.vsi -m H:\Desktop\CMD\Newimage.vsm -P 8003 -G

     

    Or

     

    ServiceImageManager -v H:\Desktop\VSRRRPairs.vrs -d -s H:\Desktop\CMD\NewImage.vsi -m H:\Desktop\CMD\Newimage.vsm -P 8003 -G

     

    C:\Program Files\CA\DevTest\bin>ServiceImageManager.exe -v H:\Desktop\VSRRRPairs
    .vrs -d -s H:\Desktop\CMD\NewImage.vsi -m H:\Desktop\CMD\Newimage.vsm -P 8003 -G

    Locale: en_AU
    Setting System.out and System.err to: Cp1252
    LISA_HOME set to C:\PROGRA~1\CA\DevTest\
    DevTest temporary directory is C:\Users\L112220\lisatmp_10.3.0
    Configuring logging from 'C:\PROGRA~1\CA\DevTest\logging.properties'
    DevTest Solutions, Copyright (c) 2002-2018 CA, All rights reserved.
    DevTest Service Image Manager
    DevTest Solutions Version :: 10.3.0 (10.3.0.297)
    Installed patches:
    .... imsconn.jar: iteration 0 built for an unknown version of DevTest
    .... imsutils.jar: iteration 0 built for an unknown version of DevTest
    .... itkoext-westpac-lek-7.0.jar: iteration 0 built for an unknown version of De
    vTest
    .... sqljdbc4.jar: iteration 0 built for an unknown version of DevTest

    [Fatal Error] :1:1: Content is not allowed in prolog.
    Sep 24, 2018 12:16:20 PM com.sun.xml.internal.messaging.saaj.soap.MessageImpl id
    entifyContentType
    SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message instead of a S
    OAP message
    An error occurred processing the command.
    java.lang.RuntimeException: An error occurred trying to perform the record opera
    tion.
    at com.itko.lisa.vse.stateful.ServiceImageManager.doRecording(ServiceIma
    geManager.java:265)
    at com.itko.lisa.vse.stateful.ServiceImageManager.main(ServiceImageManag
    er.java:147)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
    at com.exe4j.runtime.WinLauncher.main(Unknown Source)
    at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
    Caused by: java.lang.RuntimeException: java.lang.NullPointerException
    at com.itko.lisa.vse.stateful.recorder.RecordingManager.run(RecordingMan
    ager.java:288)
    at com.itko.lisa.vse.stateful.ServiceImageManager.doRecording(ServiceIma
    geManager.java:260)
    ... 8 more
    Caused by: java.lang.NullPointerException
    at java.io.File.<init>(File.java:277)
    at com.itko.lisa.vse.stateful.recorder.DefaultRecordingSession.writeVirt
    ualServiceModel(DefaultRecordingSession.java:953)
    at com.itko.lisa.vse.stateful.recorder.DefaultRecordingSession.writeVirt
    ualServiceModel(DefaultRecordingSession.java:935)
    at com.itko.lisa.vse.stateful.recorder.RecordingSession.writeVirtualServ
    iceModel(RecordingSession.java:569)
    at com.itko.lisa.vse.stateful.recorder.RecordingManager.run(RecordingMan
    ager.java:277)
    ... 9 more