Difference between revisions of "GetAnagrafica ws bottom-up method"

From GreenVulcano Wiki
Jump to: navigation, search
(Web Service wizard)
(System section)
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
We start from a {{GVESB}} service "getAnagrafica" that simply returns the anagrafica presents in table Anagrafica.
+
== Definition ==
  
== SYSTEM SECTION ==
+
Let's start from a {{GVESB}} [[service]] "getAnagrafica" that simply returns the anagrafic data present in table ''Anagrafica''.
The first image shows how create an operation system section.
+
 
In the tag system define a new Channel "CH_DB" and add a [[db-call]] operation, in [[db-call]] operation set the parameters for the Element DBOoperation, Statement and ResultSet:
+
== System section ==
 +
The first image shows how to create an operation system section.
 +
In the tag system let's define a new Channel "CH_DB" and add a [[db-call]] operation, in [[db-call]] operation set the parameters for the Element DBOoperation, Statement and ResultSet:
 
*[[DBOperations]]-->[[DBOperations|DataSourceConnection]]
 
*[[DBOperations]]-->[[DBOperations|DataSourceConnection]]
 
**jndi-name: insert the name of jndi DataSource in this example ds.anagrafica
 
**jndi-name: insert the name of jndi DataSource in this example ds.anagrafica
 
*Statement
 
*Statement
 
**StatementValue: in this field insert the following query "select cognome,nome,citta from anagrafica"
 
**StatementValue: in this field insert the following query "select cognome,nome,citta from anagrafica"
*[[ResultSet]]-->[[Formatter|QueryFormatter]]
+
*[[ResultSet]]-->[[QueryFormatter]]
 
**type: choose base_formatter
 
**type: choose base_formatter
 
**structure: ONLY_DATA, remember if you don't want also metadata form query select for filed structure the value ONLY_DATA
 
**structure: ONLY_DATA, remember if you don't want also metadata form query select for filed structure the value ONLY_DATA
Line 17: Line 19:
 
| [[File:3buws.png|thumb|WebService Wizard third window]]
 
| [[File:3buws.png|thumb|WebService Wizard third window]]
 
|}
 
|}
The system section has been configured
 
  
== SERVICE SECTION ==
+
== Service section ==
 
This section shows the getAnagrafica service configuration.
 
This section shows the getAnagrafica service configuration.
To configure the service performs the following steps:
+
To configure the [[service]] do the following steps:
 
#On the elements [[Service]] add a service with name "getAnagrafica".
 
#On the elements [[Service]] add a service with name "getAnagrafica".
 
#On the "request" node set db-call as operation
 
#On the "request" node set db-call as operation
Line 41: Line 42:
 
| [[File:6buws.png|thumb|right|Xml data mapper]]
 
| [[File:6buws.png|thumb|right|Xml data mapper]]
 
|}
 
|}
 +
 
== Web Service wizard ==
 
== Web Service wizard ==
 
On service element choose bottom-up development method, on the opened page set the following parameter:
 
On service element choose bottom-up development method, on the opened page set the following parameter:
 
*Web Service name: getAnagrafica
 
*Web Service name: getAnagrafica
*Target namespace operation: http://www.greenvulcano.it/greenvulcano
+
*Target namespace operation: <nowiki>http://www.greenvulcano.it/greenvulcano</nowiki>
 
*Operation to bind: choose getAnagrafica - RequestReply
 
*Operation to bind: choose getAnagrafica - RequestReply
 
*choose soap trasport as protocol
 
*choose soap trasport as protocol
 
*set input type Web Service: body (this indicate that the input at getAnagrafica service is only the body of soap request)
 
*set input type Web Service: body (this indicate that the input at getAnagrafica service is only the body of soap request)
 
*set data provider name: domWSDataProvider
 
*set data provider name: domWSDataProvider
If you are familiary with soapui framework you can test the web service, the image "WebService soapui test" show how to.
+
If you are familiary with soapui framework you can test the web service, the image "WebService soapui test" shows how to.
 
{|
 
{|
 
|-
 
|-
Line 57: Line 59:
 
| [[File:10buws.png|thumb|right|WebService soapui test]]
 
| [[File:10buws.png|thumb|right|WebService soapui test]]
 
|}
 
|}
 +
If you want, you can [[Media:getAnagrafica.zip|download]] {{VULCON}} configuration for this example.

Latest revision as of 15:59, 3 April 2012

Definition

Let's start from a GreenVulcano® ESB service "getAnagrafica" that simply returns the anagrafic data present in table Anagrafica.

System section

The first image shows how to create an operation system section. In the tag system let's define a new Channel "CH_DB" and add a db-call operation, in db-call operation set the parameters for the Element DBOoperation, Statement and ResultSet:

  • DBOperations-->DataSourceConnection
    • jndi-name: insert the name of jndi DataSource in this example ds.anagrafica
  • Statement
    • StatementValue: in this field insert the following query "select cognome,nome,citta from anagrafica"
  • ResultSet-->QueryFormatter
    • type: choose base_formatter
    • structure: ONLY_DATA, remember if you don't want also metadata form query select for filed structure the value ONLY_DATA
WebService Wizard first window
WebService Wizard second window
WebService Wizard third window

Service section

This section shows the getAnagrafica service configuration. To configure the service do the following steps:

  1. On the elements Service add a service with name "getAnagrafica".
  2. On the "request" node set db-call as operation
  3. As output-service set a xsl trasformation to transform the data as Web Service XSD expected.

To create a new trasformation go in section GvDataTrasformation and execute the following steps:

  1. On section Trasformation add new xsl trasformation
  2. On the opened page set:
    1. trasformation name:"getAnagrafica"
    2. Data source:Default
    3. xsd input: choose database.xsd
    4. root xsd input: RowSet (is the root element that return the query)
    5. xsd output: anagrafica.xsd (the schema that the Web Service expected)
    6. root XSD output: the root element of the xsd.

To create the xsl trasformation between the file Database.xsd and anagrafica.xsd you can use XML Data mapper tool

WebService Wizard fourth window
WebService Wizard five window
Xml data mapper

Web Service wizard

On service element choose bottom-up development method, on the opened page set the following parameter:

  • Web Service name: getAnagrafica
  • Target namespace operation: http://www.greenvulcano.it/greenvulcano
  • Operation to bind: choose getAnagrafica - RequestReply
  • choose soap trasport as protocol
  • set input type Web Service: body (this indicate that the input at getAnagrafica service is only the body of soap request)
  • set data provider name: domWSDataProvider

If you are familiary with soapui framework you can test the web service, the image "WebService soapui test" shows how to.

WebService Wizard first window
WebService Wizard second window
WebService Wizard third window
WebService soapui test

If you want, you can download VulCon configuration for this example.