xml and soap examples l.
Skip this Video
Loading SlideShow in 5 Seconds..
XML and SOAP Examples PowerPoint Presentation
Download Presentation
XML and SOAP Examples

Loading in 2 Seconds...

play fullscreen
1 / 15

XML and SOAP Examples - PowerPoint PPT Presentation

  • Uploaded on

CERN April 1 2003 Grid Tutorial. XML and SOAP Examples. PTLIU Laboratory for Community Grids Geoffrey Fox, Marlon Pierce Computer Science, Informatics, Physics Indiana University, Bloomington IN 47404. gcf@indiana.edu. A Sample of XML. <?xml version="1.0"?>

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'XML and SOAP Examples' - mike_john

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
xml and soap examples

CERN April 1 2003 Grid Tutorial

XML and SOAP Examples

PTLIU Laboratory for Community Grids

Geoffrey Fox, Marlon Pierce

Computer Science, Informatics, Physics

Indiana University, Bloomington IN 47404


a sample of xml
A Sample of XML
  • <?xml version="1.0"?>
  • <okcversion="3"xmlns="http://grids.ucs.indiana.edu/okc/schema/admin/ver/3">
  • <event>
  • <comment> This is a Test </comment>
  • <senderemail="gcf@grids.ucs.indiana.edu">Geoffrey Fox</sender>
  • <distribution> Community Grids Project Reports </distribution>
  • <organization></organization>
  • <updatecreateuri="gxos://okc/newsgroups/cgreports/$next“ />
  • <keywords></keywords>
  • <subject></subject>
  • <message/>
  • <filingdate> 2/6/2002 </filingdate>
  • <cg:messageTypexmlns:cg=“http://grids.ucs.indiana.edu/okc/schema/cg/ver/1”>
  • Test </cg:messageType>
  • </event>
  • </okc>

Schema are here


soap over http structure

HTTP Delivery with address

SOAP over HTTP Structure
  • SOAP defines a message with envelope, header and body
  • The SOAP standard also defines a binding to HTTP which is equivalent to methodology for delivering message
  • The SOAP body can specify data as well as fault processing information
  • SOAP can be transported over standard mail by just putting XML in body of mail – see



soap example from w3c i
SOAP Example from W3C I
  • We take November 16 tutorial:http://www.w3c.org/2000/xp/Group/1/11/16/soap12-primer.html
  • This is a SOAP Message – defining a reservation request
  • Header has key meta-data of application (namelist m: and instructions to SOAP (intermediate actor) processors

Start Envelope

Start Header

End HeaderStart Body

soap example concluded
SOAP Example (Concluded)

Start Body

  • This has the SOAP Body with actual request

End BodyEnd Envelope

soap binding to smtp from w3c
SOAP Binding to SMTPfrom W3C
  • Same example as before
  • This is very straightforward!
remarks on soap structure
Remarks on SOAP Structure
  • If you look at networking protocols, at each layer one specifies a header and a body
    • HTTP has a header telling system where to send information and some high level specification of what to get
    • In example, we see that body of HTTP message is full SOAP envelope and this envelope has SOAP Header and Body interpreted by “application”
    • At a lower level in protocol stack, TCP/IP and ATM etc. have their own headers and bodies
    • It is the standard Russian Dollsituation – each doll has a body (contained inside it) which is the full doll of higher level protocol




soap attachments
SOAP Attachments
  • This uses same approach as email or HTTP and is a general way of including binary data in XML – but not understood by most parsers!
  • Very important?

XML links to MIMEAttachment using absolute or relative URI’s

soap and gateway portal i
SOAP and Gateway Portal I
  • Having specified service in WSDL, the run-time is implemented in SOAP which is “just” an XML header (info needed by transport – empty here) and body
  • Here is SOAP transported by HTTP message
  • This is execLocalCommand WSDL operation to run one particular command (ls) on current WebFlow directory

HTTP Header

Argument of operation

Specify ls as

SOAP Envelope and body

soap and gateway portal ii
SOAP and Gateway Portal II



SOAPEnvelopeand body

  • And this is the result of ls sent back to client in SOAP over HTTP
wsdl definitions and namespaces
<?xml version="1.0" encoding="UTF-8" ?>







WSDL Definitions and Namespaces

Default Schema (null namespace) is WSDLsoap namespace is SOAP binding of WSDLtns namespace is this WSDL file

xsd namespace defines (ancient) XML Schema

wsdl message example
WSDL Message Example

<message name="submitRequest">

<part name="xmljob" type="xsd:string"/>



<part name="response" type="xsd:string"/>


  • For the batch script service, we pass the XML description of the job as a string and get back the script as a string.
  • In general, any XML primitive or complex types can be used in messages.
    • We could improve our service by defining a BatchScript complex type.
wsdl porttypes example
WSDL portTypes Example

<portType name="BatchScriptServicePortType">


<output message="tns:submitResponse"


<input message="tns:submitRequest"




A portType corresponds to a Java class, so if we compile this WSDL to make client stubs, we will generate a BatchScriptServiceBinding.java class.

wsdl soap binding example
WSDL SOAP Binding Example

<binding name="BatchBinding" type="tns:BatchScriptServicePortType">

<soap:bindingstyle="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

<operation name="batchGen">

<soap:operation soapAction=""/>


<soap:body use="encoded“ namespace="urn:BatchScriptService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>



<soap:body use="encoded" namespace="urn:BatchScriptService“





note binding’s “type” attribute points back to the portType tag by name

wsdl ports and services
WSDL Ports and Services

<service name="BatchScriptService">

<documentation>BS stands for Batch Script


<port binding="BatchBinding”


<soap:address location=





ports are concrete implementations of portTypes and point back to a particular binding (by name).

They also point to the specific location of a server that implements the service.

A service is a collection of one or more ports.