These SOAP multiple-choice questions and their answers will help you strengthen your grip on the subject of SOAP. You can prepare for an upcoming exam or job interview with these 70+ SOAP MCQs.
So scroll down and start answering.
Which of the following is the base namespace for a SOAP message?
A. http://www.w3.org/2001/06/soap-message
B. http://www.w3.org/2001/06/soap-envelope
C. http://www.w3.org/2001/06/soap/message
D. http://www.w3.org/2001/06/soap/soapEnvelope
Which type of array in SOAP messages represents a grid of values with specified dimensions that may or may not contain any data?
A. Partially Transmitted Array
B. Sparse Array
C. Incomplete Array
D. Typed Array
SOAP defines four standard types of faults that belong to the http://www.w3.org/2001/06/soap-envelope namespace. Which of the following is correct regarding extensibility of those standard types?
A. Standard faults can be extended
B. Standard faults cannot be extended
C. Standard faults must be extended
D. None of the above
Read the following statements:
<s:Envelopexmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<V:Upgradexmlns:V="http://www.w3.org/2001/06/soap-upgrade">
<envelope qname="ns1:Envelope"
xmlns:ns1="http://www.w3.org/2001/06/soap-envelope"/>
</V:Upgrade>
</s:Header>
<s:Body>
<s:Fault>
<faultcode>s:VersionMismatch</faultcode>
<faultstring>Version Mismatch</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
What does the Upgrade header block do in the above code?
A. It upgrades the version of the SOAP specification at the client side
B. It upgrades the version of the SOAP specification at the server side
C. It tells the sender which version of SOAP it supports
D. All of the above
As part of the overall specification, Section 5 of the SOAP standard introduces a concept known as encoding styles. An encoding style is a set of rules that define exactly how native application and platform data types are to be encoded into a common XML syntax.
Which of the following are correct locations for encoding style implementation?
A. Any where in the document
B. Only in the body
C. Only in the header
D. Only before the body
E. None of the above
A. The message will be received successfully
B. It will either process it according to the SOAP Version 1.1 specifications or trigger a 'Version mismatch' error
C. An 'Invalid message' error will be triggered
D. A partial message will be received
There is an improper application in the Section 5 encoding style rules. Which of the following type of SOAP Faults occurs in this scenario?
A. MustUnderstand
B. Server
C. Client
D. VersionMismatch
E. None of the above
A SOAP message may travel from a sender to a receiver by passing different endpoints along the message path. Not all parts of the SOAP message may be intended for the ultimate endpoint of the SOAP message but instead, it may be intended for one or more of the endpoints on the message path. Which of the following attributes may be used to address the Header element to a particular endpoint?
A. AuthHeader
B. Actor
C. Destination
D. Path
Which of the following represents an array in SOAP messages?
A. <person><firstname>Joe</firstname><lastname>Smith</lastname></person>
B. <people><person name='joe smith'/><person name='john doe'/></people>
C. <people><person name='joe smith'><designation/></person><person name='john doe'><designation/></person></people>
D. None of the above
Which of the following is an invalid child of a Fault element of a SOAP message?
A. faultcode
B. faultstring
C. faultactor
D. faultdescription
A. MustUnderstand
B. Server
C. Client
D. VersionMismatch
E. None of the above
Which of the following contains valid syntax for typing values?
A. <SOAP-ENC:int>36</SOAP-ENC:int>
B. <value xsi:type="xsd:int">36</value>
C. <value xsi:type="int">36</value>
D. All of the above
Which of the following are true for packaging an RPC request in a SOAP envelope?
A. The method call is represented as a single structure with each in or in-out parameter modeled as a field in that structure
B. The names and physical order of the parameters must correspond to the names and physical order of the parameters in the method being invoked
C. The SOAP RPC conventions require the use of the SOAP Section 5 encoding style
D. The SOAP RPC conventions require the xsi:type explicit data typing
Which of the following XML attributes defines exactly how native application and platform data types are to be encoded into a common XML syntax?
A. encoding
B. encodingType
C. encodingStyle
D. encodingFormat
Which of the following string types is recommended by SOAP specifications Section 5 for SOAP messages?
A. Base16
B. Base32
C. Base48
D. Base64
Which of following is the correct position of the header in a SOAP message?
A. Only before the body
B. Only after the body
C. Only before the envelope
D. Anywhere in the message
you have a single-dimensional array of five elements, and you want to transmit only the last two. Which of the following achieves this?
A. <names xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[3-5]">
B. <names xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[3]" SOAP-ENC:offset="[2]">
C. <names xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[5]" SOAP-ENC:offset="[2]">
D. <names xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[5][2]">
Which of the following child elements of a Fault element is used to express application-specific details about the error that occurred?
A. Details
B. Description
C. Detail
D. Comment
The duration datatype is used to specify a time interval in an XML Schema. Which of the following indicates the number of years in an element of type duration?
A. nY
B. cY
C. YearCount
D. Years
E. None of the above
Which of the following is a multi-referenced accessor?
A. <people><person><address><street>111 First Street</street><city>New York</city><state>New York</state></address></person></people>
B. <people><person name='joe smith'><address href='#address-1' </person><person name='john doe'><address href='#address-1' </person></people><address id='address-1'><street>111 First Street</street><city>New York</city><state>New York</state></address>
C. <people><person name='joe smith'><address><street>111 First Street</street><city>New York</city><state>New York</state></address></person></people>
D. None of the above
Which of the following protocols cannot be used to exchange SOAP messages?
A. HTTP
B. SMTP
C. POP3
D. MQSeries
E. Jabber
F. None of the above
. Read the following snippet:
...
<xs:element name="person">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
<xs:anyminOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
...
What does the 'any' tag do in the above code?
A. All child elements of the person element may have any type of value
B. The sequence of child elements of person may be in any order
C. Any number of elements can be added after the lastname element
D. None of the above
Which of the following header blocks has been introduced in SOAP version 1.2 to specify which headers were not understood?
A. Validate
B. MustUnderstand
C. Misunderstood
D. Upgrade
E. None of the above
Which of the following attributes manages an array in a SOAP message?
A. SOAP:array
B. SOAP-ENC:arrayType
C. SOAP-ENC:arrayElement
D. SOAP:arrayElement
Read the following statements:
Address address = new Address( );
Person person = new Person( );
person.setAddress(address);
The above code is creating two objects, one for the Address class and the other for the Person class. The Person class has a function called setAddress, which accepts objects of the Address class. How will you serialize this in SOAP?
A. <Person><Address href="#address1" /></Person><Address id="address1" />
B. <Person><Address/></Person><Address id="address1" />
C. <Person><Address href="#address1" /></Person><Address>address1</Address>
D. <Person><Address href="address1" /></Person><Address id="address1" />
Which of the following is correct regarding SOAP Faults?
A. They communicate information about errors that may have occurred during the processing of a SOAP message
B. They generate a fault during the processing of a SOAP message
C. They describe those faults which are not handled
D. None of the above
Read the following snippet:
<!-- Version 1.2 SOAP Envelope -->
<s:Envelopexmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<n:getQuotexmlns:n="urn:QuoteService">
<symbol xsi:type="xsd:string">IBM</symbol>
</n:getQuote>
</s:Body>
</s:Envelope>
What is the problem in the code?
A. The header is missing
B. The envelope namespace is incorrect
C. The symbol element is not allowed in a version 1.2 SOAP envelope
D. xsi:type is incorrect
Which of the following is an example of referring an external document through a SOAP envelope?
A. <person name='joe smith'><address href='http://acme.com/data.xml#joe_smith' /></person>
B. <person name='joe smith'><address extern='http://acme.com/data.xml#joe_smith' /></person>
C. <person name='joe smith'><address doc="d:\HR\person\address\joesmith.xml" /></person>
D. <person name='joe smith'><address extern="d:\HR\person\address\joesmith.xml" /></person>
Because of its pervasiveness on the Internet, HTTP is by far the most common transport used to exchange SOAP messages. Which of the following HTTP headers indicates the intent of the SOAP HTTP request?
A. SOAPCall
B. SOAPAction
C. SOAPMethod
D. SOAPMessage
Read the following code snippet of a SOAP message:
<s:Envelope
xmlns:s="http://www.w3.org/2001/06/soap-envelope">
<s:Body>
<n:getQuotexmlns:n="urn:QuoteService">
<symbol xsi:type="xsd:string">
Mistristic
</symbol>
</n:getQuote>
<s:Header>
<m:transactionxmlns:m="soap-transaction"
s:mustUnderstand="true">
<transactionID>1234</transactionID>
</m:transaction>
</s:Header>
</s:Envelope>
Identify the error in the code.
A. The namespace is incorrect
B. The body cannot contain a symbol element
C. The position of the Body element is wrong
D. mustUnderstand is not an attribute of the transaction element
Which of the following namespaces is used for messages in SOAP version 1.2?
A. http://schemas.xmlsoap.org/soap/envelope/
B. http://schemas.xmlsoap.org/soap-envelope
C. http://schemas.xmlsoap.org/2001/06/soap/envelope/
D. http://schemas.xmlsoap.org/2001/06/soap-envelope
Version 1.2 of the SOAP specifications introduced some new implementations. Which of the following implementations are new to the version 1.2 specifications?
A. SOAP::Lite for Perl
B. Apache SOAP Version 2.2
C. Apache Axis
D. None of the above
Read the following statements:
<s:Envelopexmlns:s="http://www.w3.org/2001/06/soap-envelope">
<s:Body>
<n:getQuotexmlns:n="urn:QuoteService" s:encodingStyle="http://www.w3.org/2001/06/soap/encoding">
<symbol xsi:type="xsd:string">IBM</symbol>
</n:getQuote>
</s:Body>
</s:Envelope>
Identify the problem in the code.
A. The envelope namespace is incorrect
B. The encodingStyle namespace is incorrect
C. The location of the symbol element is incorrect
D. The location of the encodingStyle is incorrect
E. None of the above
Read the following statement regarding arrays in SOAP:
Statement 1: A single-referenced accessor doesn't have an identity except as a child of its parent element.
Statement 2: A multi-referenced accessor uses id to give an identity to its value. Other accessors can use the src attribute to refer to their values.
A. Statement 1 is true but statement 2 is false
B. Statement 1 is false but statement 2 is true
C. Both statements are true
D. Both statements are false
Which of the following are mandatory in a message of SOAP version 1.1?
A. Envelope
B. Header
C. Body
D. None of the above
SOAP defines four standard types of faults that belong to the http://www.w3.org/2001/06/soap-envelope namespace. Which of the following is an incorrect Fault code?
A. VersionMismatch
B. MustUnderstand
C. InvalidMessage
D. Server
E. Client
F. None of the above
When applications report a version mismatch error back to the sender of the message, it may optionally include a header block that tells the sender which version of SOAP it supports. Which of the following is that header block?
A. Validate
B. Upgrade
C. Version
D. Verifier
One of the greatest strengths of XML Schemas is the support for datatypes. Which of the following namespaces is used while creating elements and datatypes that are used to construct schemas?
A. http://www.w3.org/2001/XMLSchema
B. http://www.w3.org/2001/schemaDataTypes
C. http://www.w3.org/XMLTypes
D. http://www.w3.org/XMLSchema
Which of the following are used for data representation in multiple-referenced accessors?
A. id
B. href
C. name
D. description
SOAP uses messages for client-server communication. Which of the following is correct for SOAP messages?
A. SOAP messages are hardware specific
B. SOAP messages are operating system specific
C. SOAP messages are programming language specific
D. None of the above
Which of the following header blocks authenticates the SOAP message?
A. AuthHeader
B. Authenticate
C. HeaderAuthentication
D. AuthenticateHeader
Which of the following are basic parts of the SOAP message architecture?
A. Envelope
B. Header
C. Body
D. Footer
E. All of the above
You have an element named 'comments'. You want to prohibit all line feeds, carriage returns, and tab characters. Which of the following will do it?
A. <xs:element name="comments" type="xs:String"/>
B. <xs:element name="comments" type="xs:normalizedString"/>
C. <xs:element name="comments" type="xs:TrimmedString"/>
D. <xs:element name="comments" type="xs:OnlyString"/>
Which of the following attributes indicates whether an accessor contains a null value?
A. xsi:nil
B. xsi:null
C. xsi:nilValue
D. xsi:nullValue
A. Statement 1 is true but statement 2 is false
B. Statement 2 is true but statement 1 is false
C. Both statements are true
D. Both statements are false
A SOAP message is an ordinary XML document but it follows some rules. Which of the following are correct regarding SOAP message architecture?
A. It requires an Envelope element that identifies the XML document as a SOAP message
B. It requires a Header element that contains header information
C. It requires an optional Body element that contains call and response information
D. It requires an optional Fault element that provides information about errors that occurred while processing the message
A. The types of information to be exchanged
B. How the information is to be expressed as XML
C. How to actually go about sending that information
D. None of the above
Which of the following represents a structure in SOAP messages?
A. <person><firstname>Joe</firstname><lastname>Smith</lastname></person>
B. <people><person name='joe smith'/><person name='john doe'/></people>
C. <people><person name='joe smith'><designation/></person><person name='john doe'><designation/></person></people>
D. None of the above
Which of the following can the header of a SOAP message contain?
A. Data that by default is intended for the final destination
B. Information to specify the contextual ID
C. Authentication information
D. All of the above
You are designing an XML Schema and you want to prohibit line feeds, carriage returns, tabs, leading and trailing spaces, and multiple spaces from an element. Which of the following datatypes will you use?
A. String
B. normalizedString
C. token
D. trimmedString