Nullius
13 years agoOccasional Contributor
SOAP response vs JDBC response
Hi there,
Because our test data changes quite a lot, I want to make 'dynamic' assertions.
In order to test our webservice, we need to make sure the data we receive from it matches the data in the database (an MSSQL server) and results should be in the same order!
I've managed to get the connection working properly and all JDBC requests and datasource functions are working fine.
But now comes the tricky part (for me :-)):
E.g.: I get the following list from the DB (in whatever format):
The assertion for the following SOAP response should succeed:
However, for the following responses, the assertion should fail:
I've tried to use datasources, JDBC requests, xqueries (with for loops, some loops, ...) but haven't managed to find a decent result.
I don't think the datasource loop is the correct solution because the webservice should only be called once.
Also, if possible, I'd like to do this without Groovy scripting.
However, if not possible with xqueries, Groovy scripts are welcome!
Thanks in advance :-)
Because our test data changes quite a lot, I want to make 'dynamic' assertions.
In order to test our webservice, we need to make sure the data we receive from it matches the data in the database (an MSSQL server) and results should be in the same order!
I've managed to get the connection working properly and all JDBC requests and datasource functions are working fine.
But now comes the tricky part (for me :-)):
E.g.: I get the following list from the DB (in whatever format):
Record1
--ID: 1
--Name: Test
Record2
--ID: 3
--Name: Testing
The assertion for the following SOAP response should succeed:
<Rows>
<Row>
<ID>1</ID>
<Name>Test</ID>
</Row>
<Row>
<ID>3</ID>
<Name>Testing</ID>
</Row>
</Rows>
However, for the following responses, the assertion should fail:
<Rows>
<Row>
<ID>1</ID>
<Name>Test</ID>
</Row>
</Rows>
<Rows>
<Row>
<ID>1</ID>
<Name>Testing</ID>
</Row>
<Row>
<ID>3</ID>
<Name>Test</ID>
</Row>
</Rows>
<Rows>
<Row>
<ID>3</ID>
<Name>Testing</ID>
</Row>
<Row>
<ID>1</ID>
<Name>Test</ID>
</Row>
</Rows>
I've tried to use datasources, JDBC requests, xqueries (with for loops, some loops, ...) but haven't managed to find a decent result.
I don't think the datasource loop is the correct solution because the webservice should only be called once.
Also, if possible, I'd like to do this without Groovy scripting.
However, if not possible with xqueries, Groovy scripts are welcome!
Thanks in advance :-)