Review Questions

1. 

Which item is a message-based protocol that enables applications to call each other’s methods over the Internet or other network?

  1. HTTP

  2. UDDI

  3. XML

  4. SOAP

dsimple 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. 

When creating an XML Web service application in the .NET Framework, what filename extension is used for your main source code pages?

  1. .aspx

  2. .wsdl

  3. .asmx

  4. .disco

cwhen 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. 

When creating an XML Web service class, which one of the .NET Framework system classes do you need to inherit from?

  1. System.Web.Services.WebServices

  2. System.Web.Protocols.SoapMessage

  3. System.WebServices

  4. System.Web.Services.WebServiceAttribute

athe system.web.services namespace contains the webservices class, which is the base class for all xml web services.

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?

  1. SoapDocumentMethod

  2. SoapRpcMethod

  3. SoapHeader

  4. SoapExtension

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. 

What does a WSDL document contain?

  1. The source code for your Web service

  2. A list of directories on your web server that contain XML Web services applications

  3. A description of your Web service’s methods, parameters, and return values

  4. An HTML page so that users can test your web service

cthe 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. 

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?

  1. By reading the WSDL file.

  2. From documentation provided by the owner of the XML Web service.

  3. When you add a web reference to your Visual Studio .NET project, a proxy class is added to your project.

  4. By adding a reference to System.Web.Services.

cvisual 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. 

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?

  1. Add a method to the proxy class called GetCustomerIDAsync.

  2. Add a method to the your application code called BeginGetCustomerID.

  3. Call the method GetCustomerIDAsync from the proxy class.

  4. Call the method BeginGetCustomerID from the proxy class.

dwhen 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. 

What is the purpose of using a SOAP extension?

  1. To add custom fields to the Body section of the SOAP message

  2. To perform custom processing each time a SOAP message is sent or received

  3. To enable SOAP messages to be read by operating systems other than Windows

  4. To enable SOAP messages to be read by programs written in languages other than Visual Basic .NET

bsoap 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. 

What is the purpose of an XSD document?

  1. It contains a description for an exact format of XML markup that an application requires.

  2. It contains a list of directories on your web server that contain XML Web services applications.

  3. It contains a description of your web service’s methods, parameters, and return values.

  4. It is an HTML page so that users can test your web service.

aan 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. 

What is the purpose of UDDI?

  1. To provide a searchable, centralized registry of available XML Web services.

  2. To provide a list of directories on your web server that contain XML Web services applications.

  3. To describe a web service’s methods, parameters, and return values.

  4. It is an Internet network protocol.

auniversal 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. 

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?

  1. You will receive a compilation error when you try to build your project.

  2. You will receive an HTTP error when you try to test your web service.

  3. Users of your web service will receive an unhandled exception if they try to call that method.

  4. That method will not be visible to users of your web service.

dany 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. 

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?

  1. No, it is required that all XML Web services use this namespace.

  2. Yes, you should change it to an identifier that is unique to your own organization.

  3. Yes, you should change it to the URL where you will be deploying the XML Web service.

  4. Yes, you should change it to a new domain name that is registered strictly for that XML Web service.

bthe 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. 

You want to add custom SOAP headers to your XML Web services project. Which of these code segments is correct?

  1. A.

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 Class
C.
Public Class myCustomHeader     Inherits SoapExtension     Public userID As String     Public userName As String End Class
D.
Public Class myCustomHeader     Inherits WebService     Public userID As SoapHeader     Public userName As SoapHeader End Class 

adefine 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. 

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?

  1. Initialize

  2. ProcessMessage

  3. InputMessage

  4. OutputMessage

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. 

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?

  1. After rebuilding your XML Web service project, add the new methods to the proxy class in your client project.

  2. After rebuilding your XML Web service project, delete the existing Web reference in the client project and then add a new Web reference to regenerate the proxy class to match the updated web service.

  3. After rebuilding your XML Web service project, stop and restart the web server.

  4. After rebuilding your XML Web service project, you will have to create a new test client project. The old one will no longer work.

bafter 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.

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.



MCAD/MCSD(c) Visual Basic. NET XML Web Services and Server Components Study Guide
MCAD/MCSD: Visual Basic .NET XML Web Services and Server Components Study Guide
ISBN: 0782141935
EAN: 2147483647
Year: 2005
Pages: 153

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net