These Web Services multiple-choice questions and their answers will help you strengthen your grip on the subject of Web Services. You can prepare for an upcoming exam or job interview with these 80+ Web Services MCQs.
So scroll down and start answering.
A. System.Web.WebService
B. System.Web.Service
C. System.Web.Services.Service
D. System.Web.Services.WebService
E. None of the above
A. Deserizable
B. Compatible
C. Equals
D. CanDeserialize
E. None of the above
A. The hash is a nearly unique digest of the message
B. The hash is encrypted using the public key of the sender
C. The encrypted hash serves as a signature of the sender and is sent separately from the decrypted message
D. The hash is the opposite of the usual process used in encryption, in which the public key is used to encrypt, and the plain text is not sent
A. Windows form
B. Web form
C. Web service
D. All of the above
A. http://www.w3.org/2001/06/soap/soapEncoding
B. http://www.w3.org/2001/06/soap-encoding
C. http://www.w3.org/2001/06/soapEncoding
D. http://www.w3.org/2001/06/soap/soap-encoding
A. [RpcSoapMethod(
B. [RpcMethod(
C. [SoapRpcMethod(
D. [SoapRpcAction(
E. None of the above
A. WS-Routing enables the specification of a message's forward message path
B. WS-Routing does not support the specification of a reverse message path
C. WS-Routing provides the capability to give messages unique identifiers, and then specify the other messages to which they relate
D. All of the above
A. You will register the extension in the machine.config file
B. You will register the extension with the application's configuration file
C. You will pass method-specific information to the extension via the attribute
D. You will do all of the above
A. [XmlElement(Namespace:=
B. [XmlElement(ns=
C. [XmlElement(Namespace=
D. None of the above
A. WS-Inspection is a simple XML format for gathering together available services
B. WS-Inspection describes the service policy
C. WS-Inspection has the ability to link to UDDI registrations that give more information about a listed service
D. WS-Inspection documents have a root element with the local name WSInspection
E. All of the above
A. The types of information that are being exchanged
B. The way that information is to be expressed as XML
C. The way to actually send that information
D. None of the above
A. System.Web.Services.Protocols.SoapExtension
B. System.Web.Services.Protocols.SoapExtensions
C. System.Web.Services.SoapExtension
D. System.Web.Services.SoapExtensions
E. None of the above
Which of the following is correct with regard to the statements given below?
Statement 1: A logical name is a URI that necessarily represents the exact location to which a message is sent.
Statement 2: A logical name can have a very different location than the one implied by its logical name, or even multiple physical locations.
A.
Statement 1 is true but statement 2 is false Â
B.
Statement 1 is false but statement 2 is trueÂ
C.
Both the statements are true
D.
Both the statements are false
A. details
B. description
C. detail
D. comment
Refer to the statements given below and identify the incorrect element:
Invalid credentials
A.
s:Faults>
B.
C.
D.
None of the above
A. The IP address and other endpoint information
B. The response schema to expect if there is a response
C. Possible headers that may be expected in the request or response, and the schema for those
D. All of the above
A. Symmetric-Security
B. Symmetric-Algorithm
C. Symmetric-Encryption
D. None of the above
A. person>
B.
C.
D. None of the above
A. public String[] Street;[XmlArray(
B. [XmlArray(
C. public String[] Street; [XmlArrayName(
D. None of the above
Mike has built the following document literal web service client class by hand. This code contains an invalid syntax in one line. Identify this line.
1. [WebServiceBinding("MyBinding", "http://MyNS")]
2. public class CustomWebMethods : SoapHttpClientProtocol
3. {
4.   public CustomWebMethods()
5.   {
6.      this.Url = "http://localhost:8080";
7.   }
8.   [DocumentMethod("http://mySoapAction")]
9.   public int Add( int x, int y)
10.   {
11.      Object[] args = {x, y};
12.      Object[] responseMessage = this.Invoke( "Add", args );
13.      return ((int)(responseMessage[0]));
14.   }
15.}
A.
Line 1Â
B.
Line 2
C.
Line 8Â
D.
Line 12
E.
Line 13
F.
None of the above
A. Asynchronous pattern decreases the performance of your application
B. While using asynchronous pattern, you add two methods: StartYourMethod and EndYourMethod (where YourMethod is the actual name of your method)
C. The
D. Unless you have a compelling reason to do otherwise, always use the asynchronous pattern when you consume Web services in your production code
A. SoapRpcMethodsAttribute
B. SoapRpcServiceAttribute
C. SoapRpcServiceMethodsAttribute
D. SoapRpcService
E. None of the above
A. find_binding
B. find_business
C. find_service
D. find_Model
E. All of the above
A. Universal Description, Discovery, and Investigation
B. Universal Description, Discovery, and Integration
C. Universal Discovery, Definition , and Integration
D. None of the above
Which of the following is correct with regard to the statements given below?
Statement 1: RPC-encoded clients are very similar to document-encoded ones.
Statement 2: RPC-encoded clients need to set the Use property of the [SoapRpcMethod("http://mySoapAction")] attribute to indicate that this client is encoded, and not literal XML.
A.
Statement 1 is true but statement 2 is false
B.
Statement 1 is false but statement 2 is true
C.
Both the statements are true
D.
Both the statements are false
A. Description Information
B. Service Location
C. Service Schema
D. Service Classification
E. All of the above
Refer to the following statements and identify the lines that are invalid:
1. <%@ Service Class="TestClass" Language="C#" %>
2. using System;
3. using System.Web.Service;
4. public class TestClass {
5.  [WebMethod]
6.   public int Add( int a, int b)
7.   {
8.     return a+b;
9.   }
10. }
A.
line 1
B.
line 3
C.
line 4
D.
line 5
E.
All of the above
A. localhost.Service1.UserAgent = this.textBox1.Text;
B. localhost.Service1 s = new localhost.Service1(); s.UserAgent = this.textBox1.Text;
C. localhost.Service1.UserAgent ua = new localhost.Service1.UserAgent(); ua.value = this.textBox1.Text;
D. None of the above
A. XML Schema
B. SOAP Engine
C. XML Serialization
D. None of the above
A. WSDL forces a clean separation between data (as found in messages)
B. WSDL provides the abstract definition of a set of message-sending operations
C. WSDL provides the particular binding information needed to format and to send a message correctly
D. All of the above
Refer to the code given below and identify the line numbers that contain errors:
..
1. Inquire.Url = "http://uddi.rte.microsoft.com/inquire";
2. FindBusiness findBusiness = new FindBusiness();
3. findBusiness.Names.Add("Royal Airways");
4. BusinessList list = findBusiness.Find();
5. if (list.BusinessInfos.Count > 0)
6. {
7.    GetBusinessInfo gb = new GetBusinessInfo();
8.    gb.BusinessKeys.Add(bizList.BusinessInfos[0].BusinessKey);
9.    BusinessDetail bizDetail = gb.Send();
10.   if (bizDetail.BusinessEntities.Count > 0)
11.   {
12.      ...
13.   }
14.}
...
A.
2
B.
4
C.
5
D.
7
E.
10
F. None of the above
A. RECOVER
B. ROLLOVER
C. FEDERATION REPAIR
D. None of the above
A. The schema element can contain any number of top-level declarations
B. The XML schema language is based on the Worldwide Web Consortium (W3C)
C. The definitions in an XML schema are contained within the top-level schema element
D. The schema element in an XML schema document cannot use a namespace
A. WSBusinessEntity
B. BusinessClass
C. BusinessEntity
D. WSBusinessClass
E. None of the above
Refer to the following code of a SOAP message and identify the error:
xmlns:s="http://www.w3.org/2001/06/soap-envelope"> Mistristic s:mustUnderstand="true">
A.
The Namespace is incorrect Â
B.
The position of the header is incorrectÂ
C.
The body cannot contain a symbol elementÂ
D.
MustUnderstand is not an attribute of the transaction element
A. WSDLFormatter
B. WebServiceClientExtension
C. WSDLExtensionFormatter
D. ServiceDescriptionFormatter
E. None of the above
A. faultcode
B. faultstring
C. faultactor
D. faultdescription
State whether True or False:
When you serialize an array that is a member of a class, the result is a piece of structured XML that contains (a) a top element which is, by default, the name of the class member, and (b) any number of child elements, one for each value in the array.
A.
TrueÂ
B.
False
Which of the following is true with regard to .NET Web services?
Statement 1:.NET Web services use the XmlSerializer as the engine for sending and receiving SOAP messages.
Statement 2:.NET Web services are literal schema-based XML. They are not encoded XML.
A.
Statement 1 is true but statement 2 is false Â
B.
Statement 1 is false but statement 2 is trueÂ
C.
Both the statements are true
D.
Both the statements are false
A. person>
B.
C.
D. None of the above
A. Only before the body
B. Only after the body
C. Only before the envelope
D. Anywhere in the message
The following code has stored the data using the multiple-referenced accessor:
Which of the following is the correct way to solve the error in the code given above?
A.
* must be prefixed with href valueÂ
B.
* must be prefixed with id valueÂ
C.
# must be prefixed with href valueÂ
D.
# must be prefixed with id value
Refer to the following code, which is a part of an xml validation:
...
filename = "OrderDetails.xml";
FileStream stream = new FileStream( filename , FileMode.Open);
XmlValidatingReader reader = new XmlValidatingReader(stream);
...
Gavin is trying to open an xml which contains "order details" returned by a Web service, through this code, but an error is being generated in the code. Which of the following might be the cause of error?
A.
XmlValidatingReader is not a valid classÂ
B.
In the constructor of XmlValidatingReader, FileStream object is passed instead of XmlTextReader object
C.
In the constructor of XmlValidatingReader, FileStream object is passed instead of XmlReader object
D.
None of the above
A. The Namespace of the Serialized XML will be http://tempuri.org by default
B. Properties and Fields will remain in the same Namespace
C. Properties and Fields will be serialized as Elements
D. All of the above
A. System.web.Security.Encryption;
B. System.Cryptography;
C. System.Security.Cryptography;
D. None of the above
A. Encode the binary data as a string
B. Package the SOAP message into MIME
C. Package the SOAP message into DIME
D. All of the above
A. Inquire.Url =
B. Inquire.Url =
C. Inquire.Url =
D. None of the above
Which of the following is correct with regard to the statements given below?
Statement 1: A Web service is not a web site that a user reads.
Statement 2: A Web service is something another process or another machine uses.
A.
Statement 1 is true but statement 2 is false
B.
Statement 1 is false but statement 2 is true
C.
Both the statements are trueÂ
D.
Both the statements are false
A. public class Order { public System.Xml.XmlElement OrderDescription; public int Quantity; public String Name; }
B. public class Order { [XmlAnyAttribute] public System.Xml.XmlAttribute[] anyAttributes; public System.Xml.XmlElement OrderDescription; public int Quantity; public String Name; }
C. public class Order { [XmlAnyElement] public System.Xml.XmlElement[] extraElements; public System.Xml.XmlElement OrderDescription; public int Quantity; public String Name; }
D. All of the above
A. Only Classes with a Public Default Constructor will be serialized
B. Only Public Fields and Properties will be serialized
C. Read-Only Fields and Properties will not be serialized
D. Methods and Other Type Information will not be serialized
E. All of the above