404 error in the Live Invocation step for a HTTP Virtual Service

Document ID : KB000094921
Last Modified Date : 10/07/2018
Show Technical Document Details
Issue:
An HTTP virtual service was created and it contains a Live Invocation step to route some requests to the real system.
The real system is SOAP based service and when the request is being forwarded through the live invocation step, I am receiving a 404 error.
Environment:
All Supported DevTest releases.
Cause:
The option  'Do not modify host header parameter received from client' was selected in the Live Invocation step.
When selected, this option instructs the live invocation step to forward the host header that is received from the client application to the target server.  
When this option is not selected, the live invocation regenerates the host header parameter to be host: <target host>:<target port>.

An example collected when running a VSM in the ITR.
1. When 'Do not modify host header parameter received from client' is enabled, the below is the request being forwarded to the target system: 
POST /abc/123 HTTP/1.1  
Pragma: no-cache  
Cache-Control: no-cache  
Accept-Encoding: gzip,deflate  
SOAPAction: /SoapAction/SoapAction//SoapAction
Content-Type: text/xml;charset=UTF-8  
Content-Length: 1843  
Host: HostWhereVSMisRunning:PortVSMisListening  
Connection: Keep-Alive  
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)  

2.  When 'Do not modify host header parameter received from client' is disabled, this is what happens: 
The following incoming request received by VSM:
POST / HTTP/1.1  
Accept-Encoding: gzip,deflate  
Content-Type: application/xml  
SOAPAction: /SoapAction/SoapAction//SoapAction
Content-Length: 1809  
Host: HostWhereVSMisRunning:PortVSMisListening  
Connection: Keep-Alive  
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)  

and the host header is regenerated: 
POST /abc/123 HTTP/1.1  
Accept-Encoding: gzip,deflate  
Content-Type: application/xml  
SOAPAction: /SoapAction/SoapAction//SoapAction 
Content-Length: 1809  
Host: TargetSystemHost:TargetPort  
Connection: Keep-Alive  
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)  

If the target system does any kind of validation on the host header parameter, then we can get issues when enabling 'Do not modify host header parameter received from client'. 
Resolution:
Do not select the option 'Do not modify host header parameter received from client' in the Live Invocation step.
Additional Information: