Limited Time Discount Offer
30% Off - Ends in 02:00:00

X

Microsoft 70-310 Dumps

Microsoft
XML Web Services and Server Components with Visual Basic.NET
Microsoft
XML Web Services and Server Components with Visual Basic.NET

Questions & Answers for Microsoft 70-310

Showing 1-15 of 90 Questions

Question #1 - Topic 0

You are developing a Windows-based application that requires the use of a calculation
function named CalculateValue. This function includes the following signature:
CalculateValue(x As Integer) As Integer
CalculateValue is located in an unmanaged DLL named UsefulFunctions.dll, and is not part
of a COM interface. You need to be able to use CalculateValue in your application.
Which action or actions should you take? (Choose all that apply.)

A. Use Regsvr32.exe to register UsefulFunctions.dll.

B. Use Visual Studio .NET to add a reference to UsefulFunctions.dll.

C. To your application, add the following code segment: Imports UsefulFunctions

D. To your application, add the following code segment: Declare Function CalculateValue _ Lib "UsefulFunctions.dll" (x As Integer) As Integer

Question #2 - Topic 0

You create an XML Web service named PhoneService that returns telephone information
to its customers. You configure the Web.config file and Internet Information Services (IIS)
to use Basic authentication to authenticate calls to the Web service.
You are now creating a Windows-based application named MyWinApp to test
PhoneService. To MyWinApp, you add a Web reference to PhoneService. You add a
Windows Form named Form1 to MyWinApp.
You write the following code segment in the Form1_Load event. (Line numbers are
included for reference only.)
01 Dim phoneService As New MyService.PhoneService()
02 Dim phoneNumber As String
03 ' Insert new code beginning here.
04 phoneNumber = phoneService.GetPhoneNumber("Alex")
You run MyWinApp. However, when line 04 executes, an exception is thrown indicating
that access is denied. You need to add code beginning on line 03 to ensure that MyWinApp
runs without exceptions.
Which code segment should you use?

A. Dim credCache As New CredentialCache() phoneService.Credentials = credCache

B. Dim credCache As New CredentialCache() credCache.Add(New Uri(phoneService.Url), "Basic", New _ NetworkCredential(myUser, userPassword)) phoneService.Credentials = credCache

C. Dim credCache As New CredentialCache() Dim creds As New NetworkCredential() credCache.Add(New Uri(phoneService.Url), userPassword, _ creds) phoneService.Credentials = creds

D. Dim credCache As New CredentialCache() Dim creds As New NetworkCredential() credCache.Add(New Uri(phoneService.Url), "Basic", creds) phoneService.Credentials = credCache

Question #3 - Topic 0

You are using Visual Studio .NET to develop an application. You have a common business
logic component that was created in COM that you want to use until you can replace it with
Visual Studio .NET code.
You create the Visual Studio .NET solution for the new application.
You want to use the COM component in your Visual Studio. NET solution.
What should you do?

A. Register the COM component by using Regsvr32.exe.

B. Run the Type Library Exporter (Tlbexp.exe) and pass the COM component as the filename parameter.

C. Use Visual Studio .NET to add a reference to the COM component.

D. Run the Assembly Registration tool (Regasm.exe) and pass the COM component as the filename parameter.

Question #4 - Topic 0

You are creating an XML Web service named FlightService that provides flight information
to its users. To retrieve flight information, a user first must be authenticated by
FlightService. Once authenticated, a key that identifies that user is returned to the caller.
This key then will be presented in the SOAP header on all subsequent flight information
requests to validate that user.
You need to construct FlightService so that it can receive the key in a SOAP header. First,
you add a class to FlightService by writing the following code segment:
Public Class UserKeyHeader
Inherits SoapHeader
Public key As String
End Class
Next, you add a Web method to FlightService by writing the following code segment:
Public keyHeader As UserKeyHeader
<WebMethod(), SoapHeader()> _
Public Function RetrieveFlightInformation() As DataSet
' Code to check SOAP header goes here.
' Code to retrieve flight information goes here.
End Function
You attempt to build FlightService, and discover that it does not compile. You need
FlightService to compile. What should you do?

A. Change the declaration of the keyHeader variable from public to private.

B. Set the memberName parameter of the SoapHeader attribute to "keyHeader".

C. Set the Direction property of the SoapHeader attribute to SoapHeaderDirection.In.

D. Set the Direction property of the SoapHeader attribute to SoapHeaderDirection.Out.

Question #5 - Topic 0

You are creating an XML Web service named HousingService that exposes two Web
methods name SearchHouses and BuyHouses. Prior to deploying the service, you want to
customize the default template that is displayed when a customer makes a request through
the browser. You create a Web Form named HousingServiceDescription.aspx that is a
customized version of the default template. You place the Web Form in the bin directory of
the HousingService project. The Web Form needs to override the default template when a
request is made. You need to ensure that customers who request HousingService through
a browser view HousingServiceDescription.aspx. What should you do?

A. Create a SOAP extension to redirect the user to HousingServiceDescription.aspx.

B. Set the Namespace property of the WebService attribute to the location of HousingServiceDescription.aspx.

C. In the Web.config file, enable tracing and set the TraceMode node to bin\HousingServiceDescription.aspx.

D. In the Web.config file, set the HRef property of the wsdlHelpGenerator node to bin\HousingServiceDescription.aspx.

Question #6 - Topic 0

You are creating an XML Web service that will consist of a class named Stock. Stock will
expose the following public fields: Symbol, CompanyName, and CurrentPrice.
When serialized by the XMLSerializer, Stock will take the following form:
<Stock symbol=''>
<Company />
<CurrentPrice />
</Stock>
You need to construct the Stock class. Which code segment should you use?

A. Public Class Stock <XmlElementAttribute("symbol")> _ Public Symbol As String <XmlElementAttribute()> _ Public CompanyName As String Public CurrentPrice As Double End Class

B. Public Class Stock Public Symbol As String <XmlElementAttribute("Company")> _ Public CompanyName As String Public CurrentPrice As Double End Class

C. Public Class Stock <XmlAttributeAttribute("symbol")> _ Public Symbol As String <XmlElementAttribute("Company")> _ Public CompanyName As String Public CurrentPrice As Double End Class

D. Public Class Stock <XmlAttributeAttribute()> _ Public Symbol As String <XmlElementAttribute()> _ Public CompanyName As String <XmlElementAttribute()> _ Public CurrentPrice As Double End Class

Question #7 - Topic 0

You are creating a Visual Studio .NET assembly, which will run as a shared assembly with
other applications. The assembly will be installed in the global assembly cache. You will
distribute the assembly to many customers outside your company. You must ensure that
each customer receives your assembly without alteration, in a way that reliably specifies
the origin of the code. What should you do?

A. Sign the assembly by using a strong name. Do nothing further.

B. Sign the assembly by using File Signing tool (Signcode.exe). Do nothing further.

C. First sign the assembly by using a strong name. Then sign the assembly by using File Signing tool (Signcode.exe).

D. First sign the assembly by using File Signing tool (Signcode.exe). Then sign the assembly by using a strong name.

Question #8 - Topic 0

You are creating data access components for an XML Web service that retrieves data from
a Microsoft SQL Server database. The components use the SqlClient data provider.
You estimate that an average of 10 users will use the service concurrently. Therefore, you
want to maintain at least 15 database connections at all times.
What should you do?

A. Set the Packet Size property of the connectionString to 15.

B. Set the Max Pool Size property of the connectionString to 15.

C. Set the Min Pool Size property of the connectionString to 15.

D. Set the Connection Lifetime property of the connectionString to 15.

Question #9 - Topic 0

Your company receives product information from manufacturers in the form of 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. Dim products As New DataSet("prodInfo") Dim reader As New XmlTextReader(newProds) Dim validReader As New XmlValidatingReader(reader) While validReader.Read() products.WriteXml(validReader.Value) End While

B. Dim products As New DataSet("prodInfo") products.ReadXml(newProds)

C. Dim products As New DataSet("prodInfo") Dim document As New XmlDataDocument(products) document.DataSet.ReadXmlSchema(newProds)

D. Dim products As New DataSet("prodInfo") Dim myXmlData As String = _ Encoding.UTF8.GetString(newProds.ToArray()) Dim adapter As New SqlDataAdapter _ ("LoadSchemaType=XML",myXmlData) adapter.Fill(products)

Question #10 - Topic 0

You are creating an XML Web service named myWebService. Callers must be
authenticated by using credentials passed in the SOAP header of each Web service call.
You want to use role-based security to secure each method on myWebService. The roles
that users are assigned are stored in a custom database table. You need to write code that
will allow you to dynamically change which roles can execute specific methods at run time.
What should you do?

A. Create a WindowsIdentity object and a WindowsPrincipal object. Then implement declarative role-based security.

B. Create a WindowsIdentity object and a WindowsPrincipal object. Then implement imperative role-based security.

C. Create a GenericIdentity object and a GenericPrincipal object. Then implement declarative role-based security.

D. Create a GenericIdentity object and a GenericPrincipal object. Then implement imperative role-based security.

Question #11 - Topic 0

You create a serviced component named Scheduler. Scheduler is registered in a library
application. The Scheduler methods parse String objects into DateTime objects. You write
a console application named Coverage.exe to test each method in Scheduler. You want
Coverage.exe to test Scheduler for multiple cultures to verify its globalization support. What
should you do?

A. Create a CultureInfo object for each culture locale before calling the Scheduler methods.

B. Create a RegionInfo object for each culture locale before calling the Scheduler methods.

C. Set the current thread's CurrentCulture property to each culture locale before calling the Scheduler methods.

D. Create a Coverage.exe.config file and add a <location> element to the configuration file for each culture locale.

Question #12 - Topic 0

You have a SqlDataReader object named ordersDataReader. This object contains a
column named OrderQuantity as an integer value. This object also contains one row for
each order received during the previous week. You need to write code that will process
each row in ordersDataReader and pass OrderQuantity to a function named myFunction.
Which code segment should you use?

A. While ordersDataReader.Read Call myFunction(ordersDataReader("OrderQuantity")) End While

B. While ordersDataReader.NextResult Call myFunction(ordersDataReader("OrderQuantity")) End While

C. Dim orderCount as Integer While orderCount < ordersDataReader.FieldCount Call myFunction(ordersDataReader("OrderQuantity")) orderCount += 1 ordersDataReader.Read End While

D. Dim orderCount as Integer While orderCount < ordersDataReader.FieldCount Call myFunction(ordersDataReader("OrderQuantity")) orderCount += 1 ordersDataReader.NextResult End While

Question #13 - Topic 0

You are creating a data access component for an XML Web service. You need to populate
and process a DataSet object with data from a table named Customers in a Microsoft SQL
Server database.
You write the following code segment:
Dim myConnection As New _
SqlConnection(myConnectionString)
Dim myDataAdapter As New SqlDataAdapter _
("SELECT * FROM Customers", myConnection)
Dim myDataSet As New DataSet()
Dim customerName as String
You want to capture all SQL Server errors and general exceptions that occur. You want to
process SQL Server errors separate from general exceptions.
Which code segment should you use?

A. Try myDataAdapter.Fill(myDataSet, "Customers") customerName = myDataSet.Tables(0)._ Rows(0).Item("CustomerName") Catch mySqlException As SqlException Throw New SqlException("Sql exception occurred") Catch myException As Exception ' Code to process general exceptions goes here. End Try

B. Try myDataAdapter.Fill(myDataSet, "Customers") customerName = myDataSet.Tables(0)._ Rows(0).Item("CustomerName") Catch mySqlException As SqlException For Each mySqlException In mySqlException.Errors ' Code to process SQL Server errors goes here. Next Catch myException As Exception ' Code to process general exceptions goes here. End Try

C. Try myDataAdapter.Fill(myDataSet, "Customers") customerName = myDataSet.Tables(0)._ Rows(0).Item("CustomerName") Catch mySqlException As SqlException Dim mySqlError As SqlError For Each mySqlError In mySqlException.Errors ' Code to process SQL Server errors goes here. Next Catch myException As Exception ' Code to process general exceptions goes here. End Try

D. Try myDataAdapter.Fill(myDataSet, "Customers") customerName = myDataSet.Tables(0)._ Rows(0).Item("CustomerName") Catch myException As Exception Throw New Exception("General exception occurred") Catch mySqlException As SqlException Dim mySqlError As SqlError For Each mySqlError In mySqlException.Errors ' Code to process SQL Server errors goes here. Next End Try

Question #14 - Topic 0

You create a .NET Remoting object named MyRemoteObject in an XML Web service
named MyWebService. All method calls made on MyRemoteObject are routed to a single
instance of this object. The state of MyRemoteObject must be maintained between method
calls. You need to register MyRemoteObject as a well-known object provided by
MyWebService. You want to accomplish this goal by adding code to the Web.config file of
MyWebService. Which code segment should you use?

A. <wellknown mode="Singleton" type="MyRemoteObject, MyWebService" objectUri="MyWebService.rem" />

B. <wellknown mode="Singleton" type="MyWebService.MyRemoteObject, MyWebService" objectUri="MyRemoteObject.rem" />

C. <wellknown mode="SingleCall" type="MyRemoteObject, MyWebService" objectUri="MyWebService.rem" />

D. <wellknown mode="SingleCall" type="MyWebService.MyRemoteObject, MyWebService" objectUri="MyRemoteObject.rem" />

Question #15 - Topic 0

You have a .NET Remoting object named Scheduler. The Scheduler class is in an
assembly file named TaskScheduler.dll.
The Scheduler class is hosted by an application named SchedulerServer.exe. This
application is configured by using a file named SchedulerServer.exe.config. This file
configures the Scheduler class to be a client-activated object by using a TcpChannel and a
BinaryFormatter.
You want to deploy the Scheduler object to a computer named Computer1 so that client
applications can begin to use it.
You copy TaskScheduler.dll, SchedulerServer.exe, and SchedulerServer.exe.config to a
directory on Computer1.
What should you do next?

A. Install TaskScheduler.dll in the global assembly cache.

B. Use the Assembly Registration tool (Regasm.exe) on Computer1 to register SchedulerServer.exe.

C. Use the Assembly Registration tool (Regasm.exe) on Computer1 to register TaskScheduler.dll.

D. Configure Computer1 to execute SchedulerServer.exe each time Computer1 is restarted. Then manually execute SchedulerServer.exe on Computer1.

×