Skip to content

Commit

Permalink
add teiid embbed ws post
Browse files Browse the repository at this point in the history
  • Loading branch information
kylinsoong committed Sep 17, 2014
1 parent 3998c83 commit 6deb362
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
45 changes: 45 additions & 0 deletions _posts/2014-09-17-teiid-embedded-ws.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
layout: blog
title: "Teiid embedded samples WebService"
date: 2014-09-17 11:06:00
categories: teiid
permalink: /teiid-ws
author: Kylin Soong
duoshuoid: ksoong2014091701
---

Teiid Embedded is a light-weight version of Teiid, it contain an easy-to-use JDBC Driver and an embed Query Engine. The Embedded mode supply almost all Teiid features without JEE Container involved, it supply a convenient way for Users who want integrate Teiid with their Application.

This document show how Teiid Embedded use Web Service as data source, the architecture as below:

![teiid-embbed-ws]({{ site.baseurl }}/assets/blog/teiid-embbed-ws.png)

## JVM

JBoss EAP 6.3 hold the `StateService.jar` run on JVM, it supply State WebService for users to extract all states information, or extract only one state information via stateCode(for example, state code `CA` will get California information).

> Note that: In this example, JBoss EAP 6.3 run on localhost. [ Web Service StateService Example]({{ site.baseurl }}/jaxws-stateservice) have detailed steps for deploy `StateService.jar` and StateService.
## StateServiceVDB

A Virtual Database (VDB) is an artifact that defines the logical schema model combining one or more physical data sources to provide easy data integration. In this example, StateService VDB has Model `StateService` point to Web Service run on JBoss Server.

[The completed content of webservice VDB](https://github.com/jbosschina/teiid-embedded-samples/blob/master/vdb/webservice-vdb.xml)

## JVM

Java Application run on JVM, load the `StateServiceVDB` and invoke Web Service via JDBC. The mainly Code Snippets:

~~~
init("translator-ws", new WSExecutionFactory());
WSManagedConnectionFactory managedconnectionFactory = new WSManagedConnectionFactory();
server.addConnectionFactory("java:/StateServiceWebSvcSource", managedconnectionFactory.createConnectionFactory());
start(false);
server.deployVDB(new FileInputStream(new File("vdb/webservice-vdb.xml")));
conn = server.getDriver().connect("jdbc:teiid:StateServiceVDB", null);
~~~

[Completed Source code](https://github.com/jbosschina/teiid-embedded-samples/blob/master/src/test/java/com/teiid/embedded/samples/ws/TestWebServiceDataSource.java)

4 changes: 2 additions & 2 deletions about/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<th>Link</th>
</tr>
<tr>
<td>Reviewers of WildFly Performance Tuning</td>
<td>Reviewer of WildFly Performance Tuning</td>
<td><a href="http://books.google.com.hk/books?id=clHlAwAAQBAJ&pg=PT21&lpg=PT21&dq=WildFly+Performance+Tuning+kylin+soong&source=bl&ots=c8bKlfTESd&sig=uEe7sb-mOkB3IUJkW4h-nUKVyDw&hl=en&sa=X&ei=zxsYVILKL4afugSgn4K4Dw&ved=0CDAQ6AEwBA#v=onepage&q=WildFly%20Performance%20Tuning%20kylin%20soong&f=false" title="Fork me on Github">https://www.packtpub.com/collection/..</a></td>
</tr>
<tr>
Expand All @@ -21,7 +21,7 @@
<td><a href="http://blog.csdn.net/kylinsoong" title="Chinese Blog">http://blog.csdn.net/kylinsoong</a></td>
</tr>
<tr>
<td>ITEeye Blog</td>
<td>ITEye Blog</td>
<td><a href="http://kylinsoong.iteye.com/" title="Chinese Blog">http://kylinsoong.iteye.com/</a></td>
</tr>
</tbody>
Expand Down
Binary file added assets/blog/teiid-embbed-ws.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6deb362

Please sign in to comment.