It 6801 Soa QB
It 6801 Soa QB
UNIT - 1
INTRODUCTION TO XML
SYLLABUS: XML document structure – Well formed and valid documents – Namespaces –
DTD – XML Schema – X-Files.
PART A
2 MARK QUESTIONS
1. What is XML?
HTML XML
HTML is an abbreviation for Hyper Text XML stands for eXtensible Markup
Markup Language. Language.
HTML was designed to display data with XML was designed to be a software and
focus on how data looks. hardware independent tool used to transport
and store data, with focus on what data is.
HTML is a markup language itself. XML provides a framework for defining
markup languages.
HTML is a presentation language. XML is neither a programming language nor
a presentation language.
HTML is case insensitive. XML is case sensitive.
HTML is used for designing a web-page to XML is used basically to transport data
be rendered on the client side. between the application and the database.
HTML has it own predefined tags. While what makes XML flexible is that
custom tags can be defined and the tags are
1
invented by the author of the XML
document.
HTML is not strict if the user does not use XML makes it mandatory for the user the
the closing tags. close each tag that has been used.
HTML does not preserve white space. XML preserves white space.
HTML is about displaying data, hence static. XML is about carrying information, hence
dynamic.
The syntax rules of XML are very simple and logical. The rules are easy to learn, and
easy to use.
XML documents must contain one root element that is the parent of all other
elements:
<root>
<child>
<subchild>.....</subchild>
</child>
</root>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
</note>
To avoid errors, you should specify the encoding used, or save your XML files as
UTF-8.
2
Elements
o Elements are the main building blocks of both XML and HTML documents.
o Examples of HTML elements are "body" and "table".
<body>some text</body>
<message>some text</message>
Attributes
o Attributes provide extra information about elements.
o Attributes are always placed inside the opening tag of an element. Attributes
always come in name/value pairs. The following "img" element has additional
information about a source file:
<img src="computer.gif" />
Entities
o Some characters have a special meaning in XML, like the less than sign (<)
that defines the start of an XML tag.
o Most of you know the HTML entity: " ". This "no-breaking-space"
entity is used in HTML to insert an extra space in a document. Entities are
expanded when a document is parsed by an XML parser.
PCDATA
o PCDATA means parsed character data.
o PCDATA is text that WILL be parsed by a parser. The text will be examined
by the parser for entities and markup.
CDATA
o CDATA means character data.
o CDATA is text that will NOT be parsed by a parser. Tags inside the text will
NOT be treated as markup and entities will not be expanded.
3
6. Define Document type declaration and mention its components.
4
7. What is element and attributes in xml? Explain with example.
5
6
8. What is Entity reference? Explain with example?
7
9. List out the rules of xml structure.
8
10. What is well formed and valid document?
9
10
11
11. What is namespace in xml?
12
13. Mention the DTD element rules.
XML elements can be defined as building blocks of an XML document. Elements can
behave as a container to hold text, elements, attributes, media objects or mix of all.
A DTD element is declared with an ELEMENT declaration. When an XML file is
validated by DTD, parser initially checks for the root element and then the child
elements are validated.
All DTD element declarations have this general form:
<!ELEMENT elementname (content)>
o ELEMENT declaration is used to indicate the parser that you are about to
define an element.
o elementname is the element name (also called the generic identifier) that you
are defining.
o content defines what content (if any) can go within the element.
13
In the above syntax
o The DTD attributes start with <!ATTLIST keyword if the element contains the
attribute.
o element-name specifies the name of the element to which the attribute applies.
o attribute-name specifies the name of the attribute which is included with the
element-name.
o attribute-type defines the type of attributes. We will discuss more on this in the
following sections.
o attribute-value takes a fixed value that the attributes must define. We will
discuss more on this in the following sections.
When declaring attributes, you can specify how the processor should handle the data
that appears in the value. We can categorize attribute types in three main categories:
o String type
o Tokenized types
o Enumerated types
Following table provides a summary of the different attribute types:
14
15
15. Mention the XML predefined entities.
It does not support the namespaces. Namespace is a mechanism by which element and
attribute names can be assigned to groups. However, in a DTD namespaces have to be
defined within the DTD, which violates the purpose of using namespaces.
It supports only the text string data type.
It is not object oriented. Hence, the concept of inheritance cannot be applied on the
DTDs.
Limited possibilities to express the cardinality for elements.
16
An XML Schema describes the structure of an XML document.
The XML Schema language is also referred to as XML Schema Definition (XSD).
XSD Example
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
The purpose of an XML Schema is to define the legal building blocks of an XML
document:
o the elements and attributes that can appear in a document
o the number of (and order of) child elements
o data types for elements and attributes
o default and fixed values for elements and attributes
17
19. List out the xpath axes for location step
18
PART - B
19
UNIT - 2
SYLLABUS: Parsing XML – using DOM, SAX – XML Transformation and XSL – XSL
Formatting – Modeling Databases in XML.
PART A
2 MARK QUESTIONS
1. What is DOM?
20
3. Write the steps in parsing XML document using DOM.
DOM is not a set of data structures; rather it is an object model describing XML
documents.
DOM does not specify what information in a document is relevant or how information
should be structured.
DOM has nothing to do with COM, CORBA, or other technologies that include the
words object model.
• The DOM working group works on phases (or levels) of the specification. At the time
of this writing, three levels are in the works.
• The DOM Level 1 and Level 2 specifications are W3C recommendations. This means
that the specifications are final and can be implemented without fear of things
changing.
• Level 1 allows traversal of an XML document as well as the manipulation of the
content in that document.
• Level 2 extends Level 1 with additional features such as namespace support, events,
ranges, and so on.
• Level 3 is currently a working draft. This means that it is under active development
and subject to change.
21
• Details of the developments can be found at the DOM working group Website
(www.w3.org/DOM).
The DOM core is available in DOM Level 1 and beyond. It permits you to create and
manipulate XML documents in memory. As mentioned earlier, DOM is a tree structure that
represents elements, attributes, and content. As an example, let’s consider a simple XML
document, as shown in Listing 7.1.
<purchase-order>
<customer>James Bond</customer>
<merchant>Spies R Us</merchant>
<items>
<item>Vibrating massager</item>
</items>
</purchase-order>
A range consists of two boundary points corresponding to the start and the end of the range.
A boundary point’s position in a Document or DocumentFragment tree can be characterized
by a node and an offset. The node is the container of the boundary point and its position. The
container and its ancestors are the ancestor containers of the boundary point and its position.
The offset within the node is the offset of the boundary point and its position. If the container
is an Attr, Document, DocumentFragment, Element, or EntityReference node, the offset is
between its child nodes. If the container is a CharacterData, Comment, or
ProcessingInstruction node, the offset is between the 16-bit units of the UTF-16 encoded
string contained by it.
22
7. Write the disadvantages of DOM?
23
9. What is SAX?
SAX is an API that can be used to parse XML documents. A parser is a program that reads
data a character at a time and returns manageable pieces of data. For example, a parser for the
English language might break up a document into paragraphs, words, and punctuation. In the
case of XML, the important pieces of data include elements, attributes, text, and so on. This
is what SAX does.
SAX provides a framework for defining event listeners, or handlers. These handlers are
written by developers interested in parsing documents with a known structure. The handlers
are registered with the SAX framework in order to receive events. Events can include start of
document, start of element, end of element, and so on. The handlers contain a number of
methods that will be called in response to these events. Once the handlers are defined and
registered, an input source can be specified and parsing can begin.
24
• SAX is not a perfect solution for all problems. For instance, it can be a bit harder to
visualize compared to DOM because it is an event-driven model. SAX parsing is
“single pass,” so you can’t back up to an earlier part of the document any more than
you can back up from a serial data stream.
• Moreover, you have no random access at all. Handling parent/child relationships can
be more challenging as well.
• Another disadvantage is that the current SAX implementations are read-only parsers.
• They do not provide the ability to manipulate a document or its structure (this feature
may be added in the future). DOM is the way to go if you want to manipulate a
document in memory. There is no formal specification for SAX. The interfaces and
behavior are defined through existing code bases. This means there is no way to
validate a SAX parser or to determine whether it works correctly.
• Even considering these limitations, SAX does its job well. It’s lightweight, simple,
and easy to use. If all you want to do is read XML, SAX will probably do what you
need.
25
12. What is JAXB?
In the transformation process, XSLT uses XPATH to define parts of the source document that
should match one or more predefined templates. When the match is found XSLT will
transform the matching part of the source document into the result document.
An XML schema is itself an XML document. It provides more detail about the kind of data
that can appear as part of an XML document.
26
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
</xs:schema>
PART - B
16 MARK QUESTIONS
5. What are steps in modeling database in XML? Explain each step in detail.
27
UNIT - 3
SYLLABUS: Characteristics of SOA, Comparing SOA with Client – Server and Distributed
architectures – Benefits of SOA -- Principles of Service orientation – Service layers.
PART A
2 MARK QUESTIONS
Contemporary SOA represents an architecture that promotes service orientation through the
use of web services. Contemporary SOA represents an open, agile, extensible, federated,
composable architecture comprised of autonomous, QoS-capable, vendor diverse,
interoperable, discoverable, and potentially reusable services, implemented as Web services.
28
vi. Contemporary SOA fosters intrinsic interoperability.
vii. Not keeping in touch with product platforms and standards development
29
6. What are the requirements is needed to fill QoS gaps between contemporary and
Primitive SOA?
Contemporary SOA is striving to fill the QoS gaps of the primitive SOA model with the
following requirements:
Autonomous Principle represents the ability of a service to carry out its logic independently
of outside influences.
i. Runtime autonomy
Runtime Autonomy represents the amount of control a service has over its execution
environment at runtime.
Design time autonomy represents the amount of governance control a service owner has over
the service design.
30
12. What are the design characteristics required to facilitate interoperability in
contemporary SOA?
i. Standardization
ii. Scalability
iv. Reliability
Organizational Agility refers to efficiency with which an organization can respond to change.
Application architecture is a template for all others which specifically explained the
technology, boundaries, rules, limitations, and design characteristics that apply to all
solutions based on this template.
31
Single-tier client-server architecture is an environment in which bulky mainframe back-ends
server served the thin clients.
19. List out the primary characteristics of the two tier client server architecture?
The primary characteristics of the two tier client server architectures is given below which is
compared to SOA
i. Application logic
iii. Technology
iv. Security
v. Administration
i. Synchronous communication
Synchronous communication allows the client and server to wait for each other to transfer the
message. That is, the client will not continue until the server has received the message.
Asynchronous communication allows the server to continuously receive messages from the
client without waiting for the server to respond.
32
24. List out the types of service autonomy?
i. Service-level autonomy
• Service-level autonomy - Service boundaries are distinct from each other, but the service
may share underlying resources. For example, a wrapper service that encapsulates a legacy
environment that also is used independently from the service has service-level autonomy. It
governs the legacy system but also shares resources with other legacy clients.
• Pure autonomy - The underlying logic is under complete control and ownership of the
service. This is typically the case when the underlying logic is built from the ground up in
support of the service.
The four identified parts of automation logic related to different sized units of logic as
follows:
33
iv. processes = units of automation logic (coordinated aggregation units of work)
28. What are the issues that are raised in the client-server and the distributed Internet
architecture?
The issues that are raised in the client-server and the distributed Internet architecture
comparisons are discussed in a comparison between multi-tier client-server and SOA.
i. Application logic
iii. Technology
iv. Security
v. Administration
Client-server remote procedure call (RPC) connection is used for remote communication
between components residing on client workstations and servers.
i. Better load balancing: More evenly distributed processing (e.g., application logic
distributed between several servers)
ii. More scalable: Only servers experiencing high demand need be upgraded
34
32. What is the difference between services and components?
Supplementary definition that can be applied to both primitive and contemporary SOA. SOA
is a form of technology architecture that adheres to the principles of serviceorientation. When
realized through the Web services technology platform, SOA establishes the potential to
support and promote these principles throughout the business process and automation
domains of an enterprise.
PART - B
16 MARK QUESTIONS
35
2. Explain briefly about principles of SOA
UNIT - 4
36
WEB SERVICES
PART A
2 MARK QUESTIONS
2. What are the basic parts comprised in the web services framework?
ii. technologies
iii. concepts
iv. models
v. sub-frameworks
ii. Core building blocks that include web services, service descriptions, and messages.
37
v. A service description registration and discovery architecture sometimes realized
through UDDI.
vii. A second generation of web services extensions (also known as the WS-
*specifications) continually broadening its underlying feature-set.
i. Flexible
ii. Adaptable
6. Define Service.
A service is a unit of software capable of altering its role, depending on its processing
responsibility in a given scenario.
i. Service provider
iii. Intermediaries
38
iv. Initial sender and ultimate receiver
v. Service compositions
The service provider is used to identify the organization (or individual) responsible for
actually providing the web service. It simply referred as the service being invoked.
Service requestor is a processing logic unit capable of issuing a request message that can be
understood by the service provider.
Web services and service agents route and process a message after it is initially sent and
before it arrives at its ultimate destination are referred to as intermediaries or intermediary
services.
i. Passive intermediary
Initial senders are simply service requestors that initiate the transmission of message. It is the
first web service in a message path.
Ultimate receiver identifies service consumer that exist as the last web service along a
messages’ path.
39
14. What is service composition?
Service models refer to permanent classifications that represent the logic housed by the
service, as well as its role within the overall solution.
The business service model is a model that encapsulates a distinct set of business logic within
a well-defined functional boundary. The business service model corresponds to the business
service layer in SOA abstraction layer.
40
Utility service is generic and non-application specific web service or service agent that is
designed for potential reuse.
The controller service represents a service with a capability that is executing the parent
composition logic required to compose capabilities within other services. The controller
services can become subordinate service composition members.
The individual documents that comprise a service contract are referred to as service
description documents.
Service endpoint provides a formal definition of the endpoint interface and also establishes
the physical location of the service.
41
25. What are service descriptions?
A WSDL service description explains how the service description document itself is
organized. It is also known as WSDL service definition or just WSDL definition.
i. Abstract description
An abstract description establishes the interface characteristics of the web service without any
reference to the technology used to host or enable a web service to transmit messages.
i. Port type
ii. Operation
iii. Message
Port type provides a high-level view of the service interface by sorting the messages a service
can process into groups of functions.
The concrete description portion of the WSDL file defines the connection needed from the
abstract web service interface to a physical transport protocol.
ii. Port
iii. Service
The Simple Object Access Protocol (SOAP) is used to define a standard message format
which is used for communication between services running on different operating systems.
i. Extensible
ii. Interoperable
iii. Independent
SOAP envelope
SOAP body
SOAP fault
43
37. Sketch the anatomy of a SOAP message.
<?xml version=”1.0”?>
<soap:Envelope
xmlns:soap=”http://www.w3.org/2001/12/soap-envelope”
soap:encodingStyle=”http://www.w3.org/2001/12/soap-encoding”>
<soap:Header>
........
</soap:Header>
<soap:Body>
......
<soap:Fault>
......
</soap:Fault>
</soap:Body>
</soap:Envelope>
The programs that use services to transmit and receive SOAP messages are referred to as
SOAP nodes.
The route taken by the message is called the SOAP message path. The set of SOAP nodes
through which the SOAP message passes, including the initial sender, the ultimate receiver
and one or more intermediaries are called the SOAP message path.
Message Exchange Pattern (MEP) defines the way that SOAP messages are exchanged
between the web service requester and web service provider. It represents a set of templates.
44
41. List out some primitive MEPs.
i. Request-response
ii. Fire-and-forget
Coordination is the act of one entity (known as the coordinator) disseminating information to
a number of participants for coordinating the activities of the web services that are part of a
business process.
45
vi. Inconsistent in terms of the interface granularity they expose
PART - B
16 MARK QUESTIONS
UNIT - 5
46
SYLLABUS: Service descriptions – WSDL – Messaging with SOAP – Service discovery –
UDDI – Message Exchange Patterns – Orchestration – Choreography –WS Transactions.
PART A
2 MARK QUESTIONS
ii. Struts
3. What is JAX-WS?
JAX-WS is a technology for building web services using XML. In JAX-WS, a web service
operation invocation is represented by an XML-based protocol such as SOAP.
4. Expand SEI.
47
• Service Endpoint Implementation
5. What is SEI?
SEI is a java interface or class that declares the methods that a client can invoke on the
service.
7. What is JAXB?
Java Architecture for XML binding API (JAXB) provides a means of generating Java classes
from XSD schemas and further abstracting XML-level development.
ii. Unmarshal
iii. Marshal
48
11. Write down the advantages of JAXB.
The Java API for XML Registries (JAXR) provides a uniform and standard Java API for
accessing various kinds of XML registries.
i. JAXR client
i. javax.xml.registry
ii. javax.xml.registry.infomodel
49
JAX-RPC stands for Java API for XML based RPC.
JAX-RPC is used for building and deploying SOAP+WSDL web services clients and
endpoints. It enables clients to invoke web services developed across heterogeneous
platforms.
50
20. Expand CLS and CLR.
• Manages memory
Allocation of memory
De-allocation of memory (garbage collection)
• Thread execution support
• Code execution
• Code safety verification
• Compilation
i. HTML controls
ii. Flexibility
51
25. Expand WS-BPEL.
An <process> element is the root element and must have a name attribute for assigning the
name value. It is used to establish the process definition related namespace.
The partnetLink define the services that are orchestrated by the process. It contain a set of
<partnerLink> element each represent the communication exchange between two partners ie.,
the process service being one partner and another service being the other.
i. myRole
52
ii. partnerRole
i. Identifies the partner service that the process service will be invoking
The partnerLinkType elements are used to identify the WSDL portType elements referenced
by the partnerLink elements within the process definition.
Varables hold the data that constitute the state of a BPEL business process during runtime.
• MessageType
• Element
• Type
53
Syntax:
Example
getVariableProperty(“TicketApproval”,”class”)
The gatVariableData function has a mandatory variable name parameter and two optional
arguments that can be used to specify a part of the variable data.
Syntax
Example
getVariableData(“input”,’”payload”,”/tns:TimesheetType/Hours/...”)
The <invoke> activity is used to invoke the web service operations provided by partners.
41. What are five common attributes equipped with invoke element?
i. partnerLink
ii. portType
iii. operation
iv. inputVariable
PART - B
16 MARK QUESTIONS
54
2. Explain the JAX-RPC service concepts in detail.
55