HTTP 403 for SOAP VirtResponse when using Start Step
I am using ReadyAPI 1.9.0-m-SNAPSHOT (nightly build) to try to set up testing of synchronous and asynchronous microservices, which communicate via SOAP, by isolating them and visualizing all external connectivity.
The system should perform the following:
- ServiceA sends a SOAP request to ServiceB to get some data (supply details)
- ServiceB sends a SOAP request to ServiceC to get part of the data
- ServiceB sends a SOAP request to ServiceD to get the rest of the data
- ServiceB responds to the original request from ServiceA with all of the data
To perform this action in ReadyAPI I have created the following test case:
- Step 1: SOAP Request to ServiceB (/getSupplyDetails)
- Step 2: SOAP VirtResponse listening on port 2320 for calls to /virt/coreaccess, with the 'Start step' configured to be Step 1
- Step 3: SOAP VirtResponse listening on port 2324 for calls to /virt/supplymanagementdb, with the 'Start step' configured to be Step 1
In the logs I see the following:
Mon Nov 21 15:37:56 GMT 2016:INFO:Mounted WSDL for interface [ERS Core Access SoapBinding] at [/virt/coreaccess?WSDL] Mon Nov 21 15:37:56 GMT 2016:INFO:Started Virt [ERS Core Access getSupplyDetails response] on port [2320] at path [/virt/coreaccess] Mon Nov 21 15:37:57 GMT 2016:INFO:Mounted WSDL for interface [SmartSupply DB SoapBinding] at [/virt/supplymanagementdb?WSDL] Mon Nov 21 15:37:57 GMT 2016:INFO:Started Virt [Supply Management database response] on port [2324] at path [/virt/supplymanagementdb] Mon Nov 21 15:37:58 GMT 2016:INFO:Got response for [Supply Management Service SoapBinding.getSupplyDetails:Send getSupplyDetails request] in 44ms (537 bytes) Mon Nov 21 15:37:58 GMT 2016:INFO:Stopped Virt [Supply Management database response] on port [2324] Mon Nov 21 15:37:58 GMT 2016:INFO:Stopped Virt [ERS Core Access getSupplyDetails response] on port [2320]
The issue, is that on the server it is getting a HTTP 403 request when trying to access the virts as seen in the following error:
Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '403: Remote access forbidden' when communicating with http://<redacted>:2320/virt/coreaccess. However, if I create 3 separate test cases with 1 for each step and manually run each of the test cases for the virts, then the test case for the request, it is successful.
By doing some investigation by adding in waits and seeing what happens on the server, it looks as though when it says "Started Virt" in the logs it hasn't actually started the virt but instead started listening on that port sending 403 responses to any requests. When it gets to the actual step, it then sends the correct response, but in my case as Step 1 is synchronous and will not continue until Steps 2 & 3 have responded, the test fails.
Has anyone came across this or have any idea how to fix this or workaround this?