Upload
timothy-shepherd
View
223
Download
0
Tags:
Embed Size (px)
Citation preview
Web services
DOM parsing and SOAP
Summary
Exercise SAX-Based checkInvoice() push parsing event-based parsing traversal order is depth-first
Intro to SOAP
Todays agenda
Practical exercise DOM parsing (p91 - 96) SOAP revisited Practical exercise calling the web service
googleSearch
XMLDocument
Character Stream
Parser
Serializer
StandardizedXML APIs
Basic XML processing architecture
(deserializer)
Application
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Todays exercise DOM parsing(Document Object Model W3C)
ONE-STEP parsing model
Most popular and widely used parser model
Builds the parse tree first before parsing
Easy to program with but takes up a lot of memory takes time to instantiate the parse tree
DOM parsing
Building a DOM parse tree Navigating and manipulating the DOM tree
Two important packages orgw3cdom javaxxmlparsers
httpjavasuncomwebservices Java API for XML Web Services (JAX-WS) Java Architecture for XML Binding (JAXB) Java API for XML Messaging (JAXM) gtgtgt Java API for XML Processing (JAXP) Java API for XML Registries (JAXR) Java API for XML-based RPC (JAX-RPC) SOAP with attachments API for Java (SAAJ) Java API for XML WS addressing (JAX-WSA) XML Web Services Security (XWSS)
Building the DOM parse tree
The DOM parsing architecture
ob
ob ob
ob ob
W3CDOMDocument
BuilderInstance
XML Data
DocumentBuilderFactory
get
build
read
Package to build DOM tree
javaxxmlparsers Specifies
DocumentBuilder classes and DocumentBuilderFactory classes
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Summary
Exercise SAX-Based checkInvoice() push parsing event-based parsing traversal order is depth-first
Intro to SOAP
Todays agenda
Practical exercise DOM parsing (p91 - 96) SOAP revisited Practical exercise calling the web service
googleSearch
XMLDocument
Character Stream
Parser
Serializer
StandardizedXML APIs
Basic XML processing architecture
(deserializer)
Application
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Todays exercise DOM parsing(Document Object Model W3C)
ONE-STEP parsing model
Most popular and widely used parser model
Builds the parse tree first before parsing
Easy to program with but takes up a lot of memory takes time to instantiate the parse tree
DOM parsing
Building a DOM parse tree Navigating and manipulating the DOM tree
Two important packages orgw3cdom javaxxmlparsers
httpjavasuncomwebservices Java API for XML Web Services (JAX-WS) Java Architecture for XML Binding (JAXB) Java API for XML Messaging (JAXM) gtgtgt Java API for XML Processing (JAXP) Java API for XML Registries (JAXR) Java API for XML-based RPC (JAX-RPC) SOAP with attachments API for Java (SAAJ) Java API for XML WS addressing (JAX-WSA) XML Web Services Security (XWSS)
Building the DOM parse tree
The DOM parsing architecture
ob
ob ob
ob ob
W3CDOMDocument
BuilderInstance
XML Data
DocumentBuilderFactory
get
build
read
Package to build DOM tree
javaxxmlparsers Specifies
DocumentBuilder classes and DocumentBuilderFactory classes
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Todays agenda
Practical exercise DOM parsing (p91 - 96) SOAP revisited Practical exercise calling the web service
googleSearch
XMLDocument
Character Stream
Parser
Serializer
StandardizedXML APIs
Basic XML processing architecture
(deserializer)
Application
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Todays exercise DOM parsing(Document Object Model W3C)
ONE-STEP parsing model
Most popular and widely used parser model
Builds the parse tree first before parsing
Easy to program with but takes up a lot of memory takes time to instantiate the parse tree
DOM parsing
Building a DOM parse tree Navigating and manipulating the DOM tree
Two important packages orgw3cdom javaxxmlparsers
httpjavasuncomwebservices Java API for XML Web Services (JAX-WS) Java Architecture for XML Binding (JAXB) Java API for XML Messaging (JAXM) gtgtgt Java API for XML Processing (JAXP) Java API for XML Registries (JAXR) Java API for XML-based RPC (JAX-RPC) SOAP with attachments API for Java (SAAJ) Java API for XML WS addressing (JAX-WSA) XML Web Services Security (XWSS)
Building the DOM parse tree
The DOM parsing architecture
ob
ob ob
ob ob
W3CDOMDocument
BuilderInstance
XML Data
DocumentBuilderFactory
get
build
read
Package to build DOM tree
javaxxmlparsers Specifies
DocumentBuilder classes and DocumentBuilderFactory classes
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
XMLDocument
Character Stream
Parser
Serializer
StandardizedXML APIs
Basic XML processing architecture
(deserializer)
Application
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Todays exercise DOM parsing(Document Object Model W3C)
ONE-STEP parsing model
Most popular and widely used parser model
Builds the parse tree first before parsing
Easy to program with but takes up a lot of memory takes time to instantiate the parse tree
DOM parsing
Building a DOM parse tree Navigating and manipulating the DOM tree
Two important packages orgw3cdom javaxxmlparsers
httpjavasuncomwebservices Java API for XML Web Services (JAX-WS) Java Architecture for XML Binding (JAXB) Java API for XML Messaging (JAXM) gtgtgt Java API for XML Processing (JAXP) Java API for XML Registries (JAXR) Java API for XML-based RPC (JAX-RPC) SOAP with attachments API for Java (SAAJ) Java API for XML WS addressing (JAX-WSA) XML Web Services Security (XWSS)
Building the DOM parse tree
The DOM parsing architecture
ob
ob ob
ob ob
W3CDOMDocument
BuilderInstance
XML Data
DocumentBuilderFactory
get
build
read
Package to build DOM tree
javaxxmlparsers Specifies
DocumentBuilder classes and DocumentBuilderFactory classes
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Todays exercise DOM parsing(Document Object Model W3C)
ONE-STEP parsing model
Most popular and widely used parser model
Builds the parse tree first before parsing
Easy to program with but takes up a lot of memory takes time to instantiate the parse tree
DOM parsing
Building a DOM parse tree Navigating and manipulating the DOM tree
Two important packages orgw3cdom javaxxmlparsers
httpjavasuncomwebservices Java API for XML Web Services (JAX-WS) Java Architecture for XML Binding (JAXB) Java API for XML Messaging (JAXM) gtgtgt Java API for XML Processing (JAXP) Java API for XML Registries (JAXR) Java API for XML-based RPC (JAX-RPC) SOAP with attachments API for Java (SAAJ) Java API for XML WS addressing (JAX-WSA) XML Web Services Security (XWSS)
Building the DOM parse tree
The DOM parsing architecture
ob
ob ob
ob ob
W3CDOMDocument
BuilderInstance
XML Data
DocumentBuilderFactory
get
build
read
Package to build DOM tree
javaxxmlparsers Specifies
DocumentBuilder classes and DocumentBuilderFactory classes
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Todays exercise DOM parsing(Document Object Model W3C)
ONE-STEP parsing model
Most popular and widely used parser model
Builds the parse tree first before parsing
Easy to program with but takes up a lot of memory takes time to instantiate the parse tree
DOM parsing
Building a DOM parse tree Navigating and manipulating the DOM tree
Two important packages orgw3cdom javaxxmlparsers
httpjavasuncomwebservices Java API for XML Web Services (JAX-WS) Java Architecture for XML Binding (JAXB) Java API for XML Messaging (JAXM) gtgtgt Java API for XML Processing (JAXP) Java API for XML Registries (JAXR) Java API for XML-based RPC (JAX-RPC) SOAP with attachments API for Java (SAAJ) Java API for XML WS addressing (JAX-WSA) XML Web Services Security (XWSS)
Building the DOM parse tree
The DOM parsing architecture
ob
ob ob
ob ob
W3CDOMDocument
BuilderInstance
XML Data
DocumentBuilderFactory
get
build
read
Package to build DOM tree
javaxxmlparsers Specifies
DocumentBuilder classes and DocumentBuilderFactory classes
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
DOM parsing
Building a DOM parse tree Navigating and manipulating the DOM tree
Two important packages orgw3cdom javaxxmlparsers
httpjavasuncomwebservices Java API for XML Web Services (JAX-WS) Java Architecture for XML Binding (JAXB) Java API for XML Messaging (JAXM) gtgtgt Java API for XML Processing (JAXP) Java API for XML Registries (JAXR) Java API for XML-based RPC (JAX-RPC) SOAP with attachments API for Java (SAAJ) Java API for XML WS addressing (JAX-WSA) XML Web Services Security (XWSS)
Building the DOM parse tree
The DOM parsing architecture
ob
ob ob
ob ob
W3CDOMDocument
BuilderInstance
XML Data
DocumentBuilderFactory
get
build
read
Package to build DOM tree
javaxxmlparsers Specifies
DocumentBuilder classes and DocumentBuilderFactory classes
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
httpjavasuncomwebservices Java API for XML Web Services (JAX-WS) Java Architecture for XML Binding (JAXB) Java API for XML Messaging (JAXM) gtgtgt Java API for XML Processing (JAXP) Java API for XML Registries (JAXR) Java API for XML-based RPC (JAX-RPC) SOAP with attachments API for Java (SAAJ) Java API for XML WS addressing (JAX-WSA) XML Web Services Security (XWSS)
Building the DOM parse tree
The DOM parsing architecture
ob
ob ob
ob ob
W3CDOMDocument
BuilderInstance
XML Data
DocumentBuilderFactory
get
build
read
Package to build DOM tree
javaxxmlparsers Specifies
DocumentBuilder classes and DocumentBuilderFactory classes
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Building the DOM parse tree
The DOM parsing architecture
ob
ob ob
ob ob
W3CDOMDocument
BuilderInstance
XML Data
DocumentBuilderFactory
get
build
read
Package to build DOM tree
javaxxmlparsers Specifies
DocumentBuilder classes and DocumentBuilderFactory classes
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
The DOM parsing architecture
ob
ob ob
ob ob
W3CDOMDocument
BuilderInstance
XML Data
DocumentBuilderFactory
get
build
read
Package to build DOM tree
javaxxmlparsers Specifies
DocumentBuilder classes and DocumentBuilderFactory classes
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Package to build DOM tree
javaxxmlparsers Specifies
DocumentBuilder classes and DocumentBuilderFactory classes
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Navigate and manipulate DOM parse tree
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Key DOM interfaces (Fig29)Interface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()DocumentFragm
ent createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)Node
List
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Document Interface key methods
createElement(tagNameString)Element createDocumentFragment()Fragment createTextNode(dataString)Text createAttribute(nameString)Attr getElementsByTagname(tagnameString)No
deList
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Node (root) Interface key methods
+ getNodeName()String + getNodeValue()String + setNodeValue(nodeValueString)void +getNodeType()short +getParentNode()Node +getChildNodes()NodeList +getAttributes()NamedNodeMap
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Element Interface key methods
+getTagName()String +getAttribute(nameString)String +setAttribute(nameStringvalueString)void +hasAttribute(nameString)boolean
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
InterfaceElement
InterfaceAttr
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Attribute Interface key methods
+getName()String +getValue()String +setValue(valueString)void
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Key DOM interfacesInterface
NodeList
Interface
CharacterData
Interface
Text
Interface
Node
Interface
Document
Interface
NamedNodeMap
Interface
Element
Interface
Attr
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
DOM has a name-space awareversion
API version of most key interfaces getAttributeNS(String nsURIString localName)
Example ldquohttpskatestowncomnsinvoicerdquo (ns URI) ldquoitemrdquo ldquotaxrdquo etc (local name wo prefix)
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Requires the parser become name space aware
After
DocumentBuilderFactory factory=
DocumentBuilderFactorynewInstance()
insert
factorySetNamespaceAware(true)
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Todays DOM exercise
Use DOM for invoice checker repeat last weeks exercise using a DOM parser instead
( Down load files InvoiceCheckerjava InvoiceCheckerDOMjava with ftpevarosenet)
Transform InvoiceCheckerDOMjava to read an invoice xml document which uses name spaces (Download skatextownInvoiceNSxml with ftpevarosenet)
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Java API Specifications
To help you in developing Java programs Go to
httpjavasuncomj2se
Then click on
API Specifications
Then click on
J2SE
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
DOM-based Invoice Checkerimports
package comskatestowninvoice
import javaioInputStream
import orgw3cdomNode
import orgw3cdomNodeList
import orgw3cdomElement
import orgw3cdomCharacterData
import javaxxmlparsersDocumentBuilder
importjavaxxmlparsersDocumentBuilderFactory
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
SOAP
The Simple Access Object Protocol
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Service requester Service provider
soapmessages
application object(client)
SOAP-basedmiddleware
application object(service provider)
SOAP-basedmiddleware
stub skeleton
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Structure and content of a SOAP message
All SOAP messages are XML documentscontaining the elements
1 Required envelope element 2 Optional header element
3 Required body element 4 Optional fault element
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
SOAP namespaces
The 4 principal elements are declared in the default namespace for the SOAP envelope httpwwww3org200112soap-envelope
The default namespace for SOAP encoding and data types httpwwww3org200112soap-encoding
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Important syntax rules
Soap messages must be encoded using XML
Soap messages must use the SOAP envelope namespace
SOAP messages must use the SOAP encoding namespace
SOAP messages must not contain XML processing instructions
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
SOAP envelope
SOAP header
SOAP body
SOAP MESSAGE
header block
header block
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
SOAP request
ltxml version=10gtltsoapEnvelope xmlnssoap=httpwwww3org200112soap-envelope soapencodingStyle= httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPricegt ltmStockNamegtIBMltmStockNamegt ltmGetStockPricegt ltsoapBodygt ltsoapEnvelopegt
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
SOAP response
ltxml version=10gtltsoapEnvelopexmlnssoap=httpwwww3org200112soap-envelopesoapencodingStyle=httpwwww3org200112soap-encodinggt
ltsoapBody xmlnsm=httpwwwexampleorgstockgt ltmGetStockPriceResponsegt ltmPricegt345ltmPricegt ltmGetStockPriceResponsegt ltsoapBodygt
ltsoapEnvelopegt
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
Calling the googleSearch web service
download axis 2 (soap library) either from
ftpevarosenet or httpwsapacheorg unpack the axis 2 zip-archive current directory must be samples
googleSearch run the Runbat script enter 1) axis 2) marist what is the effect
See you next week for
The Web Service Description Language (WSDL)
Assignment 1
See you next week for
The Web Service Description Language (WSDL)
Assignment 1