improving soap message serialization

Post on 20-Jan-2015

1.611 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

Supervisor : Dr. Sanjiva Weerawarana

Presented by : Prabath Siriwardena

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.

SOAP message template generation for a given WSDL

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

SOAP message template generation

Modified XSL files

WSDLWSDL WSDL2JAVAWSDL2JAVA

SOAP MessageTemplate

SOAP MessageTemplate

SOAP MessageTemplate

SOAP MessageTemplate

SOAP MessageTemplate

SOAP MessageTemplate

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>

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;

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

Caching & Templating

Template RepositoryTemplate Repository

SOAP EnvelopeSOAP Envelope

SOAP HeaderSOAP

Header

.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

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

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

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.

Implementation of SOAP message template generation : 5%

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

Thank You…!

top related