A new XML namespace is declared using
- The
xmlns
attribute.
- The
DOCTYPE
element.
- The
namespace
attribute.
- The
xsi
attribute.
- The
xsd
attribute.
In the following (mostly meaningless) XML snippet:
<choice ret:answer="1"><code>Pick me</code> </choice>
<choice xmlns:rdf="http://www.rdf.org"><rdf:code>I am wrong.</rdf:code> </choice>
<choice xsi:type="string"><code>Im almost correct.</code></choice>
<choice namespace="http://example.com/x.xsd"><code>Im boring.</code> </choice>
<choice><code>Im friends with the correct one.</code> </choice>
Which one of the following is a namespace prefix?
ret
namespace
xmlns
choice
http://www.rdf.org
One difference between XML Schema and DTDs is that:
- XML Schema is written in XML.
- DTDs allow one to be more specific about the type of sub-elements an element can have.
- XML Schema is easier to validate.
- XML Schema implements namespaces.
- DTDs cannot be used to define the set of elements a document should have.
The following XML Schema definition:
<xsd:sequence>
<xsd:element name="productName" type="xsd:string"/>
<xsd:element name="quantity">
<xsd:simpleType>
<xsd:restriction base="xsd:positiveInteger">
<xsd:maxExclusive value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
would validate which of the following XML examples?
-
<productName>pooh piano book</productName>
<quantity>23</quantity>
-
<quantity>23</quantity>
<productName>pooh piano book</productName>
-
<productName>pooh piano book</productName>
<quantity>123</quantity>
-
<product>pooh piano book</product>
<quantity>100</quantity>
-
<productName>pooh's answer</productName>
<quantity base="xsd:positiveInteger">23</quantity>
When using SOAP we use XML Schema mostly because
- It defines a lot of useful types.
- We do not use XML Schema in SOAP.
- It is better than using DTDs for parsing SOAP messages.
- It has distributed programming primitives.
- It enables the routing of messages.
An XML Schema Complex Type is called "complex" because
- It is formed by aggregating many other types.
- It is hard to parse.
- It implements complicated if-then rules.
- It is formed from unstable radioactive compounds.
- It uses the RDF Schema.
The basic modeling primitives of RDF Schema are
- Class, Property, and ConstraintProperty
- elements and attributes
- subject, verb, and object
- things and ideas
- namespaces, elements, and doctypes
DAML is a language for
- Creating ontologies.
- Describing agents.
- Describing web services.
- Defining XML Schema types.
- Creating multicast SOAP messages.
The main entities we define in DAML are
- classes and properties
- elements and attributes
- services and bindings
- ports and services
- strings and integers
The SAX API is defined:
- independent of any implementation
- by the W3C
- only for valid XML documents
- as a better method for implementing the DOM API
- so as to handle the editing of XML documents efficiently
A main difference between SAX and DOM is that
- DOM typically requires the whole document to reside in memory.
- SAX usually results in fewer programmer errors.
- SAX is language-neutral.
- DOM is can handle more complex documents.
- SAX cannot handle XHTML documents.
When using the SAX API you need to
- define callbacks for the start and end tags of elements
- define a callback for each element used in the schema
- define callbacks for each attribute and each element
- use the XML Schema types
- determine the maximum nesting of the document
A DOM tree will often have more text nodes than one might expect, this is because
- it creates text nodes for whitespace
- it represents attribute values as text nodes
- it only uses element nodes when the tag is part of the schema
- DOM does not use text nodes
- it creates a different text node for each namespace
Which one of the following is not a DOM node type
- number
- attribute
- text
- document
- comment
If you had to write a program that read an XML file, modified some elements within it, then wrote the new file out, which one would you use?
- DOM because it allows one to easily modify an XML document
- DOM because it reads the whole document into memory
- DOM because it has many different node types
- SAX because it is faster
- SAX because it reads the whole document into memory
A normalized XML document
- has no extraneous whitespace
- is properly indented
- utilizes the appropriate DOCTYPE
- uses only one namespace
- cannot be used as an input to a validating parser
Which one of the following could not be considered a "web
service", no matter how much we stretch the definition of this
vague and mostly useless marketing term?
- a C# program that only interacts with the user at the console
- the application you wrote for PS 1
- an automated email list manager (which automatically subscribes people to the mailing list)
- a SOAP application over HTTP
- a Java servlet with a well-defined API
Which one of the following is not part of the "web service" technology stack?
- delivery
- discovery
- description
- packaging
- transport
The Object in Simple Object Access Protocol refers to:
- nothing
- the communications object
- the objects instantiated by both ends of the conversation
- the object to be accessed at the server, for which the client receives a reference
- the delivery object
There is no object in SOAP!
Which one of the following is not a reason why SOAP has
gained momentum over RMI and CORBA?
- it is easier to implement
- it is more powerful
- it is object-oriented
- its libraries are easier to use
- it scales better
Sad, isn't it?
The value of the actor
attribute in a SOAP message is
- a role
- an agent name
- a URI to a WSDL file
- the URI of an agent's SOAP binding
- an unconstrained xsd:string
SOAP handles exceptions via
- the
Fault
element
- the
Exception
element
- the
Throws
element
- denial. It does not handle exceptions.
- a 500 return code.
When a node receives a SOAP message it should first
- process all header blocks that are targeted to the node
- process the body
- process the body, but only if the node is the final recipient
- create an instance of the SOAP object
- find and obey the
mustUnderstand
attributes
A node must understand only those blocks that have their actor set to a role the node can play.
The following SOAP envelope:
<s:Envelope xmlns:s="...">
<s:Body>
<jump xmlns=".."
s:encodingStyle="http://www.w3.org/2001/06/soap-encoding">
<height xsi:type="string">very high</height>
<when xsi:type="string">12</when>
</jump>
</s:Body>
</s:Envelope>
corresponds to which Java function declaration(s)?
- String jump(String height, String when)
- void jump(String when, String height)
- void jump(String when, Integer height)
- void height(String s); void when(Integer s);
- That is an illegal function call because its missing the functionName attribute.
If you call a SOAP function called "when", the result of the
call will be returned to you in an element called:
- whenResponse
- when
- return
- result
- soapResult
In SOAP, an array of strings called StringArray
would be encoded as:
- A
StringArray
element with many sub-elements with the same name.
- A
StringArray
element followed by elements representing the array strings.
- A
StringArray
element followed by a xsd:sequence
for the strings..
- An
Array
element with attribute and value of name="StringArray"
and sub-elements named string
.
- An
Array
element with a name
sub-elements for each string.
If you called a SOAP service that takes two arguments, one of
type Address
and one or type person
Person
with "person" and "address" as defined by:
Address address = new Address();
Person person = new Person();
person.setAddress(address);
the SOAP encoding would
- use
href
to point to the address
- send over two copies of the address
- give an error message
- send two copies of person
- ignore the address field in the person
The WSDL is used for
- describing the interface of a SOAP service
- finding SOAP services that implement a given interface
- communicating between SOAP and .NET
- describing the communications protocol SOAP service
- describing how a SOAP service is deployed on a web server
In a WSDL file, which one of the following most closely corresponds to the function name in a programming language?
- operation
- portType
- message
- service
- type
A WSDL message
consists of part
s that
- each have a type from some type system
- have a sender and receiver
- are free-form
- can themselves be
message
s
- must be declared in the SOAP header
Which one of the following is a WSDL transmission primitive that
can not supported by an endpoint.
- multicast
- one-way
- request-response
- solicit-response
- notification
The top-level elements of a WSDL document are
- types, message, portType, binding, service
- portType, binding, service
- types, message, operator, portType, binding, service
- binding, service
- header, body
The UDDI is used for
- finding SOAP services that implement a given interface
- describing the interface of a SOAP service
- communicating between SOAP and .NET
- describing the communications protocol SOAP service
- describing how a SOAP service is deployed on a web server
A UDDI registry holds descriptions of
- the business, service, and bindings
- the UDDI clients
- the interfaces implemented by the registered web services
- the encoding mechanism
- the users' preferences
A UDDI TModel is
- a way of describing the various business, service, and template structures stored within the UDDI registry.
- a technical description of the web services represented by the business service structure
- the English description of the business
- a request-response message pattern definition
- a transitional model
UDDI are deployed using
- a federated model
- a hierarchical model
- a master-slave model
- an n-tier model
- a centralized model
A UDDI registry can be accessed using which SOAP interface(s)?
InquireSOAP
and PublishSOAP
UDDISOAPInterface
- SOAP with HTTP
Publish
and Query
uddiSOAP
The first step in translating a WSDL file to be used with UDDI is to
- Split it into an interface and an implementation description files
- Register the WSDL file as a UDDI
TModel
- Change all the types from XML Schema to UDDI Schema
- Send it to the registry and gather the error messages
- Re-write it using the UDDI Schema
WS-Inspection was developed for use
- in small in-house applications
- by companies who do not wish to cooperate with UDDI
- as an extension of UDDI
- as an extension of WSDL
- along with DAML-S
WS-Inspection files must be placed
- in the root directory of the webserver, on a file named inspection.wsil
- in the WS-I registry
- in the same directory as the service and returned whenever anyone asks for a URL ending in ?WSIL
- at the .NET passport service
- in the local hard drive