Title: How Web Services are introduced in a CLARIN Workflow
1How Web Services are introduced in a CLARIN
Workflow
- WSDL and WADL files for Web Service description.
2What is needed basically?
- In order to include a web service in a general
workflow the following data is needed - Protocol used for communication
- Location of web service
- List of operations offered by this web service
- Description of the data types used in those
operations
3Web Service data files
- WSDL (Web service description Language) is a W3C
standard - version 1.1
- Used to describe SOAP web services. Based on XML.
- (Microsoft and IBM)
- http//www.w3.org/TR/wsdl
- version 2.0
- Used to describe SOAP and REST web services.
Based on XML. - (Sun, Canon, IBM, WSO2)
- http//www.w3.org/TR/wsdl20/
- WADL (Web Application Description Language)
- Used to describe REST web services. Based on XML.
- (Sun Microsystems)
- https//wadl.dev.java.net
4SOAP cannot use WADL
- REST Web Services can pack all description data
in a WADL file or in a WSDL 2.0 file. - WADL and WSDL languages are essentially the same
but WADL is more specific to REST. It is also
easier to use. - WADL is not standard (neither is REST) but since
WADL is easier to use (like REST) probably will
be widely accepted (like REST).
5Summing up
- WSDL or WADL Description files permit to describe
web services - This description is used by client applications
to connect to the web services. - For most generic workflows such description files
are enough, but for CLARIN....
6SOAP Web service example for a CLARIN scenario
- The following web service queries a CQP indexed
corpus. - WSDL file url http//igraine.upf.es9100/cqp/serv
ice.wsdl - Information included in that WSDL file
- It uses SOAP
- It can be accessed at http//igraine.upf.es9100/c
qp/api - It has 3 operations available
- CqpQueryResults GetPendingResults(int ticket_no)
- bool ResultsAvailable(int ticket_no)
- int QueryCqpExpression(string cqp_expression,
string domain) - It uses a custom data type CqpQueryResults which
is also defined in the WSDL file.
7Using the web service Binding process example
with WSDL. Step 1 Get WS Location
ltservice name"CQPService"gt ltport
name"CQPCqpPort" binding"typensCQPCqpBinding"gt
ltsoapaddress location"http//igraine.upf.es9100
/cqp/api"/gt lt/portgt lt/servicegt
8Binding process example with WSDL. Step 2 Get WS
protocol
ltbinding name"CQPCqpBinding" type"typensCQPCqpP
ort"gt ltsoapbinding transport"http//schemas.xmls
oap.org/soap/http" style"rpc"/gt
9Binding process example with WSDL. Step 3 Get
Operations available
- Operations are Contained in the operation tag.
ltoperation name"GetPendingResults"gt ltsoapoperati
on soapAction"/cqp/api/GetPendingResults"/gt ltinpu
tgt ltsoapbody encodingStyle"http//schemas.xmlsoa
p.org/soap/encoding/" namespace"urnActionWebServ
ice" use"encoded"/gt lt/inputgt ltoutputgt ltsoapbody
encodingStyle"http//schemas.xmlsoap.org/soap/enc
oding/" namespace"urnActionWebService"
use"encoded"/gt lt/outputgt lt/operationgt
10Binding process example. Step 4 Get operation
parameters
- Each operation tag is related to the parameters
description (message tag).
ltoperation name"GetPendingResults"gt . ltmessage
name"GetPendingResults"gt ltpart name"ticket_no"
type"xsdint"/gt lt/messagegt ltmessage
name"GetPendingResultsResponse"gt ltpart
name"return" type"typensCqpQueryResults"/gt lt/me
ssagegt
11Binding process example with WSDL. Step 5 Get
custom types definition
- Operation parameters may have custom data types.
Those are described in the ComplexType tag and
can be nested.
ltoperation name"GetPendingResults"gt . ltmessage
name"GetPendingResultsResponse"gt ltpart
name"return" type"typensCqpQueryResults"/gt lt/me
ssagegt ltxsdcomplexType name"CqpQueryResults"gt
ltxsdallgt ltxsdelement name"error_msg"
type"xsdstring"/gt ltxsdelement name"result"
type"typensCqpResultLineArray"/gt ltxsdelement
name"error" type"xsdboolean"/gt lt/xsdallgt lt/xsd
complexTypegt
12CLARIN Workflows
- For general workflows, WSDL or WADL files contain
enough information for including the Web Service
and use it in any workflow. - Workflows in CLARIN can have more requirements
than general workflows that cannot be inside WSDL
or WADL files, for instance ... - Alternative web services / mirrors. Required when
errors occur. - Information about cost of execution.
- WSDL/WADL files use traditional URIs for
referencing resources, while CLARIN will use PIDs
13Extra information for CLARIN Workflows
- Some of this extra information could be contained
in the Registry - Alternative / mirror web services.
- Cost of execution
- Registry should also have a reversal PID
resolution. Get PID using URI. Getting PID using
URIs declared in WSDL/WADL files would be easy.
14Conclusions
- WSDL/WADL files describe web services interface.
- Any software can be a web service client if the
web services WSDL/WADL is available. And it is
sufficient to be included in a workflow without
human interaction. - CLARIN workflows will have some extra information
requirements. With this extra information, user
will be able to include web services to CLARIN
workflows. - Should the required extra information be in the
CLARIN registry?