Bug 780406 (SOA-2837) - Add text to Teiid "weather" dynamic VDB example README
Summary: Add text to Teiid "weather" dynamic VDB example README
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-2837
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: Examples, EDS
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 5.1.0.ER8
Assignee: Van Halbert
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-21 15:10 UTC by Len DiMaggio
Modified: 2012-06-19 20:21 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-28 14:32:29 UTC
Type: Bug


Attachments (Terms of Use)
README.txt (4.52 KB, text/plain)
2011-01-21 16:03 UTC, Van Halbert
no flags Details
screen shot of weather VDB execution (9.23 MB, text/plain)
2012-06-19 18:10 UTC, rudolf..chati@unisys.com
no flags Details
jboss 5.1.0-GA log of weather VDB SOAP sample 2 - note that REST sample works. See also previous attachment with screenshot of simleclient execution (408.16 KB, text/plain)
2012-06-19 18:14 UTC, rudolf..chati@unisys.com
no flags Details
EDS Quckstart - DynamicVDB Webservices (6.00 KB, application/octet-stream)
2012-06-19 20:21 UTC, Van Halbert
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-2837 0 Major Closed Add text to Teiid "weather" dynamic VDB example README 2015-07-07 16:11:48 UTC

Description Len DiMaggio 2011-01-21 15:10:44 UTC
project_key: SOA

The readme for the weather example suggests that the reader use SQLSquirrel to access the Teiid VDB - but it does not include details on creating the SQLSquirrel alias to connect to Teiid.

See below for the text to add - also had some additional formatting/content changes:

This example  demonstrates how  to use the  WS Translator to  call web
services. A dynamic VDB (defined in weather-vdb.xml) is used to access
the  National  Weather  Service's  SOAP/REST  services  at  this  URL:
http://www.nws.noaa.gov/forecasts/xml/

Steps:

1) Copy the following files to the <jboss.home>/server/<server
   profile>/deploy directory.
	- weather-vdb.xml
	- weather-ds.xml

2) Start the JBoss Container

3) Edit  JDBCClient.java and  specify a  username and  password  for a
   valid user account.

4) Use the simple client example run script, e.g. 

$./run.sh localhost 31000 weather "some query"

NOTE - depending on your OS/Shell the quoting/escaping required to run
the example can be complicated.  It  would be better to install a Java
client, such as SQLSquirrel, to run the example listed queries below.

For SQLSquirrel, the steps to follow are:

1) Create a new alias with these properties:
   * URL in this form: jdbc:teiid:weather@mm://localhost:31000
   * Driver: teiid-client.jar (reference the EDS install directory)
   * Class name: org.teiid.jdbc.TeiidDriver

2) Cut and paste the queries listed below into the SQLSquirrel SQL frame and
   run them.

Example queries:

1. REST access  of the default  endpoint augmented by a  query string.
   The  query string is  formed with  the querystring  function, which
   ensures  proper  encoding  of  the name/value  pairs.   The  invoke
   procedure has  a return parameter, called result  that contains the
   XML value of  the result document.  This document  is then fed into
   the XMLTABLE function to extract row values.  Note that the default
   invocation binding  has been set in  the vdb xml to  HTTP, which is
   the proper setting for REST.
   
   select t.* from 
	(call weather.invoke(action=>'GET', 
		endpoint=>querystring('', '38.99,-77.02 39.70,-104.80 47.6,-122.30' as listLatLon, 
			'time-series' as product, '2004-01-01T00:00:00' as "begin", 
			'2013-04-20T00:00:00' as "end", 'maxt' as maxt, 'mint' as  mint)
	)) w, 
	XMLTABLE('/dwml/data/location' passing w.result 
		columns "location-key" string, lattitude string path 'point/@latitude', 
			longitude string path 'point/@longitude') t

2. SOAP11 RPC call providing all of the parameter values for the
   invoke procedure.  With a SOAP invocation, the action is used to
   convey the SOAPAction header value if needed.  Also note the use of
   the endpoint here with an absolute URL, which will be used instead
   of the default on the datasource.

   select xmlserialize(document w.result as string) from 
	(call weather.invoke(action=>'http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl#LatLonListZipCode', 
		endpoint=>'http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php',
		binding=>'SOAP11',
		request=>'
			<ns1:LatLonListZipCode xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
					xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
					xmlns:ns1="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl">
				<zipCodeList xsi:type="ns2:zipCodeListType" xmlns:ns2="http://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd">63303</zipCodeList>
			</ns1:LatLonListZipCode>')) as w

(SEE the DatabaseMetadata on the invoke procedure for a full description 
of the parameters.)

Comment 1 Van Halbert 2011-01-21 15:13:06 UTC
Link: Added: This issue is related to TEIID-1450


Comment 2 Paul Nittel 2011-01-21 15:22:41 UTC
For use with the simpleclient, here's the whole execution string. (Note the username and password are hardcoded in the simpleclient, which may prevent simple use if user/teiid is not a valid user/password.)

./run.sh <server> 31000 weather "select t.* from (call weather.invoke(action=>'GET', endpoint=>querystring('', '38.99,-77.02 39.70,-104.80 47.6,-122.30' as listLatLon, 'time-series' as product,  '2004-01-01T00:00:00' as \"begin\", '2013-04-20T00:00:00' as \"end\", 'maxt' as maxt, 'mint' as  mint) )) w, XMLTABLE('/dwml/data/location' passing w.result columns \"location-key\" string, lattitude string path 'point/@latitude', longitude string path 'point/@longitude') t"

Comment 3 Len DiMaggio 2011-01-21 15:36:30 UTC
Thx Paul - that's on Linix, correct?


Comment 4 Paul Nittel 2011-01-21 15:40:09 UTC
Yes, Len. That's on linUx. ;-) Windows should be the same, except for the ./run.sh part.

Comment 5 Van Halbert 2011-01-21 16:03:49 UTC
Updated readme with QE recommendations.

Comment 6 Van Halbert 2011-01-21 16:03:49 UTC
Attachment: Added: README.txt


Comment 7 Van Halbert 2011-01-21 19:31:48 UTC
The readme file change has been made and is in the soa build process teiid examples.

Comment 8 Len DiMaggio 2011-01-28 14:32:28 UTC
Verified fixed in ER8 build.

Comment 9 rudolf..chati@unisys.com 2012-06-19 18:10:23 UTC
Created attachment 593032 [details]
screen shot of weather VDB execution

Comment 10 rudolf..chati@unisys.com 2012-06-19 18:14:05 UTC
Created attachment 593033 [details]
jboss 5.1.0-GA log of weather VDB SOAP sample 2 - note that REST sample works. See also previous attachment with screenshot of simleclient execution

Thanks ! I'm using TEIID-7.7.0-final installed with spring and JBOSS 5.1.0.GA plus jbossws-cxf-3.4.1.

Thanks and regards 
Rudi 

NOTE: This is urgent please as I'm prepping for a demo on Thursday 06/21

Comment 11 rudolf..chati@unisys.com 2012-06-19 18:15:42 UTC
I'm still getting the parsing error with the SOAP sample even with the above corrections.
I seem to get generally the problem with the weather SOAP sample and other samples with SOAP11 binding.
Thanks for the help.
Rudi

Comment 12 Van Halbert 2012-06-19 20:21:02 UTC
Created attachment 593064 [details]
EDS Quckstart - DynamicVDB Webservices

Attached is the eds_dynamicvdb_webservices.zip quick start.  Unzip into the samples/quickstarts of the SOA install and follow the readme.  Note: to run the SOAP11 query,  execute:   ant runtest -Dprompt=true

then select #2 to run that query.


Note You need to log in before you can comment on or make changes to this bug.