Service Virtualization

  • 1.  REST Service Virtualisation

    Posted Apr 17, 2016 07:06 AM

    Hi,

    I want to virtualise a Live REST API and the URL would like below, could you please differentiate the TargetPort and TargetHost which we provide to Recorder from the below URL.

    https://test-services-customer.lawtram.com/services/supplychain/customerordermanagement/orderdetail?OrderNumber=21234123…

    Could you also let me know how the virtual URL should be for posting a transaction to the recorder.

    Thanks in Advance.



  • 2.  Re: REST Service Virtualisation

    Broadcom Employee
    Posted Apr 17, 2016 07:19 AM

    I suggest TargetHost would be test-services-customer.lawtram.com

    The default TargetPort would be 443, as it's https

    With it being https, don't forget that there's a security certificate involved somewhere, and DevTest will need a copy of it (along with its credentials, so DevTest can decrypt requests and encrypt responses).

     

    Make sure you select the REST data protocol (if it's not automatically selected), so the DevTest recorder can take your OrderNumber and make a parameter from it.



  • 3.  Re: REST Service Virtualisation

    Posted Apr 18, 2016 08:48 AM

    Can you please tell were can i find the REST Data Protocol Step before i start my recording, i could see Transport protocol in the 1st window once we select the 'VSE Recorder" and in 2nd window i could see the Target Port, target host and provision for SSL settings. DevTest version i am using is 8.4.0.227.



  • 4.  Re: REST Service Virtualisation

    Posted Apr 18, 2016 09:03 AM

    The data protocol selection step happens after you finish recording all of your transactions.  This step happens after you stop the recorder.

    DevTest examines the recorded transactions and makes a 'best guess' at which data protocols are most likely needed.  Many times, REST will be selected automatically for you. 



  • 5.  Re: REST Service Virtualisation

    Posted Apr 19, 2016 02:10 AM

    As you said normally data protocol will be available after recording, i was thinking that for recording it was available even before starting the recording.

    I have used the below Virtual URL for posting message to DevTest workstation but its not reaching instaed its timing out with an error, could you please help me out were i am going wrong.

    Virtual URL:- https://Virtual-Ipaddress:443/services/supplychain/customerordermanagement/orderdetail?OrderNumber=212341234&NodeID=1234&Country=US

    Live REST Service URL:- https://test-services-customer.lawtram.com/services/supplychain/customerordermanagement/orderdetail?OrderNumber=212341234&NodeID=1234&Country=US

    I have tested the Live service and response and got a correct response, so the tool is able to connect to the backed application and get a response in return.



  • 6.  Re: REST Service Virtualisation
    Best Answer

    Posted Apr 19, 2016 09:01 AM

    DevTest considers HTTP as the transport and REST as the data protocol; therefore, the transport is all DevTest needs to get a request from your client to the provider application.  This is one reason you do not specify a REST DPH until you have completed the recording and you are configuring the Recorder to process the payload part of the transaction.

     

    What port did you set the recorder (i.e., Virtual-Ipaddress) to listen on?  This may be why the request timed out.

    And, did you configure SSL settings in the Wizard when you defined your target host and port.

     

    Check out what Bhavin did in this videos:

       -- In this video, look at how Bhavin set the recorder to use SSL.  In this example SOAP and REST are treated the same.  I believe Bhavin used port 8443 to demonstrate SSL.

     

       -- In this video, Bhavin points our more about the REST protocol itself and how the URI is parsed.

     

    In the first video, pay particular attention to the 'Use SSL to Server' and 'Use SSL to Client' settings.  Since you are trying to record SSL (HTTPS), you should identify to the Recorder that you need the traffic encrypted.  If you leave the keystore files defaulted, DevTest will use what amounts to the same encryption that a browser uses when it sends transactions to an HTTPS endpoint.  If your server is using a custom certificate, then, as Rick pointed out, you need to acquire a keystore from your admin.  My assumption at this time is that you DO NOT need a custom keystore file.  

     

    SSL with VSE Recording - DevTest Solutions - 9.1 - CA Technologies Documentation  - There is also some discussion here that references SSL.

     

    Assuming you can use SSL OOTB, try this configuration.

    SSL.JPG

    Your client sends its request to the Recorder on port 8080 

         (https://Virtual-Ipaddress:8080/services/supplychain/customerordermanagement/orderdetail?OrderNumber=212341234&NodeID=1234&Country=US)

     

    The Recorder and the Client handshake and use SSL.

    The Recorder sends the request on to test-services-customer.lawtram.com on port 443.  URI info passed on to this endpoint.

    Since Use SSL to Server is checked on, the Recorder acts as the client and exchanges DevTest keystore information to determine the encryption algorithm.



  • 7.  Re: REST Service Virtualisation

    Posted Apr 20, 2016 03:40 AM

    Thanks Joel, as you said it worked out.

    I have tested the service with real URL without any client SSL certs installed and it worked out, so i was thinking of not to select the "use SSL server" in the recorder.  Since i haven't selected the SSL its getting timed out when i record.

    So now i have selected the SSL and used different port numbers and DevTest is able to receive the transactions. Thanks once again.



  • 8.  RE: Re: REST Service Virtualisation

    Posted Nov 29, 2019 03:53 PM
    May I please get the link of videos by Bhavin as I'm also facing similar issue and not able to figure out how to fix.