Difference between revisions of "Web Services"

From GreenVulcano Wiki
Jump to: navigation, search
(Created page with "==Definition== One of the most commonly used technologies are Web Services, that are the exposure of business services to the external world, using a contract called WSDL. VulC...")
 
 
(67 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
==Definition==
 
==Definition==
One of the most commonly used technologies are Web Services, that are the exposure of business services to the external world, using a contract called WSDL.  
+
[http://en.wikipedia.org/wiki/Web_service Web Service] is a method of communication between different machines.
 +
Using a Web Service it is possible to publish business services using a contract, called WSDL.  
  
VulCon helps the user to expose an ESB service as a web service, leaving the user the task to define data structures in order to interact with the external world
+
{{GVESB}} provides a very simple method that helps developers to manage {{GVWS}} operations as:
''ExcelReaderCall'' plug-in is compatible with all Excel formats up to version 2003, and it is very simple to configure. It receives in input a binary stream containing the Excel file, and returns in output a corresponding XML structure. At the output of ''ExcelReaderCall'' plug-in is possible to apply a [[ChangeGvBufferNode]] operation (with [http://en.wikipedia.org/wiki/OGNL OGNL] script or an [http://en.wikipedia.org/wiki/XSL XSL] transformation) to retrieve all interested data.
+
*create
 +
*invoke
 +
*deploy
 +
*publishing
 +
*undeploy
 +
Any service flow can be published in {{GVESB}} as a Web Service. {{L_VULCON}} helps the user to create or invoke a Web Service, leaving the user the only task to define the data structures in order to interact with the external world.
  
{{GVESB}} provides two different tools, {{L_GVCONSOLE}} and {{L_VULCON}}, to configure all supported plug-ins in GV services.
+
{{GVESB}} provides a complete management of {{GVWS}} through Axis2 platform. It supports:
 +
*Stateful and asynchronous {{GVWS}}
 +
*Processing SOAP Messages with XML parsing, using the more efficient AXIOM pull-parser instead of DOM (Document Object Model)
 +
*Increased Scalability
 +
*Hot deploy and undeploy
  
=={{VULCON}} / {{GVCONSOLE}} Configuration==
+
==Create new {{GVWS}} with {{VULCON}}==
''excelreader-call'' is the operation that must be configured into {{L_VULCON}} or  {{L_GVCONSOLE}} [[System section]], to convert an Excel file in [[GVBuffer.object]] field, in an XML document.  
+
{{VULCON}} provides two wizards for creating new {{GVWS}}. The first one starts from a {{GVESB}} service and creates the WSDL and the AAR to deploy ([[bottom-up development method]]), while the second one starts from a WSDL and creates {{GVESB}} services for each chosen operation ([[top-down development method]]).
In order to add an operation ''excelreader-call'' you must define the following fields:
+
If you need to invoke a Web Service operation, instead, you can choose [[Wizard Call Web Service]] or, if you want to simply redirect a Web Service call to a different endpoint, you can choose [[Wizard Proxy Web Service]]. The wizard can be activated opening the context menu on the Core view tree's Service element.
 +
<div class="version_ge3.3">
 +
You can publish any {{GVESB}} core service using a generic Web Service interface. By means of this feature, you can invoke directly the following core service operations, depending on the how the {{GVESB}} core service has been designed:
 +
*requestReply
 +
*request
 +
*getReply
 +
*getRequest
 +
*sendReply
 +
*execute
 +
You can get the generic WSDL at location:<pre>http://<host>:<port>/gvaxis2/services/GreenVulcanoWebservice?wsdl</pre>
 +
In order to invoke the service, you have to set all required parameters. This can be done also using the [[Wizard Enable GreenVulcano Web Service]].
 +
</div>
  
* ''class'': it.greenvulcano.gvesb.virtual.excel.reader.GVExcelReaderCallOperation (java class that manage ''ExcelReaderCall'' invocation).
+
=={{GVCONSOLE}} Web service section==
* ''name'': this field identify the operation name that you will use in service definition.
 
* ''onlyData'': is a boolean field, it enabled in output cell formatting informations.  If 'false', insert in the XML document also the cell formatting informations.
 
  Default to 'true'.
 
* ''type'': call
 
  
 +
The Web Service section in {{GVCONSOLE}} contains five main pages:
 +
#[[General parameter]]: shows the general configuration of business web services and the UDDI Registry's configuration,
 +
#[[WSDL Section]]: allows to generate or delete WSDL files, and to deploy the Web Service
 +
#[[UDDI Section]]: allows to publish Web Service in UDDI registry, if the UDDI registry has been configured.
 +
#BPEL Deployed Processes
 +
#BPEL Currently Available Instances
  
The following example shows the configuration generated from {{L_VULCON}} or {{L_GVCONSOLE}} when you configure an ''excelreader-call'' operation:
+
If you are familiar with [http://axis.apache.org/axis2/java/core/docs/webadminguide.html#Intro  Axis2 console] it's possible to look up the following link:<pre>http://ipaddredss:portnumber/gvaxis2</pre>
 
+
{{VOTE}}
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
 
<GVSystems name="SYSTEMS" type="module">
 
    <Systems>
 
        <System id-system="system-name" system-activation="on">
 
            <Channel id-channel="CHANNEL_NAME">
 
                <excelreader-call class="it.greenvulcano.gvesb.virtual.excel.reader.GVExcelReaderCallOperation"
 
                                  name="ReadExcelInput" type="call" onlyData="true"/>
 
            </Channel>   
 
        </System>
 
    </Systems>
 
</GVSystems>
 
</syntaxhighlight>
 
 
 
 
 
To use an ''excelreader-call'' in a {{GVESB}} service, you need to define a node of type [[GVOperationNode]] in [[Service section]] and define in the field ''operation-name'' the name defined in ''excelreader-call'' operation.
 
 
 
The following example shows the configuration generated from {{L_VULCON}} or {{L_GVCONSOLE}} when you configure an ''excelreader-call'' operation in {{GVESB}} service:
 
 
 
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
 
<GVServices name="SERVICES" type="module">
 
    <Groups>
 
        <Group group-activation="on" id-group="DEFAULT_GRP"/>
 
    </Groups>
 
    <Services>
 
        <Service group-name="DEFAULT_GRP" id-service="SERVICE-NAME"
 
                service-activation="on">
 
            <Client id-system="SYSTEM-NAME" statistics="off" system-activation="on">
 
                <Operation name="RequestReply" operation-activation="on"
 
                          out-check-type="none" type="operation">
 
                    <Participant id-channel="CHANNEL-NAME" id-system="SYSTEM-NAME"/>
 
                    <Flow first-node="excel_reader" point-x="20" point-y="112">
 
                        <GVOperationNode class="it.greenvulcano.gvesb.core.flow.GVOperationNode"
 
                                        id="excel_reader" id-system="DAMA"
 
                                        input="input" next-node-id="end"
 
                                        op-type="call"
 
                                        operation-name="ReadExcelInput"
 
                                        output="excel_xml" point-x="158"
 
                                        point-y="112" type="flow-node"/>
 
                        <GVEndNode class="it.greenvulcano.gvesb.core.flow.GVEndNode"
 
                                  end-business-process="yes" id="end" op-type="end"
 
                                  output="excel_xml" point-x="358" point-y="112"
 
                                  type="flow-node"/>
 
                    </Flow>
 
                </Operation>
 
            </Client>   
 
        </Service>
 
    </Services>
 
</GVServices>
 
</syntaxhighlight>
 
 
 
 
 
At this point you have configured a service with an ''excelreader-call'' operation.
 
 
 
 
 
==Example==
 
This example shows an XML document generated by a simple Excel sheet (without cols and rows grouping).
 
Given an Excel sheet with the following structure:
 
{| class="gvtable"
 
|-
 
! ID1
 
! ID2
 
! ID3
 
! ID4
 
! ID5
 
! ID6
 
! ID7
 
|-
 
| 23
 
| 23232
 
| 23
 
| 23333
 
| 1
 
| 2
 
| 3
 
|-
 
| 24
 
| 24444
 
| 23
 
| 23332
 
| 1
 
| 2
 
| 3
 
|}
 
''excelreader-call'' generates the following XML:
 
 
 
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
 
<workbook>
 
    <sheet number="0">
 
        <name><![CDATA[Foglio1]]></name>
 
        <row number="0">
 
            <col number="0">
 
                <data><![CDATA[ID1]]></data>
 
            </col>
 
            <col number="1">
 
                <data><![CDATA[ID2]]></data>
 
            </col>
 
            <col number="2">
 
                <data><![CDATA[ID3]]></data>
 
            </col>
 
            <col number="3">
 
                <data><![CDATA[ID4]]></data>
 
            </col>
 
            <col number="4">
 
                <data><![CDATA[ID5]]></data>
 
            </col>
 
            <col number="5">
 
                <data><![CDATA[ID6]]></data>
 
            </col>
 
            <col number="6">
 
                <data><![CDATA[ID7]]></data>
 
            </col>
 
        </row>
 
        <row number="1">
 
            <col number="0">
 
                <data><![CDATA[23]]></data>
 
            </col>
 
            <col number="1">
 
                <data><![CDATA[23232]]></data>
 
            </col>
 
            <col number="2">
 
                <data><![CDATA[23]]></data>
 
            </col>
 
            <col number="3">
 
                <data><![CDATA[711]]></data>
 
            </col>
 
            <col number="4">
 
                <data><![CDATA[1]]></data>
 
            </col>
 
            <col number="5">
 
                <data><![CDATA[1]]></data>
 
            </col>
 
            <col number="6">
 
                <data><![CDATA[1]]></data>
 
            </col>
 
        </row>
 
        <row number="2">
 
            <col number="0">
 
                <data><![CDATA[23]]></data>
 
            </col>
 
            <col number="1">
 
                <data><![CDATA[711]]></data>
 
            </col>
 
            <col number="2">
 
                <data><![CDATA[23]]></data>
 
            </col>
 
            <col number="3">
 
                <data><![CDATA[23232]]></data>
 
            </col>
 
            <col number="4">
 
                <data><![CDATA[1]]></data>
 
            </col>
 
            <col number="5">
 
                <data><![CDATA[1]]></data>
 
            </col>
 
            <col number="6">
 
                <data><![CDATA[1]]></data>
 
            </col>
 
        </row>
 
    </sheet>
 
</workbook>
 
</syntaxhighlight>
 
 
 
With a [[ChangeGvBufferNode]] is possible parsing XML and retrieve any tag and value.
 
 
 
--[[User:A.sicignano|A.sicignano]] 16:30, 19 January 2012 (CET)
 

Latest revision as of 08:25, 29 April 2013

Definition

Web Service is a method of communication between different machines. Using a Web Service it is possible to publish business services using a contract, called WSDL.

GreenVulcano® ESB provides a very simple method that helps developers to manage Web Services operations as:

  • create
  • invoke
  • deploy
  • publishing
  • undeploy

Any service flow can be published in GreenVulcano® ESB as a Web Service. VulCon® helps the user to create or invoke a Web Service, leaving the user the only task to define the data structures in order to interact with the external world.

GreenVulcano® ESB provides a complete management of Web Services through Axis2 platform. It supports:

  • Stateful and asynchronous Web Services
  • Processing SOAP Messages with XML parsing, using the more efficient AXIOM pull-parser instead of DOM (Document Object Model)
  • Increased Scalability
  • Hot deploy and undeploy

Create new Web Services with VulCon

VulCon provides two wizards for creating new Web Services. The first one starts from a GreenVulcano® ESB service and creates the WSDL and the AAR to deploy (bottom-up development method), while the second one starts from a WSDL and creates GreenVulcano® ESB services for each chosen operation (top-down development method). If you need to invoke a Web Service operation, instead, you can choose Wizard Call Web Service or, if you want to simply redirect a Web Service call to a different endpoint, you can choose Wizard Proxy Web Service. The wizard can be activated opening the context menu on the Core view tree's Service element.

You can publish any GreenVulcano® ESB core service using a generic Web Service interface. By means of this feature, you can invoke directly the following core service operations, depending on the how the GreenVulcano® ESB core service has been designed:

  • requestReply
  • request
  • getReply
  • getRequest
  • sendReply
  • execute
You can get the generic WSDL at location:
http://<host>:<port>/gvaxis2/services/GreenVulcanoWebservice?wsdl

In order to invoke the service, you have to set all required parameters. This can be done also using the Wizard Enable GreenVulcano Web Service.

GV Console Web service section

The Web Service section in GV Console contains five main pages:

  1. General parameter: shows the general configuration of business web services and the UDDI Registry's configuration,
  2. WSDL Section: allows to generate or delete WSDL files, and to deploy the Web Service
  3. UDDI Section: allows to publish Web Service in UDDI registry, if the UDDI registry has been configured.
  4. BPEL Deployed Processes
  5. BPEL Currently Available Instances

If you are familiar with Axis2 console it's possible to look up the following link:

http://ipaddredss:portnumber/gvaxis2

{{#w4grb_rate:}} <w4grb_ratinglist latestvotes items="5" nosort/>