17 th October 2004 WSDL www euegee org
17 th October 2004 WSDL www. eu-egee. org Which WSDL Style ? EGEE is a project funded by the European Union under contract IST-2003 -508833
Types of WSDL SOAP binding • RPC/encoded • RPC/literal • Document/encoded • Document/literal WSDL, 17 th October 2004 - 2
Java method example public void my. Method (int x); WSDL, 17 th October 2004 - 3
RPC/Encoded WSDL <message name=“my. Method. Request”> <part name=“x” type=“xsd: int”/> </message> <message name=“empty”/> <port. Type name=“PT”> <operation name=“my. Method”> <input message=“my. Method. Request”/> <output message=“empty”/> </operation> </port. Type> Binding is RPC/encoded WSDL, 17 th October 2004 - 4
SOAP message <soap: envelope> <soap: body> <my. Method> <x xsi: type=“xsd: int”>value</x> </my. Method> </soap: body> </soap: envelope> WSDL, 17 th October 2004 - 5
Advantages/disadvantages • Advantages § Simple WSDL § Operation name appears in the message • Disadvantages § Type encoding information overhead § SOAP message cannot be validated except against WSDL, 17 th October 2004 - 6
RPC/Literal WSDL <message name=“my. Method. Request”> <part name=“x” type=“xsd: int”/> </message> <message name=“empty”/> <port. Type name=“PT”> <operation name=“my. Method”> <input message=“my. Method. Request”/> <output message=“empty”/> </operation> </port. Type> Binding is RPC/literal WSDL, 17 th October 2004 - 7
SOAP message <soap: envelope> <soap: body> <my. Method> <x>value</x> </my. Method> </soap: body> </soap: envelope> WSDL, 17 th October 2004 - 8
Advantages/Disadvantages • Advantages § WSDL is simple § Operation name appears in the message § Type encoding information is minimal • Disadvantages § Nearly all the definitions in WSDL so not independently validatable WSDL, 17 th October 2004 - 9
Document/encoded • Not implemented ! WSDL, 17 th October 2004 - 10
Document/literal WSDL <types> <schema> <element name=“x. Element” type=“xsd: int”/> </schema> </types> <message name=“my. Method. Request”> <part name=“x” element=“x. Element”/> </message> <message name=“empty”/> <port. Type name=“PT”> <operation name=“my. Method”> <input message=“my. Method. Request”/> <output message=“empty”/> </operation> </port. Type> WSDL, 17 th October 2004 - 11
SOAP message <soap: envelope> <soap: body> <x. Element>value</x. Element> </soap: body> </soap: envelope> WSDL, 17 th October 2004 - 12
Advantages/Disadvantages • Advantages § No type encoding information § The body of the soap message is all defined in a schema and so can be validated independently • Disadvantages § WSDL is more complicated § Operation name is lost WSDL, 17 th October 2004 - 13
Document/wrapped WSDL <types> <schema> <element name=“my. Method”/> <complex. Type> <sequence> <element name=“x” type=“xsd: int”/> </sequence> </complex. Type> </element> </schema> <types> <message name=“my. Method. Request”> <part name=“parameters” element=“my. Method”/> </message> <message name=“empty”/> <port. Type name=“PT”> <operation name=“my. Method”> <input message=“my. Method. Request”/> <output message=“empty”/> </operation> </port. Type> WSDL schema has a wrapper around the parameters WSDL, 17 th October 2004 - 14
SOAP message <soap: envelope> <soap: body> <my. Method> <x>value<x> </my. Method> </soap: body> </soap: envelope> WSDL, 17 th October 2004 - 15
Characteristics • • Input message has a single part Part is an element Element has the same name as the operation Element’s complex type has no attributes WSDL, 17 th October 2004 - 16
Advantages/disadvantages • Advantages § No type encoding information § Soap body is defined in a schema – validation § Method name in the soap message • Disadvantages § WSDL is complicated • Generally this is the best style to use. WSDL, 17 th October 2004 - 17
When not to use document/wrapped • Document literal wrapped style does not allow for overloading • Cannot have two elements with the same name in XML (element has to have same name as operation) • In this case you may wish to use RPC/literal so that the operation name is available. WSDL, 17 th October 2004 - 18
- Slides: 18