Improving Soap Message Serialization

16
Supervisor : Dr. Sanjiva Weerawarana Presented by : Prabath Siriwardena

description

 

Transcript of Improving Soap Message Serialization

Page 1: Improving Soap Message Serialization

Supervisor : Dr. Sanjiva Weerawarana

Presented by : Prabath Siriwardena

Page 2: Improving Soap Message Serialization

Web service calls are considerably slow compared to JAVA RMI and .NET Remoting

SOAP is based on XML and XML encoding contributes in a large amount for the slowness of web service API calls.

SOAP requires it’s wire format to be in text and there is a cost of conversion from binary form to text before being transmitted.

Page 3: Improving Soap Message Serialization

SOAP message template generation for a given WSDL

Templating & Caching SOAP message requests to overcome performance bottlenecks due to serialization.

Page 4: Improving Soap Message Serialization
Page 5: Improving Soap Message Serialization

SOAP message template generation

Modified XSL files

WSDLWSDL WSDL2JAVAWSDL2JAVA

SOAP MessageTemplate

SOAP MessageTemplate

SOAP MessageTemplate

SOAP MessageTemplate

SOAP MessageTemplate

SOAP MessageTemplate

Page 6: Improving Soap Message Serialization

SOAP message template generation [contd..]

<s:element name="TestWithComplexType5"> <s:complexType> <s:sequence>  <s:element minOccurs="0" maxOccurs="1" name="address" type="tns:Address" />   </s:sequence>  </s:complexType>  </s:element>

<s:complexType name="Address"> <s:sequence>  <s:element minOccurs="0" maxOccurs="1" name="Address1" type="s:string" />   <s:element minOccurs="0" maxOccurs="1" name="Address2" type="s:string" />   <s:element minOccurs="0" maxOccurs="1" name="City" type="s:string" />   <s:element minOccurs="0" maxOccurs="1" name="State" type="s:string" />   <s:element minOccurs="0" maxOccurs="1" name="Country" type="s:string" />   <s:element minOccurs="0" maxOccurs="1" name="PostalCode" type="s:string" />   </s:sequence>  </s:complexType>

Page 7: Improving Soap Message Serialization

SOAP message template generation [contd..]

String[] template = new String[11]; template[0]= "<TestWithComplexType5 xmlns=\"http://axis2.benchmarking/\">

<address><Address1>"; template[2]="</Address1><Address2>"; template[4]="</Address2><City>"; template[6]="</City><State>"; template[8]="</State><PostalCode>"; template[10]="</PostalCode></address></TestWithComplexType5>";

public static final int ADDRESS_1 = 1; public static final int ADDRESS_2 = 3; public static final int CITY = 5; public static final int STATE = 7; public static final int POSTAL_CODE = 9;

Page 8: Improving Soap Message Serialization

Caching & Templating

Envelope CacheEnvelope CacheSearch(‘Axis’)Search(‘Axis’)

Template RepositoryTemplate Repository

Not in CacheNot in Cache

SOAP EnvelopeBuilder

SOAP EnvelopeBuilderAdd to CacheAdd to Cache

SOAP Envelope SOAP Envelope

1

2

3

4

5

SOAP TemplateBuilder

SOAP TemplateBuilder

SOAP EnvelopeSOAP Envelope

Page 9: Improving Soap Message Serialization

Caching & Templating

Template RepositoryTemplate Repository

SOAP EnvelopeSOAP Envelope

SOAP HeaderSOAP

Header

Page 10: Improving Soap Message Serialization

.NET Web Service

.NET Web Service

AXIS2 EngineAXIS2 Engine

Client One : Templating + Caching

Client One : Templating + Caching

Client Three :

Templating Only

Client Three :

Templating Only

Client Two : Default Client

Client Two : Default Client

useTemplating=true

useTemplating=false

useTemplating=true

Modified Stubs

Modified Stubs

Default Stubs

Default Stubs

Modified Stubs

Modified Stubs

Page 11: Improving Soap Message Serialization

Performance gain due to templating & caching increases as the object complexity increases.

Page 12: Improving Soap Message Serialization

Templating contributes in a larger percentage to the performance gain than the caching as the object complexity increases

Page 13: Improving Soap Message Serialization

Differential Serialization & Differential De-serialization

Client Side Caching SOAP message compression : CPU time spent

on compression and decompression outweighs the benefits.

Compact the XML tags and to reduce the length of XML tags.

Page 14: Improving Soap Message Serialization

Implementation of SOAP message template generation : 5%

Page 15: Improving Soap Message Serialization

SOAP Spec 1.2 The Axis2 Transport Framework

   http://www.developer.com/services/article.php/3606466 Writing an Axis2 Service from Scratch

   http://www.developer.com/java/ent/article.php/10933_3613896_1 Introducing Axiom

   http://www.theserverside.com/tt/articles/article.tss?l=Axiom AXIOM - Fast and Lightweight Object Model for XML

   http://wso2.org/library/291 JSR 173 - Streaming API for XML J2EE Web Services' - RMH Java Web Service Architecture - James McGovern Differential Serialization for Optimized SOAP Performance - Nayef

Abu-Ghazaleh, Michael J. Lewis, Madhusudhan Govindaraju SOAP Optimization via Client-side Caching - Kiran Devaram and

Daniel Andresen

Page 16: Improving Soap Message Serialization

Thank You…!