compare web-service response values and database query values? - karate

Can I validate a web-service response with a database query?
Run webservice --> Get response --> Capture response
Run corresponding SQL Query
Compare response with SQL query result

Yes. Use Java interop. There are two examples in the demos. For example, this one.

Related

What is the best way to copy a set of records from Oracle to SQL Server using code where table and columns are identical?

Basic idea is we have our Silverlight application, and need to provide data to third party application when user want to send (export) a record of T_MainList
We maintain our data in Oracle and third party's SQL Server, third party people are providing us access to write a stored procedure, and a web service if needed.
Same table schema is maintained on both databases (Oracle and SQL Server), need to copy a record of T_MAINLIST on user request and it has other dependent data sublist can have multiple records and each sublist record can have multiple subsublist records
Is serializing data of whole dataset as xml and send them in stored procedure. De-serialized data in stored procedure (on SQL server) and insert data into the appropriate tables good idea?
Oracle has the possibility to directly connect to another database, see the example for MS SQL server here. That should be faster then using xml ex- and import...

Convert Mdx Query to Sql Query in Java

My current system supports Sql Query. We are integrating our application with another application which generates the Mdx query from UI based on user selection. During the integration, we need to process this Mdx query and convert into Sql query so that we can use existing api to execute and process the query results.
I am looking for an api which converts Mdx query to Sql query.
Appreciate your help on providing details on this.

Pentaho Get data via http GET or POST request

I have a nodejs server that uses tds to connect to a sqlserver database and returns the requested query in xml or json format.
The request would be in http and include the sql query i.e.
Select * from customers
The node server works fine, but I now want to connect to this from Pentaho and have been trying to figure out how I can do this.
is this possible and if so how ?
If you use the CTools, you can use an AjaxRequestComponent or directly in jquery with $.ajax

Storing WCF Soap request as XML Type in SQL Server 2008 R2

I have a legal requirement to store the entire SOAP request to my service in a database. I have SQL Server 2008 R2. And I recently learnt about the XML datatype in SQL Server. My requirement is to store the request xml and expose the same in the get method of the service. This data is not 'transactional' as in nobody can make updates to this request. So is the XML type a good candidate for this? And I want to be able to tie a schema with this.
Request Id int
Request XML
As long as these SOAP requests are indeed well-formed XML - sure, you can use the XML datatype for this - that's what it's been introduced for in SQL Server 2005 !
One point to be aware of: the XML is not stored as is as a text representation - it is tokenized and stored in an optimized fashion. So when you ask for the XML back from SQL Server, you'll get an XML representation that is semantically correct - but it might not be exactly the same as you stored into the XML column. SQL Server can e.g. replace an explicit opening and closing tag (<SomeNode></SomeNode>) with an auto-closing tag (<SomeNode />) or do other optimizations. Just something to know when you're using the XML datatype in an auditing capacity as you seem to intend it for.

SQL SELECT WHERE value IN ('Huge list of Values')

Note: C# 3.5 application calling a SQL Server 2005 DB on a remote server.
I'm developing a two step process.
1) I search a Windows Indexing Service for a list of files that contain a given word, such as "Bob".
2) I then need to retrieve a list of rows from a DOCUMENT table in a SQL DB by passing in the list of filenames from the Indexing Service.
At the moment I retrieve a list from the indexing service AND all rows from the DOCUMENT table, then filter them in code. This isn't practical as there are 10,000+ documents and the database is through a firewall.
I considered creating a query such as:
SELECT DocName FROM Documents WHERE DocName IN ({list of files from indexing service})
...but given the list of files could be thousands it won't work.
So, what's the best thing I can do? I don't want to query the DB for all 10,000+ rows and pass them back over the firewall (takes 10 minutes). I somehow need to pass in the list of filenames retrieved from the indexing service.
How would linq work in this scenario?
Any advice greatly appreciated.
If you had SQL Server 2008, you could use Table Valued Parameters, but for 2005, there's nothing quite as elegant.
The simplest solution I can think of is:
Create a table in the database
Bulk Insert the results of your Indexing Service into the table
Join your query to this table to filter the results
Retrieve the filered results
It's not a great solution, but I don't know that a great solution exists - that's why TVPs were created.
You can evaluate different solutions for this kind of "massive" operation, may be not necessary to use linq. For example, try to implement a stored procedure on SQL Server, that receives in input the list of file name and returns the list of documents.
I opted for a solution similar to what Bazzz mentioned.
I've set up a nightly operation to copy the required fields from the database and set meta tags on the document files (PDFs). The meta data can then be used in the Indexing Service ;o)
This has proved to be a good solution for this instance, but otherwise what Hallainzil said would've been the best option albeit painful on Sql Server 2005.