1. | Which item is a message-based protocol that enables applications to call each other’s methods over the Internet or other network?
|
|
2. | When creating an XML Web service application in the .NET Framework, what filename extension is used for your main source code pages?
|
|
3. | When creating an XML Web service class, which one of the .NET Framework system classes do you need to inherit from?
|
|
4. | When you need to specify the exact format for the way that the XML tags in a SOAP message are created, which attribute should you add to your Web methods?
|
|
5. | What does a WSDL document contain?
|
|
6. | When using Visual Studio .NET to create a client application that calls an XML Web service, how do you get information at design time about the web service’s interface?
|
|
7. | You are creating a web services client application. You want to make an asynchronous call on a Web method called GetCustomerID. What should you do?
|
|
8. | What is the purpose of using a SOAP extension?
|
|
9. | What is the purpose of an XSD document?
|
|
10. | What is the purpose of UDDI?
|
|
11. | You are creating the source code for an XML Web service. What will be the result if you do not mark some of the procedures in your code with the WebMethod attribute?
|
|
12. | When Visual Studio .NET creates a new ASP.NET Web services project from the template, it assigns a default namespace URI of http://tempuri.org/. Should you change this value?
|
|
13. | You want to add custom SOAP headers to your XML Web services project. Which of these code segments is correct?
Public Class myCustomHeader Inherits SoapHeader Public userID As String Public userName As String End Class B. Private Class myCustomHeader Inherits SoapHeader Private userID As String Private userName As String End ClassC. Public Class myCustomHeader Inherits SoapExtension Public userID As String Public userName As String End ClassD. Public Class myCustomHeader Inherits WebService Public userID As SoapHeader Public userName As SoapHeader End Class |
|
14. | When you are creating a SOAP extension, your code must override certain methods of the base SoapExtension class. Which of these is the method where the main functionality of the extension is carried out?
|
|
15. | You have developed an XML Web services application and you have created a client project for testing the web service. Since you first created the test client, you have added new methods to the web service, but you cannot access the new methods from your test client. How can you most easily solve this problem?
|
|
Answers
1. | D Simple Object Access Protocol (SOAP) is a message-based means for applications to communicate over the Internet or a network. HTTP is a lower-level protocol that can send text and other data types over the Internet. XML is a markup language that describes data. UDDI is a registry system for XML Web services. |
2. | C When working with ASP.NET-based XML Web services, .asmx is the filename extension used for your source code pages. The extension .aspx is used for standard ASP.NET pages. The .wsdl and .disco files contain XML documents that provide discovery and Web Services Description Language information. |
3. | A The System.Web.Services namespace contains the WebServices class, which is the base class for all XML Web services. |
4. | A SoapDocumentMethod specifies that the XML tags should be created in the exact format specified by the XSD Schema information that is in a Web service’s WSDL document. SoapRpcMethod follows the generic encoding rules from the SOAP specification. The SoapHeader and SoapExtension attributes are not directly related to encoding format. |
5. | C The WSDL file contains a complete description of your web service, including all the available methods, the name and data type of all parameters, and return values. Source code for a web service is in an .asmx file. If you wish to provide a list of searchable directories on your server, you use a .disco or .vsdisco file. An HTML page is not required for web services. Visual Studio .NET provides a default test page that works with all web services. |
6. | C Visual Studio .NET makes it easy to create web service clients, because it can use the WSDL information to generate a proxy class. After the proxy class is added to your project, you can take advantage of Intellisense in Visual Studio .NET. Although it is possible to read the WSDL document, and some web service creators might provide documentation, the proxy class is the easiest and most direct way to interact with the web service. A client application does not need to reference System.Web.Services. |
7. | D When Visual Studio .NET generates the proxy class, the Beginmethodname and Endmethodname methods (to be used for asynchronous calls) are automatically created for each method exposed by the web service. All you need to do is call BeginGetCustomerID (and later EndGetCustomerID) from the proxy class. You do not need to add any methods manually. There is no method with the name GetCustomerIDAsync automatically defined. |
8. | B SOAP extensions enable you to include custom processing on the client, server, or both, each time a SOAP message is sent or received. SOAP headers enable you to add items to the message itself. SOAP is a nonproprietary standard that uses XML and text files; these can be read by any operating system or programming language. |
9. | A An XSD Schema document contains a description for an exact format of XML markup. Visual Studio .NET includes XSD information in the WSDL documents that describe a web service interface. XSD Schema can be used for processing all types of XML documents, however—not just in relation to XML Web services. If you wish to provide a list of searchable directories on your server, you use a .disco or .vsdisco file. An HTML page is not required for web services. Visual Studio .NET provides a default test page that works with all web services. |
10. | A Universal Description, Discovery, and Integration (UDDI) is a system for establishing searchable, central registries of available XML Web services. If you wish to provide a list of searchable directories on your server, you use a .disco or .vsdisco file. An individual web service’s methods, parameters, and return values are described in a WSDL file. HTTP is the primary Internet protocol used by XML Web services. |
11. | D Any methods that are not marked with the WebMethod attribute will not be a part of the public interface of the web service; therefore, users will not be able to call the methods. They are considered private methods and can be called from other code inside the web service. This is valid code and should not, by itself, cause any errors to occur. |
12. | B The default namespace should be set to an identifier that uniquely identifies the organization publishing the XML Web service. Conventionally an organization’s Internet domain name is used, but the value can be any unique string; it does not need to be a valid URL. It is not necessary to register a domain name for an individual XML Web service. |
13. | A Define custom SOAP headers by adding a public class to your XML Web service project. This class must inherit from System.Web.Services.Protocols.SoapHeader and must include public variables to hold the data items for the custom headers. |
14. | B ProcessMessage is the name of the SoapExtension class method where the main processing is carried out. Initialize is also a valid method, used to read in any necessary initialization data. InputMessage and OutputMessage are not methods defined by the base class. |
15. | B After making changes to the web service, you must drop the existing Web reference and create a new one so a proxy class can be generated that matches the current version of the web service. This is all that is necessary to update the client project. The first option is feasible, but you should avoid adding code to the proxy class manually. ASP.NET does not require you to stop and restart the server to update applications. |