Use SOAP-UI to correlate messages
![Link message](/integrationapplicationtalents/sites/hot_iatalents/files/styles/keyvisual_content_xlarge_1488x700/public/2018-12/shutterstock_588813473.jpg?h=d1cb525d&itok=_4NlZp6H)
At a project where I work I had an issue. Messages are put on a queue with the help of SOAP-UI and HermesJMS. The response message is put by the OSB on a separate response queue. In the request message there is a correlationID defined. I want that SOAP-UI checks the correlationID in the response message so that this does match the correlationID in the request message.
This is what I did to accomplish it:
First I created a Groovy script. In this script a correlationID is generated
![Groovy script](/integrationapplicationtalents/sites/hot_iatalents/files/styles/content_image_medium_max/public/2018-12/Afbeelding%201%20blog%20SOAP-UI.jpg?itok=vEz3UFRF)
When you run the script, you can see in the TestCase editor the outcome of the script
![TestCase editor](/integrationapplicationtalents/sites/hot_iatalents/files/styles/content_image_medium_max/public/2018-12/Afbeelding%202%20blog%20SOAP-UI.jpg?itok=tetAHfrS)
Then in the request message add a reference to the variable. This is the variable name between the double quotes
![Variable name](/integrationapplicationtalents/sites/hot_iatalents/files/styles/content_image_medium_max/public/2018-12/Afbeelding%203%20blog%20SOAP-UI.jpg?itok=1nUjJRLv)
After that add an Assertion to the request. The Assertion is of the type XPath Match.
![XPath Match](/integrationapplicationtalents/sites/hot_iatalents/files/styles/content_image_medium_max/public/2018-12/Afbeelding%204%20blog%20SOAP-UI.jpg?itok=PrSCcjx7)
In the XPatch Match Configuration window declare the namespaces, specify the XPath expression and then press select from current.
I didn’t expect to put quotes surrounding the reference to the variable. It seems to me it’s a literal expression, but it isn’t so!
![Literal expression](/integrationapplicationtalents/sites/hot_iatalents/files/styles/content_image_medium_max/public/2018-12/Afbeelding%205%20blog%20SOAP-UI.jpg?itok=qYC1oAeO)
Now you can run your request and when the outcome of XPath Match is the same as the expected result in the Assertion, it says VALID.
![VALID](/integrationapplicationtalents/sites/hot_iatalents/files/styles/content_image_medium_max/public/2018-12/Afbeelding%206%20blog%20SOAP-UI.jpg?itok=1JaTaPMC)
Geen reacties
Geef jouw mening
Reactie plaatsenReactie toevoegen