Service Virtualization

  • 1.  Recording an API, HTTP protocol.

    Posted Apr 17, 2016 02:31 AM

    Hi,

    I want to record a live API and protocol is HTTP. URL would be like http://ip-address:portnumber/basepath.

    I am able to provide the Target host as "ip-address" and Target port as "port" but there is no provision for providing the basepath.

    So when i start recording tool is not able to connect to live system since the basepath is not given in the recorder step, so as a result getting error response as not able to connect API and the same is recorded to VSI.

    Could you please help me with this issue. Thanks in Advance.



  • 2.  Re: Recording an API, HTTP protocol.
    Best Answer

    Broadcom Employee
    Posted Apr 17, 2016 04:28 AM

    So "ip-address" is now the IP address of the recorder and "portnumber" is the port number of the recorder.

    In your URL, you record http://ip-address:portnumber/basepath

    You don't want to have the base path in the recorder, because your application is appending basepath to the URL. Perhaps you've replaced too much of your real URL with the virtual URL? It's designed to be able to drop-in the virtual service in place of the real service, so your environmental configuration should be to replace hostname and port number, but leave everything else the same, just like what would happen when moving between different pre-prod environments. The DevTest recorder for HTTP is a gateway / proxy device, so it captures *all* HTTP service calls between the pieces of architecture in-scope and those out-of-scope.

     

    http://real-backend-ipaddress:real-port/myBasepath becomes

    http://virtual-backend-ipaddress:virtual-port/myBasepath

     

    Rick



  • 3.  Re: Recording an API, HTTP protocol.

    Posted Apr 17, 2016 06:06 AM

    Thanks Rick for your reply, as you said it worked out.