MCSD.NET - 70-320 Exam Question:
Download Questions PDF

You are creating an XML Web service named ListBoxService. This service provides content,
such as states, countries, and geographical regions, for use in drop-down list boxes.
ListBoxService contains a Web method named RetrieveRegionsListBox. This method runs a
Dataset object that contains every geographical region in the world. RetrieveRegionsListBox calls
a Microsoft SQL Server database to load the Dataset object with region data. You want to
minimize the amount of time the method takes to return to the caller.
What should you do?
A. Use a stored procedure to return the datas.
B. Store each Dataset object by using the Session object.
C. Set the Buffer Response property of the Web Method attribute to false.
D. Set the Cache Duration property of the Web Method attribute to an interval greater than zero.

Answer:

D. Set the Cache Duration property of the Web Method attribute to an interval greater than zero.

Download MCSD.NET - 70-320 Exam Interview Questions And Answers PDF

Previous QuestionNext Question
Suppose You are creating an ASP.NET application named CompanyWebApp. To CompanyWebApp, you
add a Web reference to an XML Web service named User Service. User Service consists of a
Web method named RetrieveUserInfo. This Web method takes a userID as input and returns a
DataSet object containing user information. If the userID is not between the values 1 and 1000, a
System Argument Exception is thrown. In CompanyWebApp, you write a try/catch block to
capture any exceptions that are thrown by User Service. You invoke RetrieveUserInfo and pass
1001 as the user ID.
Which type of exception will be caught?
A. System.ApplicationException
B. System.ArgumentException
C. System.Web.Service.Protocols.SoapException
D. System.Web.Service.Protocols.SoapHeaderException
Suppose Company Ltd. receives product information from manufactures in the form of an XML documents.
The product information is stored in a Microsoft SQL Server database. The format of each XML
document varies. Each one is located in a MemoryStream object named newProds. You create a
merge procedure that reads data and schema information in a Dataset object and merges the
information into your database. You now need to write code to transfer the XML document and its
schema into a Dataset object.
Which code segment should you use?
A. Dataset products = new Dataset("prodInfo");
XmlTextReader reader = new XmlTextReader(newProds);
XmlValidatingReader validReader = new
XmlValidatingReader(reader);
while (validReader.Read()) { products.WriteXml(validReader.Value);}
B. Dataset products = new Dataset("prodInfo");
products.ReadXml(newProds);
C. Dataset products = new Dataset("prodInfo");
XmlDataDocument document = new XmlDataDocument(products);
D. document.DataSet.ReadXmlSchema(newProds);
Dataset products = new Dataset("prodInfo");
string myXmlData = Encoding.UTF8.GetString(newProds.ToArrary());
SqlDataAdapter adapter = new SqlDataAdapter("LoadSchemaType=XML",myXmlData);
adapter.
Fill(products)