ieee ccgrid may 22, 20021 the gsoap toolkit robert van engelen kyle gallivan florida state...
TRANSCRIPT
IEEE CCGrid May 22, 2002 1
The gSOAP ToolkitRobert van Engelen
Kyle Gallivan
Florida State University
IEEE CCGrid May 22, 2002 2
Overview
Web Services gSOAP design and implementation Results Conclusions
IEEE CCGrid May 22, 2002 3
Web Services:the Big Picture
SOAP RPC
SOAPDSIGWSDLUDDI
IEEE CCGrid May 22, 2002 4
SOAP
Light-weight protocol based on XML as the marshalling format for data in request and response messages Vendor- and platform-neutral Language-neutral Object-model-neutral Transport-neutral
XML allows data transformation (XSLT) XML enables long-term data persistence
IEEE CCGrid May 22, 2002 5
WSDL
Web Service registers with UDDI
Web Service publishes WSDL
Clients can develop proxies from the WSDL for SOAP RPC and messaging
IEEE CCGrid May 22, 2002 6
gSOAP
Open source (C, C++, and Java) >2000 registered users Uses a source-to-source stub and
skeleton compiler to automate the integration of SOAP RPC in applications Automates the deployment of (legacy)
C/C++ applications as Web Services Automates the development of clients
Suitable for high-performance computing
IEEE CCGrid May 22, 2002 7
gSOAP Goals
Application-centric Minimize application code adaptation Support (de)marshalling of application’s
native data structures in SOAP/XML Preserve the logical structure of data
Minimize data migration overhead and formatting errors Avoid (hand-written) wrappers Generate fast (de)marshalling routines
and streaming XML parsers Efficient run-time remote object allocation
IEEE CCGrid May 22, 2002 8
The gSOAP Stub and Skeleton Compiler Generates source code stubs and
skeletons for SOAP RPC Generates XML (de)marshalling
routines for native and user-defined C/C++ data types
The gSOAP runtime provides low-level HTTP, TCP, SOAP/XML handling and memory management capabilities
HTTP/TCP/SOAPand XML API
Stub/Skeleton andMarshalling Code
User application
Runtime Library
gSOAP-generated
IEEE CCGrid May 22, 2002 9
Development
ServiceApplication
gSOAP-generatedSkeleton Routines
gSOAP-generatedRequest Dispatcher
Specification ofData Types and
Remote Proceduresin C/C++ Header File
gSOAPCompiler
Server
WSDL IDL
IEEE CCGrid May 22, 2002 10
Development
Specification ofData Types and
Remote Proceduresin C/C++ Header File
gSOAP-generatedStub Routines
Client Application
Client
WSDL IDL
gSOAP
IEEE CCGrid May 22, 2002 11
Example
Service description (WSDL):Namespace: urn:xmethods-delayed-quotes Method name: getQuoteInput parameter: symbol of type xsd:stringOutput parameter: result of type xsd:float
Generated remote procedure declaration for stub generation with gSOAP:ns__getQuote(char *symbol, float &result);
Client code:main(){ float q; if (soap_call_ns__getQuote(“URL”, “”, “AOL”, q) == 0) cout << “AOL: “ << q << endl;}
IEEE CCGrid May 22, 2002 12
Encoding C/C++ Data Types in XML Primitive C/C++ types, enum,
struct/class with single inheritance, pointers, arrays, special types (e.g. base64)
Not supported: unions, void*, templates, multiple inheritance
IEEE CCGrid May 22, 2002 13
Serialization
gSOAP generates serialization routines for application types
Serialization code traverses object graph at run time to detect co-referenced objects and cycles
Serialization code outputs object graph in XML according to SOAP encoding rules
IEEE CCGrid May 22, 2002 14
Serialization Examplestruct BG{ int val; struct BG *left; struct BG *right;}; <BG>
<val>1</val> <left> <val>2</val> <right href=“#X”/> </left> <right href=“#X”/></BG><id id=“X”> <val>3</val> <right href=“#X”/></id>
1
2
3
IEEE CCGrid May 22, 2002 15
Deserialization
gSOAP generates deserialization code, including schema-driven XML pull parser Auto-validating Streaming Fast: match inbound XML elements to
“expected” elements in the schema Keep table with “forward” XML refs
Back-patching method: resolve forward refs later by copying pointers and/or referenced data
IEEE CCGrid May 22, 2002 16
Deserialization Example
1
2
3
<BG> <val>1</val> <left> <val>2</val>
</left> <right href=“#X”/></BG><id id=“X”> <val>3</val> <right href=“#X”/></id>
<right href=“#X”/>
IEEE CCGrid May 22, 2002 17
Results
1. Interoperability testing
2. Legacy code integration
3. Scalability and performance
IEEE CCGrid May 22, 2002 18
Interoperability Testing
WhiteMesa.org “interop lab”
Suite of test cases designed for real-time interoperability testing over the Web
Apache Axis, .NET, Delphi,…
String Integer Float Struct String Array
Integer Array
Float Array
Struct Array
Void Base64 Date Hex Binary
Decimal Boolean Map Map Array
gSOAP PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS
SOAP::Lite PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS FAULT
Apache 2.2 PASS PASS PASS PASS FAULT PASS FAULT FAULT PASS PASS PASS PASS PASS PASS PASS PASS
Apache Axis PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS FAIL FAULT PASS PASS PASS PASS
ASP .NET PASS PASS PASS PASS FAIL PASS PASS FAIL PASS PASS PASS FAULT PASS PASS N/A N/A
Cape Connect
PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS N/A N/A
Delphi PASS PASS PASS PASS FAIL PASS PASS FAULT PASS PASS PASS PASS PASS PASS N/A N/A
easySOAP++ PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS N/A N/A
eSOAP PASS PASS PASS PASS FAIL PASS PASS FAIL PASS PASS PASS PASS PASS PASS N/A N/A
Frontier PASS PASS PASS PASS FAULT FAULT FAULT FAULT PASS PASS FAIL FAULT FAULT FAULT N/A N/A
GLUE PASS PASS PASS PASS FAIL PASS PASS FAIL PASS PASS FAIL PASS PASS PASS N/A N/A
MS SOAP 3.0
PASS PASS PASS PASS FAULT PASS FAULT FAULT PASS PASS FAIL PASS PASS PASS N/A N/A
nuSOAP PASS PASS PASS PASS FAIL PASS PASS FAIL PASS PASS PASS PASS PASS PASS FAULT FAULT
OpenLink Virtuoso
PASS PASS PASS PASS FAIL PASS PASS FAIL PASS PASS PASS PASS PASS PASS N/A N/A
PEAR SOAP PASS PASS PASS PASS FAIL PASS PASS FAIL PASS PASS FAULT PASS FAIL PASS FAULT FAULT
SOAP4R PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS
Spheon jSOAP
PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS
Spray PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS N/A N/A
SQLData PASS PASS PASS PASS PASS PASS FAULT FAULT PASS PASS PASS PASS PASS PASS N/A N/A
WASP Adv. PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS N/A N/A
White Mesa PASS PASS PASS PASS FAULT PASS FAULT PASS PASS PASS PASS PASS PASS PASS N/A N/A
XMLBus PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS PASS N/A N/A
4S4C 2.0 PASS PASS PASS PASS PASS PASS FAULT PASS PASS PASS FAULT FAULT PASS PASS N/A N/A
IEEE CCGrid May 22, 2002 19
Legacy Code Example:Linear System Solver
Application code from Numerical Recipes in C
Web Service: LU
Decomposition Backsubstitution Solve Multi-solve Matrix inversion
IEEE CCGrid May 22, 2002 20
Linear System SolverOriginal Numerical Recipes in C routine:
ludcmp(double **a, int n, int *indx, double *d){ … sum = a[i][j]; … }
Modified routine (array size n stored in class instances):ludcmp(matrix *a, ivector *indx, double *d){ … sum = a[i][j]; … }
C++ class declarations for the generation of (de)serializers with gSOAP:class vector{ double *__ptr; // pointer to array of double int __size; // run-time array size double& operator[](int i);}; class matrix{ vector *__ptr; // pointer to array of vectors int __size; // run-time array size double& operator[](int i);};
IEEE CCGrid May 22, 2002 21
Linear System Solver
Remote procedure declaration for stub and skeleton generation with gSOAP:ns__ludcmp( matrix *a, // input matrix struct ns__ludcmpResponse { matrix *a; // output matrix ivector *i; // output index reordering vector double d; // output parameter for determinant } *result)
Remote procedure SOAP server interface routine called by skeleton:ns__ludcmp(matrix *a, struct ns__ludcmpResponse &result){ result.a = a; // input to output matrix if (ludcmp(result.a, result.i, &result.d) != 0) return SOAP_FAULT; return SOAP_OK;}
IEEE CCGrid May 22, 2002 22
Linear System Solver
Linear system solver server code (CGI-based):main(){ soap_serve(); // process request (skeletons)}
Example client code:main(){ struct ns__ludcmpResponse result; matrix a; … if (soap_call_ns__ludcmp(“URL”, “”, &a, &result) != 0) soap_print_fault(stderr); …}
IEEE CCGrid May 22, 2002 23
Scalability and Performance Scalability and overhead of
communication vs. computation LU-based matrix inversion
Performance (send 32bit int matrix) Full SOAP XML-encoded matrix SOAP Base64-encoded matrix CGI-based SOAP Web Service Stand-alone SOAP Web Service Java RMI
IEEE CCGrid May 22, 2002 24
Matrix Inversion
Stand-alone linear system solver service (TCP sockets)
Full double fp. matrix representation in SOAP XML
Total time of client request and server response (10BaseT, Dual PIII 550MHz, Red Hat Linux)
IEEE CCGrid May 22, 2002 25
CGI-Based Web Service
Total time of client request and server response (10BaseT, Dual PIII 550MHz, Red Hat Linux)
SOAP XML-encoded 32bit int matrix
SOAP Base64-encoded 32bit int matrix
IEEE CCGrid May 22, 2002 26
Stand-Alone Serviceand Java RMI
Total time of client request and server response (10BaseT, Dual PIII 550MHz, Red Hat Linux)
SOAP XML-encoded 32bit int matrix
SOAP Base64-encoded 32bit int matrix
Java RMI (1.2.2)
IEEE CCGrid May 22, 2002 27
Conclusions
Application centric SOAP/XML Web Service interoperable Legacy numerical code integration Scalability and performance Future work:
IDL DIME Performance enhancements Peer-to-peer networks