25
1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science and Technology

1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

1

UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES

ICCSA 200429 June 200 4Takashi KOSHIDA

Matsue National College of TechnologyNara Institute of Science and Technology

Page 2: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

2

Content

1.  Introduction• Some background/Problems

2 .   System features• About WSIF/Output data type• Features of our system

3. System structure and Processing• Implementation

4.   Experimental Results• Conventional system/Our system

5. Conclusion

Page 3: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

3

1. Introduction The B2B system is now widely used.

But it is limited to regular transactions. However, SOAP,UDDI and WSDL have

enabled world-wide dynamic business transactions. But, we think, too limited.

Because, there are three problems.

It is difficult:1. to discover the Web service that we

want to use 、 2. to know how to use it 、3. and to make a client program for

executing a Web service.

Page 4: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

4

So, in this paper, we focused on the 3rd problem.

3. and to make a client program for executing a Web service.

And to solve it, we used WSIF.・ In Web service, there are two kinds of output

data(primitive and user-defined type).

・ Now we have realized an automated and unified dynamic invocation system for Web services with any output data.

Page 5: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

5

Web service is the distributed processing technology on the Web.

XML is used for data exchange.

The make up of the Web service

Service Requester

Service Provider

SOAP

SOAP

SOAP

retrieval registration/publish

execution

UDDI WSDL

Page 6: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

6

2. SYSTEM FEATURES About WSIF (Web Services Invocation Framework)

It makes stub-less dynamic invocation possible.

It requires WSDL description of Web service. But,for execution, it is necessary to specify

correctly the WSDL URL, Web service name, method name, input-and-output parameter names and types.

These are complex procedures. More easily and automatically! But, there are two kinds of output data.

Page 7: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

7

About the types of output data

Two kinds of output data in Web Service: Primitive data:

• string, float or int etc. User-defined data:

• This type is composed of some primitive data types.

• For example, employee data ( ID, name, age, position, address,….)

• It requires JavaBeans to represent a user-defined data type.

• So,we must generate the JavaBeans code dynamically.

Page 8: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

8

<definitions name="TemperatureService" targetNamespace="http://www.xmethods.net/sd/TemperatureService.wsdl" xmlns:tns="http://www.xmethods.net/sd/TemperatureService.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns="http://schemas.xmlsoap.org/wsdl/"> <message name="getTempRequest"> <part name="zipcode" type="xsd:string"/> </message> <message name="getTempResponse"> <part name="return" type="xsd:float"/> </message> <portType name="TemperaturePortType"> <operation name="getTemp"> <input message="tns:getTempRequest"/> <output message="tns:getTempResponse"/> </operation> </portType>

Primitive data in WSDL description

Output parameter name/type

Input parameter name/type

Page 9: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

9

<wsdl:types> <schema targetNamespace="http://10.70.51.20:8080/axis/services" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="GData"> <sequence> <element name="code" nillable="true" type="xsd:string"/>   <element name="maker" nillable="true" type="xsd:string"/> </sequence> </complexType> <element name="GData" nillable="true" type="tns1:GData"/> </schema> </wsdl:types> <wsdl:message name="getTempMakerRequest"> <wsdl:part name="in0" type="xsd:string"/> </wsdl:message> <wsdl:message name="getTempMakerResponse"> <wsdl:part name="getTempMakerReturn" type="tns1:GData"/> </wsdl:message>

User-defined data in WSDL description

User-defined data type

input parameter name / type

output parameter name / type

“GData” type is made up of the two variables, “code”

and “maker”. Both of these are string-type variables.

Page 10: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

10

<types><s:schema elementFormDefault="qualified" targetNamespace="http://ws.cdyne.com"> <s:element name="GetLatLong"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="zipcode" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="LicenseKey" type="s:string"/> </s:sequence> </s:complexType> </s:element> <s:element name="GetLatLongResponse"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="GetLatLongResult" type="s0:LatLongReturn"/> </s:sequence> </s:complexType> </s:element> <s:complexType name="LatLongReturn"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="ServiceError" type="s:boolean" /> <s:element minOccurs="1" maxOccurs="1" name="AddressError" type="s:boolean"/> <s:element minOccurs="0" maxOccurs="1" name="City" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="StateAbbrev" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="County" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="FromLongitude" type="s:decimal"/> <s:element minOccurs="1" maxOccurs="1" name="FromLatitude" type="s:decimal" /> <s:element minOccurs="1" maxOccurs="1" name="ToLongitude" type="s:decimal" /> <s:element minOccurs="1" maxOccurs="1" name="ToLatitude" type="s:decimal" /> <s:element minOccurs="1" maxOccurs="1" name="AvgLongitude" type="s:decimal" /> <s:element minOccurs="1" maxOccurs="1" name="AvgLatitude" type="s:decimal" /> <s:element minOccurs="0" maxOccurs="1" name="CMSA" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="PMSA" type="s:string" /> </s:sequence> </s:complexType> <s:element name="LatLongReturn" type="s0:LatLongReturn" /> </s:schema> </types>

User-defined data in WSDL description (Zip2Geo)

In this case, “LatLongReturn” type is made up of 14 variables. 14 primitive data types

Page 11: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

11

The features of our system

Automated parameter setting and dynamic invocation

1. First, the system discovers and retrieves the WSDL URL from the UDDI registry.

2. Downloads and analyzes the WSDL file.3. Checks the output data type and processing for

user-defined data.4. Then, extracts and sets up the Web service name,

method name and input-and-output parameter names and types.

5. Finally,executes a Web service.

Unified processing This new system is applicable to both primitive type

data and user-defined type data.

Page 12: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

12

To deal dynamically with user-defined data. We used WSDL2Java/Runtime library to generate

dynamically JavaBeans codes. We utilized the Class/Method library to extract and

execute the getter method dynamically.

Page 13: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

13

The system consists of three stages (Step1, Step2 and Step3). Step1: (Fig.3)

• “UDDI registry reference and WSDL URL extraction”

Step2: (Fig.4)• “WSDL file analysis and WSIF parameter

extraction” Step3: (Fig.5)

• “Web service execution and output data extraction”

3.SYSTEM STRUCTURE AND PROCESSING

Page 14: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

14

Workflow of Step1

extracts

retrieves

UDDIRegistry

downloads

WSDL data

URL ofWSDL file

Extracted data

Execution

Web serviceServer

Step 1

Fig.3

UDDI Registry(“I,M,IT”),tModel name, tModelKey andInput parameter values

Step 2

Page 15: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

15

Workflow of Step 2,3

Fig.4

Extracted data

Execution

analyze and extract

compile

WSDL2Java

Java code for user-defined data (.java)

Class file for user-defined data (.class)

javac

Name and return type of the getter

methods

Step 2 Output data type decision

analyze and extract

Primitive data type

setting up

Web Service name, method name,

Namespace

Input parameter name and type

Output parameter name and type

<types>,<message><portType> data

User-defined data type

Step 3

Step 3

WSIF API

Web Service Execution

getter method invocation using Method object

Output results

Fig.5

In Step 2, first the output data type is discriminated. When it is user-defined data,the JavaBeans code corresponding to this data is automatically generated using “WSDL2Java” and it is compiled using a “Runtime.getRuntime().exec()”. The execution results are transmitted to a client as an object of this user-defined data. To acquire an output value, we have to apply a getter method dynamically to the object. To extract the getter method, we devised new means of correctly extracting those names and return types using “Class”, “Method” and “Object” API in a Java reflect. Moreover, in this step, the common data that does not depend on an output data type are extracted.

Parameters required for the dynamic invocation extracted in Step 2 are set to the WSIF API and then Web service is executed dynamically, and an output result is obtained. For user-defined output data, complicated and dynamic processing is needed furthermore. We devised newly the means using “Class”, “Method”, “Object” API and the getter method.

Page 16: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

16

A part of WSDL description …………………………………………….. <message name="getRateRequest"> <part name="country1" type="xsd:string"/> <part name="country2" type="xsd:string"/> </message> <message name="getRateResponse"> <part name="Result" type="xsd:float"/> </message> <portType name="CurrencyExchangePortType"> <operation name="getRate"> <input message="tns:getRateRequest" />

<output message="tns:getRateResponse" /> </operation> </portType> …………………………………………

Input parameter name/type

Output parameter name/type

Web service name

Method name

Same name

The system compares the name of these portions and distinguishes the parameter name of an input and an output.

Page 17: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

17

4. EXPERIMENTAL RESULTS We used the IBM and Microsoft UDDI registry for testing.

tModelkey

tModel name

Zip2Geo

Page 18: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

18

D:\WSIF\wsif-src-2.0\wsif-2.0\build\samples>java clients.DynamicInvoker http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl getQuote IBM

Reading WSDL document from

'http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl'Executing operation getQuoteResult:Result=91.01Done!

WSDL URL

Method name

Input parameter name

Result of conventional system 1

The conventional system is DynamicInvoker and in Fig.6, the output data type is a primitive type(float). Here, it is necessary to specify WSDL URL of Web service, and a Web service method name as input parameters. Therefore, a user needs to know the WSDL URL, and the method name of Web service beforehand.

Fig.6Primitive type

Page 19: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

19

Result of conventional system 2

D:\WSIF\wsif-src-2.0\wsif-2.0\build\samples>java complexsoap.client.dynamic.Run complexsoap/Zip2Geo.wsdl 10005

This zip code is in NEW YORK, NY in NEW YORK county It extends from longitude -74.011926 to longitude -74.011926 and from latitude 40.703235 to latitude 40.710265

In Fig.7, the output data type is user-defined and this Web service returns the geographic information of the city corresponding to the zip code. All the parameters that are required for execution were previously specified manually in this system. And the JavaBeans code for user-defined data and WSDL file are attached to this WSIF package.

WSDL URL

Input parameter (zip code)

Fig.7User-defined type

Page 20: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

20

D:\WSIF\wsif-src-2.0\wsif-2.0\build\samples>java UniDyRun6 IT StockQuote UUID:F24269F0-3426-11D8-B936-000629DC0A53 IBM

tModelName:StockQuote  tModeleKey:UUID:62B655E0-A2C6-11D7-9CD6-000629DC0A53  http://www.cise.ufl.edu/~lnarasim/Quote.wsdl

tModelName:StockQuote  tModeleKey:UUID:F24269F0-3426-11D8-B936-000629DC0A53

    http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdlReturn = 93.14

Input parameter name

tModel name

tModelKey

Results of our system (1)

This Web service is the same as Fig.6. Here, “IT” means an IBM UDDI test registry for specifying UDDI registry. Since two or more Web services with the same tModel name “StockQuote” are registered, Web service is specified and accessed using the specified tModelKey value.

Fig.8Primitive type

Page 21: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

21

D:\WSIF\wsif-src-2.0\wsif-2.0\build\samples>java UniDyRun6 IT CurrencyExchangeRate UUID:E39408B0-342A-11D8-B936-000629DC0A53 JAPAN USA

tModelName: CurrencyExchangeRate  tModeleKey: UUID:E39408B0-342A-11D8-B936-000629DC0A53     http://services.xmethods.net/sd/2001/CurrencyExchangeService.wsdlReturn = 107.58

Input parameter names

tModel name

Results of our system (2)

Primitive type

tModelKey

Another example of primitive data type, “CurrencyExchangeRate” Web service.

Page 22: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

22

D:\WSIF\wsif-src-2.0\wsif-2.0\build\samples>java UniDyRun6 I Zip2Geo UUID:E625DB10-56F0-11D8-B766-000629DC0A53 “” 10005

http://ws.cdyne.com/ziptogeo/zip2geo.asmx? WSDL getCity = NEW YORK getStateAbbrev = NY getZipCode = 10005getCounty = NEW YORKgetFromLongitude = -74.011925getFromLatitude = 40.703236getToLongitude = -74.011925getToLatitude = 40.710266getAvgLongitude = -74.00837getAvgLatitude = 40.70675 getCMSA = 5602 getPMSA = 5600

Input parameterstModel name

tModelKey

Results of our system (3) Fig.9User-defined type

Our system (“UniDyRun6”) automatically discovers the Web service’s WSDL file from the IBM UDDI registry and analyzes it. Then it sets up the parameters that are required for the dynamic invocation and invokes dynamically the getter method using “Method” object to get the output result.

Page 23: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

23

Results of our system (4)

D:\WSIF\wsif-src-2.0\wsif-2.0\build\samples>java UniDyRun6 M GoodsService2 UUID: 0b470276-3fc6-40b2-a243-e68ed4e11f9e 3537

http://10.70.51.20:8080/axis/services/GoodsService2?wsdlgetCode = 3537getMaker = LION CO,LTD.

Input parametertModel name

tModelKey

User-defined type

Another example of user-defined data type, “GoodsService2” returns the maker name for code.

Page 24: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

24

We developed a unified and automated dynamic invocation system for Web services with any output data type. Features

•Retrieval of WSDL URL from the UDDI registry

•Automated parameter extraction from the WSDL description and setting up (independent of output data type)

•Stub-less execution using WSIF

5. CONCLUSION

Page 25: 1 UNIFIED DYNAMIC INVOCATION SYSTEM FOR WEB SERVICES ICCSA 2004 29 June 200 4 Takashi KOSHIDA Matsue National College of Technology Nara Institute of Science

25

The UDDI registry is the core of Web service technology.

But in practice, it is difficult to quickly discover necessary Web services from the UDDI registry.

We have to make it easily for the registry to find those Web services that users need.

Important !