Facing 404 not found error using Responder correlation in SV9.10.2
![[Deleted User]](https://us.v-cdn.net/6029336/uploads/defaultavatar/nEGH2ZRDEI73I.jpg)
Hi Team,
Facing 404 not found error When using CDATA(Ex:TransactionID) element Xpath to enable correlation under request body responder correlation in virtualize 9.10.2
Steps to Reproduce:
1. Create SOAP responder and paste the response(attached file) in the literal view and change it to form XML
2. Navigate to the Responder Correlation-> Request Body-> Check Enable correlation
3. Click on Add and change it to literal view and paste the request(attached file) and then navigate to tree view.
4. Select the TransactionType and click on Ok.
5. Now create SOAP Client and paste the request(in attached file) in the client and paste the VA URL(http://localhost:9080/Try) in the ENDPOINT under Transport.
6. Run the SOAP Client
7. Will find the below Error message once test has ran
Error Message:
Received HTTP Response Code 404: Not Found
Additional Details:
Could not find a valid Message Responder to respond to this request.
Be sure you have a Message Responder with correlation criteria that match this message.
1 virtual asset attempted to process this request:
Try
MR
Correlation type: Transport
Disabled : true
Correlation type: Request Body
[criteria=local-name(/Request/*[2])="TransactionID", expected=true, actual=false, results=false]
Request :
<?xml version="1.0" encoding="UTF-8"?>
<Request><BankID>89</BankID><TransactionID/><TransactionType/><ServiceType>SEWA</ServiceType><ConsumerNumber>0034925251</ConsumerNumber><TransactionDateStamp>12/12/2017 01:34:23</TransactionDateStamp><ChannelID>WWW000000000002</ChannelID></Request>
.
Attached is the PVA and tst.
Please help me to resolve the issue. Thanks in advance
Regards,
Lavanya.
Comments
-
You will need a different XPath. CDATA is just a text node which in your case just happens to be another XML document. The embedded XML document would first need to be extracted with one XPath expression and then processed by a second XPath Expression. I have an idea about how to change the XPath for your correlation but will need to verify. I will post a followup if/when I'm able to make a concrete suggestion.
1 -
You probably want something like this:
parse-xml(/*:Envelope/*:Body/*:RequestService/*:inputXml/text())/Request/TransactionID/text()
First, you must parse the "inputXML" text node as an XML document using "parse-xml" XPath function. Next, you extract Request/TransactionID/text() (or whatever you need) from that nested document. Hope this makes sense
0 -
Thank you @benken_parasoft. parse-xml-fragment helps to resolve the issue.
0