UPGRADE:MCSD MS.NET Skills
Index >> Microsoft >> MCTS >> "70-554"Exam
VUE/Prometric Code:70-554
| UPGRADE:MCSD MS.NET Skills | |||
| Test | Q&A | Updated | Price |
| 70-554 | 116 Q&A | 2008-12-01 | $ 79 |
please download in PDF format Demo:
killtest 70-554 Exam Features
High quality and Value for the 70-554 Exam.
Killtest Practice Exams for UPGRADE:MCSD MS.NET Skills 70-554 are written to the highest standards of technical accuracy, using only certified subject matter experts and published authors for development.
100% Guarantee to Pass Your MCTS exam and get your MCTS Certification.
We guarantee your success in the first attempt. If you do not pass the 70-554 (UPGRADE:MCSD MS.NET Skills) on your first attempt we will give you a FULL REFUND of your purchasing fee AND send you another same value product for free.
killtest 70-554 Downloadable.
Printable Exams (in PDF format) Our Exam 70-554 Preparation Material provides you everything you will need to take your MCTS exam. The MCTS Certification details are researched and produced by Professional Certification Experts who are constantly using industry experience to produce precise, and logical. You may get MCTS exam questions from different web sites or books, but logic is the key. Our Product will help you not only pass in the first MCTS exam try, but also save your valuable time .
- Comprehensive questions with complete details about 70-554 exam.
- 70-554 exam questions accompanied by exhibits.
- Verified Answers Researched by Industry Experts and almost 100% correct.
- Drag and Drop questions as experienced in the Real MCTS exam.
- 70-554 exam questions updated on regular basis.
- Like actual MCTS Certification exams, 70-554 exam preparation is in multiple-choice questions (MCQs).
- Tested by many real MCTS exams before publishing.
- Try free MCTS exam demo before you decide to buy it in http://www.Killtest.com.
High quality and Value for the 70-554 Exam:100% Guarantee to Pass Your MCTS exam and get your MCTS Certification.
http://www.Killtest.com The safer.easier way to get MCTS Certification.
We offer Demo version of Q&A, Q&A are as follows (not to provide picture):
70-554:please download 70-554 in PDF format Demo 
1. You are creating a Web service.
You need to add an operation that can be called without returning a message to the caller.
Which code should you use?
A. [WebMethod]
[SoapDocumentMethod(OneWay = true)]
public bool ProcessName(string name) {
return false;
}
B. [WebMethod]
[OneWay()]
public void ProcessName(string name) {
}
C. [WebMethod]
[SoapDocumentMethod(OneWay = true)]
public void ProcessName(string name) {
}
D. [WebMethod]
[SoapDocumentMethod(Action = "OneWay")]
public void ProcessName(string name) {
}
Answer: C
2. You are creating a Web service.
You need to add an operation that can be called without returning a message to the caller.
Which code should you use?
A. <WebMethod()> _
<SoapDocumentMethod(OneWay:=True)> _
Public Function ProcessName(ByVal Name As String) As Boolean
...
Return False
End Function
B. <WebMethod()> _
<OneWay()> _
Public Sub ProcessName()
...
End Sub
C. <WebMethod()> _
<SoapDocumentMethod(OneWay:=True)> _
Public Sub ProcessName()
...
End Sub
D. <WebMethod()> _
<SoapDocumentMethod(Action:="OneWay")> _
Public Sub ProcessName()
...
End Sub
Answer: C
3. You are an enterprise application developer. You are creating a component that will be deployed as part of a
class library. The component must meet the following specifications:
The interface of the component must be accessible to components outside the hosting assembly.
The interface of the component must be interoperable with components written in any other .NET Framework languages.
The implementation of the component cannot be expanded upon by a derived class.
You need to design the interface of the component.
Which three tasks should you perform? (Each correct answer presents part of the solution. Choose three.)
A. Apply the CLSCompliant(true) attribute to the assembly and component definition.
B. Apply the abstract keyword to the component definition.
C. Apply the ComVisible(true) attribute to the assembly and component definition.
D. Create a primary interop assembly for the assembly that hosts your component.
E. Apply the sealed keyword to the component definition.
F. Apply the public keyword to the component definition.
Answer: A AND E AND F
4. You are an enterprise application developer. You are creating a component that will be deployed as part of a class library. The component must meet the following specifications:
The interface of the component must be accessible to components outside the hosting assembly.
The interface of the component must be interoperable with components written in any other .NET Framework languages.
The implementation of the component cannot be expanded upon by a derived class.
You need to design the interface of the component.
Which three tasks should you perform? (Each correct answer presents part of the solution. Choose three.)
A. Apply the CLSCompliant(True) attribute to the assembly and component definition.
B. Apply the MustInherit keyword to the component definition.
C. Apply the ComVisible(True) attribute to the assembly and component definition.
D. Create a primary interop assembly for the assembly that hosts your component.
E. Apply the NotInheritable keyword to the component definition.
F. Apply the Public keyword to the component definition.
Answer: A AND E AND F
5. You are an enterprise application developer. You are creating a component that processes loan requests. Your component will be used inside Microsoft Windows Forms client applications.
The loan request form is complex and time consuming to complete. Loan data is saved to a Microsoft SQL Server 2005 database.
You need to ensure that in case of a system failure the loan officer does not need to re-enter any loandata.
What should you do?
A. Implement a private Save method that saves all property values to the database. Call the Save method from inside your components finalizer.
B. Implement code inside the Set accessor for each property that saves the property value to the database.
C. Implement a public Save method that saves all property values to a static variable.
D. Implement code inside the Set accessor that saves the property value to a static variable.
Answer: B
6. You are an enterprise application developer. You are creating a component that processes loan requests. Your component will be used inside Microsoft Windows Forms client applications.
The loan request form is complex and time consuming to complete. Loan data is saved to a Microsoft SQL Server 2005 database.
You need to ensure that in case of a system failure the loan officer does not need to re-enter any loan data. What should you do?
A. Implement a Private Save method that saves all Property values to the database. Call the Save method from inside your components finalizer.
B. Implement code inside the Set accessor for each Property that saves the Property value to the database.
C. Implement a Public Save method that saves all Property values to a Shared variable.
D. Implement code inside the Set accessor that saves the Property value to a Shared variable.
Answer: B
7. You are an enterprise application developer. You are creating a component to process geospatial data. The
component retrieves large sets of data from a Microsoft SQL Server database. Each data point consists of two decimal values: one value represents longitude and the other value represents latitude.
You need to design a data format that minimizes the managed heap memory allocation needed for each data point within the component.
What should you do?
A. Design a custom class that contains private fields for the longitude and the latitude, and design read-only public properties for the longitude and the latitude.
B. Design an XML element that contains an attribute for each longitude value and each latitude value.
C. Design an ADO.NET DataRow class that contains DataColumns for the longitude and latitude values.
D. Design a custom Struct that contains a public field for the longitude value and a public field for the latitude value.
Answer: D
8. You are an enterprise application developer. You are creating a component to process geospatial data. The component retrieves large sets of data from a Microsoft SQL Server database. Each data point consists of two decimal values: one value represents longitude and the other value represents latitude.
You need to design a data format that minimizes the managed heap memory allocation needed for each data point within the component.
What should you do?
A. Design a custom class that contains Private fields for the longitude and the latitude, and design read-only Public properties for the longitude and the latitude.
B. Design an XML element that contains an attribute for each longitude value and each latitude value.
C. Design an ADO.NET DataRow class that contains DataColumns for the longitude and latitude values.
D. Design a custom Structure that contains a Public field for the longitude value and a Public field for the latitude value.
Answer: D
9. When you execute a client application, the following exception is thrown.
EncryptedKeyToken is expected but not present in the security
header of the incoming message.
You discover that the exception is thrown when the client application invokes a Web service named Math with the following code. (Line numbers are included for reference only.)
01 try
02 {
03 MathWse ws = new MathWse ();
04 int result = ws.Add(1, 2);
05 }
06 catch (Exception ex)
07 {
08 MessageBox.Show(ex.Message);
09 }
The client application and Web service have the same Web Services Enhancements (WSE) 3.0 policy. The policy configuration file contains the following policy section.
<policy name="Secure">
<anonymousForCertificateSecurity
establishSecurityContext="false"
renewExpiredSecurityContext="true"
requireSignatureConfirmation="false"
messageProtectionOrder="SignBeforeEncrypt"
requireDerivedKeys="true"
ttlInSeconds="300">
<!-- XML defining the serviceToken and protection -->
</anonymousForCertificateSecurity>
</policy>
You need to ensure that the client application can communicate with the Web service.
What should you do?
A. Add the following code between lines 03 and 04.
ws.SetPolicy("Secure");
B. Replace line 03 with the following code.
Math ws = new Math();
C. Add the following code between lines 03 and 04.
ws.UseDefaultCredentials = true;
D. Add the following code between lines 03 and 04.
UsernameToken u = new UsernameToken("userid", "password");
EncryptedKeyToken et = new EncryptedKeyToken(u);
ws.SetClientCredential(et);
E. Add the following code between lines 03 and 04.
ws.SetPolicy("anonymousForCertificateSecurity")
Answer: A
10. When you execute a client application, the following exception is thrown.
EncryptedKeyToken is expected but not present in the security
header of the incoming message.
You discover that the exception is thrown when the client application invokes a Web service named Math with the following code. (Line numbers are included for reference only.)
01 Try
02 Dim ws As New MathWse()
03 Dim i As Integer = ws.Add(1, 2)
04 Console.WriteLine(i.ToString())
05 Catch ex As Exception
06 MessageBox.Show(ex.Message)
07 End Try
The client application and Web service have the same Web Services Enhancements (WSE) 3.0 policy. The policy
configuration file contains the following policy section.
<policy name="Secure">
<anonymousForCertificateSecurity
establishSecurityContext="false"
renewExpiredSecurityContext="true"
requireSignatureConfirmation="false"
messageProtectionOrder="SignBeforeEncrypt"
requireDerivedKeys="true"
ttlInSeconds="300">
<!-- XML defining the serviceToken and protection -->
</anonymousForCertificateSecurity>
</policy>
You need to ensure that the client application can communicate with the Web service.
What should you do?
A. Add the following code between lines 02 and 03.
ws.SetPolicy("Secure")
B. Replace line 02 with the following code.
Dim ws As New Math()
C. Add the following code between lines 02 and 03.
ws.UseDefaultCredentials = True
D. Add the following code between lines 02 and 03.
Dim u As New UsernameToken("userid", "password")
Dim et As New EncryptedKeyToken(u)
ws.SetClientCredential(et)
E. Add the following code between lines 02 and 03.
ws.SetPolicy("anonymousForCertificateSecurity")
Answer: A
11. A client application calls a Web service named Math. Both the client application and Math are configured with a Web Services Enhancements (WSE) 3.0 policy named Secure to validate anonymous access for certificate security.
A Web reference to the Math Web service is added to the client application's project using Microsoft Visual Studio?2005. When the client application is built and executed, a SoapException exception is thrown with the following message.
The security requirements are not met because the security header
is not included in the incoming message.
You need to ensure that the application runs without throwing the SoapException exception.
What should you do?
A. Add the following attribute to the Math proxy class definition.
[Microsoft.Web.Services3.Policy("Secure")]
B. Set the Name property for the WebServiceBindingAttribute attribute on the Math proxy class definition to MathWseSoap.
C. Add the following attribute to the Math proxy class definition.
[Microsoft.Web.Services3.Policy("anonymousForCertificateSecurity")]
D. Modify the Math proxy class so that it derives from the following protocol.
System.Web.Services.Protocols.SoapHttpClientProtocol
Answer: A
12. A client application calls a Web service named Math. Both the client application and Math are configured with a Web Services Enhancements (WSE) 3.0 policy named Secure to validate anonymous access for certificate security.
A Web reference to the Math Web service is added to the client application's project using Microsoft Visual Studio?2005. When the client application is built and executed, a SoapException exception is thrown with the following message.
The security requirements are not met because the security header
is not included in the incoming message.
You need to ensure that the application runs without throwing the SoapException exception.
What should you do?
A. Add the following attribute to the Math proxy class definition.
<Microsoft.Web.Services3.Policy("Secure")>
B. Set the Name property for the WebServiceBindingAttribute attribute on the Math proxy class definition to MathWseSoap.
C. Add the following attribute to the Math proxy class definition.
<Microsoft.Web.Services3.Policy("anonymousForCertificateSecurity")>
D. Modify the Math proxy class so that it derives from the following class.
System.Web.Services.Protocols.SoapHttpClientProtocol
Answer: A
13. You are an enterprise application developer. You are manipulating a collection of customer, product, and supplier objects.
The collection objects must fulfill the following requirements:
The objects must use custom sort methods on different properties of the respective classes.
The objects must be strongly typed.
A developer from your team decides to use the following collection classes.
abstract class MyCollectionBase : System.Collections.CollectionBase {
abstract public void Sort();
}
public class CustomerCollection : MyCollectionBase {
//Code overriding CollectionBase methods
public override void Sort(){
//Customer sorting code
}
}
public class SupplierCollection : MyCollectionBase {
//Code overriding CollectionBase methods
public override void Sort(){
//Supplier sorting code
}
}
public class ProductCollection : MyCollectionBase {
//Code overriding CollectionBase methods
public override void Sort(){
//Product sorting code
}
}
You need to review the code and recommend improvements to simplify maintenance, if necessary.
What should you conclude and recommend?
A. The code does not need to be modified.
B. The code needs to be modified. The MyCollectionBase class must implement the ICollection interface instead of inheriting from the CollectionBase class.
C. The code needs to be modified. Use List<T> class instead of creating custom collections.
D. The code needs to be modified. The child collection classes must inherit from the CollectionBase class instead of the MyCollectionBase class.
Answer: C
14. You are an enterprise application developer. You are manipulating a collection of customer, product, and supplier objects.
The collection objects must fulfill the following requirements:
The objects must use custom sort methods on different properties of the respective classes.
The objects must be strongly typed.
A developer from your team decides to use the following collection classes.
Public MustInherit Class MyCollectionBase
Inherits System.Collections.CollectionBase
Public MustOverride Sub Sort()
End Class Public Class CustomerCollection
Inherits MyCollectionBase
'Code overrriding CollectionBase methods
Public Overrides Sub Sort()
'Customer sorting method
End Sub
End Class
Public Class SupplierCollection
Inherits MyCollectionBase
'Code overrriding CollectionBase methods
Public Overrides Sub Sort()
'Supplier sorting method
End Sub
End Class
Public Class ProductCollection
Inherits MyCollectionBase
'Code overrriding CollectionBase methods
Public Overrides Sub Sort()
'Product sorting method
End Sub
End Class
You need to review the code and recommend improvements to simplify maintenance, if necessary.
What should you conclude and recommend?
A. The code does not need to be modified.
B. The code needs to be modified. The MyCollectionBase class must implement the ICollection interface instead
of inheriting from the CollectionBase class.
C. The code needs to be modified. Use List(Of T) class instead of creating custom collections.
D. The code needs to be modified. The child collection classes must inherit from the CollectionBase class instead
of the MyCollectionBase class.
Answer: C
15. A Web service application uses Web Services Enhancements (WSE) 3.0.
A class named RejectUnknownActorFilter is derived from the SoapFilter class. The
RejectUnknownActorFilter class throws a SoapException exception if the request contains an unexpected actor.
A class defines a policy assertion as follows. (Line numbers are included for reference only.)
01 public class RequireActorAssertion : PolicyAssertion {
02 public override SoapFilter
03 CreateClientInputFilter(FilterCreationContext context) {
04 return null;
05 }
06 public override SoapFilter
07 CreateClientOutputFilter(FilterCreationContext context) {
08 return null;
09 }
10 public override SoapFilter
11 CreateServiceInputFilter(FilterCreationContext context) {
12 return null;
13 }
14 public override SoapFilter
15 CreateServiceOutputFilter(FilterCreationContext context) {
16 return null;
17 }
18 }
You need to ensure that the Web service rejects any SOAP request that contains an unexpected actor. Your code
must minimize the server resources used to process the request.
What should you do?
A. Replace line 04 with the following line of code.
return new RejectUnknownActorFilter();
B. Replace line 08 with the following line of code.
return new RejectUnknownActorFilter();
C. Replace line 12 with the following line of code.
return new RejectUnknownActorFilter();
D. Replace line 16 with the following line of code.
return new RejectUnknownActorFilter();
Answer: C
16. A Web service application uses Web Services Enhancements (WSE) 3.0.
A class named RejectUnknownActorFilter is derived from the SoapFilter class. The
RejectUnknownActorFilter
class throws a SoapException exception if the request contains an unexpected actor.
A class defines a policy assertion as follows. (Line numbers are included for reference only.)
01 Public Class RequireActorAssertion
02 Inherits PolicyAssertion
03 Public Overrides Function CreateClientInputFilter(ByVal_
context As FilterCreationContext) As SoapFilter
04 Return Nothing
05 End Function
06
07 Public Overrides Function CreateClientOutputFilter(ByVal _
context As FilterCreationContext) As SoapFilter
08 Return Nothing
09 End Function
10
11 Public Overrides Function CreateServiceInputFilter(ByVal _
context As FilterCreationContext) As SoapFilter
12 Return Nothing
13 End Function
14
15 Public Overrides Function CreateServiceOutputFilter(ByVal _
context As FilterCreationContext) As SoapFilter
16 Return Nothing
17 End Function
18 End Class
You need to ensure that the Web service rejects any SOAP request that contains an unexpected actor. Your code
must minimize the server resources used to process the request.
What should you do?
A. Replace line 04 with the following line of code.
Return New RejectUnknownActorFilter()
B. Replace line 08 with the following line of code.
Return New RejectUnknownActorFilter()
C. Replace line 12 with the following line of code.
Return New RejectUnknownActorFilter()
D. Replace line 16 with the following line of code.
Return New RejectUnknownActorFilter()
Answer: C
17. An application has components named ComponentA, ComponentB, and ComponentC.
ComponentA and ComponentB update tables in a database named DB1. ComponentC updates tables in a database named DB2.
At run time, ComponentA is executed with either ComponentB or ComponentC in a single transaction.
You need to compose the transaction to minimize the use of the system resources.
What should you do?
A. Write the following code for the transaction.
[AutoComplete]
void ExecuteTransactions() {
...
}
B. Write the following code for the transaction.
void ExecuteTransactions() {
try {
...
ContextUtil.SetComplete();
}
catch {
ContextUtil.SetAbort();
}
}
C. Write the following code for the transaction.
void ExecuteTransactions() {
SqlConnection connection = new SqlConnection(...);
SqlTransaction trans = connection.BeginTransaction();
try {
...
trans.Commit();
}
catch {
trans.Rollback();
}
}
D. Write the following code for the transaction.
void ExecuteTransactions() {
using (TransactionScope txscope = new TransactionScope()) {
...
txscope.Complete();
}
}
Answer: D
18. An application has components named ComponentA, ComponentB, and ComponentC.
ComponentA and ComponentB update tables in a database named DB1. ComponentC updates tables in a database named DB2.
At run time, ComponentA is executed with either ComponentB or ComponentC in a single transaction.
You need to compose the transaction to minimize the use of the system resources.
What should you do?
A. Write the following code for the transaction.
<AutoComplete> _
Sub ExecuteTransactions()
...
End Sub
B. Write the following code for the transaction.
Sub ExecuteTransactions()
Try
...
ContextUtil.SetComplete()
Catch
ContextUtil.SetAbort()
End Try
End Sub
C. Write the following code for the transaction.
Sub ExecuteTransactions()
Dim connection As SqlConnection = New SqlConnection(...)
Dim trans as SqlTransaction = connection.BeginTransaction();
Try
...
trans.Commit()
Catch
trans.Rollback()
End Try
End Sub
D. Write the following code for the transaction.
Sub ExecuteTransactions()
Using txscope As TransactionScope = new TransactionScope()
...
txscope.Complete()
End Using
}
Answer: D
19. You are writing a set of .NET Framework remoting components that will be hosted on an application server named Appserver1. The components must have the highest possible throughput.
You create the following class to be hosted in the remoting server.
public class OrderService : MarshalByRefObject {
public double SaveOrders (DataTable orders) {
//some lengthy synchronous database calls
...
}
}
You need to ensure that OrderService is available to remoting clients.
What should you do?
A. Within the initialization routine of the server application, include the following code segment.
TcpChannel chan = new TcpChannel(3085);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(OrderService),
"OrderService.rem",
WellKnownObjectMode.SingleCall);
B. Within the initialization routine of the server application, include the following code segment.
HttpChannel chan = new HttpChannel(3085);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(OrderService),
"OrderService.rem",
WellKnownObjectMode.Singleton);
C. Within the initialization routine of the server application, include the following code segment.
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
OrderService sm = (OrderService)Activator.GetObject(
typeof(OrderService),
"tcp://appserver1:3085/OrderService.rem");
D. Within the initialization routine of the server application, include the following code segment.
HttpChannel chan = new HttpChannel();
ChannelServices.RegisterChannel(chan);
OrderService sm = (OrderService)Activator.GetObject(
typeof(OrderService),
"http: //appserver1:3085/OrderServiceHost/OrderService.rem");
Answer: A
20. You are writing a set of .NET Framework remoting components that will be hosted on an application server named Appserver1. The components must have the highest possible throughput.
You create the following class to be hosted in the remoting server.
Public Class OrderService
Inherits MarshalByRefObject
Public Function SaveOrders(ByVal orders As DataTable) As Double
...
End Function
End Class
You need to ensure that OrderService is available to remoting clients.
What should you do?
A. Within the initialization routine of the server application, include the following code segment.
Dim chan As New TcpChannel(3085)
ChannelServices.RegisterChannel(chan, False)
RemotingConfiguration.RegisterWellKnownServiceType( _
GetType(OrderService), _
"OrderService.rem", _
WellKnownObjectMode.SingleCall)
B. Within the initialization routine of the server application, include the following code segment.
Dim chan As New HttpChannel()
ChannelServices.RegisterChannel(chan, False)
RemotingConfiguration.RegisterWellKnownServiceType( _
GetType(OrderService), _
"OrderService.rem", _
WellKnownObjectMode.Singleton)
C. Within the initialization routine of the server application, include the following code segment.
Dim chan As New TcpChannel(3085)
ChannelServices.RegisterChannel(chan, False)
Dim sm As OrderService = CType(Activator.GetObject( _
GetType(OrderService), _
"tcp://appserver1:3085/OrderService.rem"), _
OrderService)
D. Within the initialization routine of the server application, include the following code segment.
Dim chan As New HttpChannel()
ChannelServices.RegisterChannel(chan, False)
Dim sm As OrderService = CType(Activator.GetObject( _
GetType(OrderService), _
"http: //appserver1:3085/OrderServiceHost/OrderService.rem"), _
OrderService)
Answer: A
21. An assembly named SimpleMathLib is deployed to the Bin folder that is under a virtual directory named SimpleMathHost, which is on an IIS server named SERVER1.
The SimpleMathLib assembly contains the following code.
namespace SimpleMath{
public class SimpleMathClass : MarshalByRefObject{
public double Add(double x, double y) {
return x + y;
}
}
The Web.config file under the SimpleMathHost virtual directory contains the proper configuration to host
SimpleMath as a remoting object.
You write a client Console Application and add a reference to the SimpleMathLib assembly.
You need to ensure that the client Console Application calls the Add method on SERVER1 and returns the correct
sum of the parameters to the Console Application.
What should you do?
A. Write the following code in the client application.
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan, false);
SimpleMath.SimpleMathClass sm = new SimpleMathClass();
Console.WriteLine(sm.Add(2, 2).ToString());
B. Write the following code in the client application.
SimpleMathClass sm = (SimpleMathClass)
Activator.GetObject(typeof(SimpleMathClass),
"http: //server1:80/SimpleMathHost/SimpleMath.rem");
Console.WriteLine(sm.Add(2, 2).ToString());
C. Write the following code in the client application.
SimpleMath.SimpleMathClass sm = (SimpleMathClass)
Activator.GetObject(typeof(SimpleMathClass),
"tcp: //server1:80/SimpleMathHost/SimpleMath.rem");
Console.WriteLine(sm.Add(2, 2).ToString());
D. Write the following code in the client application.
SimpleMath.SimpleMathClass sm = (SimpleMathClass)
Activator.CreateInstance(typeof(SimpleMathClass),
new string[] {"http: //server1:80/SimpleMathHost/SimpleMath.rem",
"SimpleMath.SimpleMathClass, SimpleMathLib"});
Console.WriteLine(sm.Add(2, 2).ToString());
Answer: B
22. An assembly named SimpleMathLib is deployed to the Bin folder that is under a virtual directory named SimpleMathHost, which is on an IIS server named SERVER1.
The SimpleMathLib assembly contains the following code.
Public Class SimpleMathClass
Inherits MarshalByRefObject
Public Function Add(ByVal x As Double, ByVal y As Double) _
As Double
Return x + y
End Function
End Class
The Web.config file under the SimpleMathHost virtual directory contains the proper configuration to host
SimpleMath as a remoting object.
You write a client Console Application and add a reference to the SimpleMathLib assembly.
You need to ensure that the client Console Application calls the Add method on SERVER1 and returns the correct
sum of the parameters to the Console Application.
What should you do?
A. Write the following code in the client application.
Dim chan As New TcpChannel()
ChannelServices.RegisterChannel(chan, False)
Dim sm As New SimpleMathClass()
Console.WriteLine(sm.Add(2, 2).ToString())
B. Write the following code in the client application.
Dim sm As SimpleMathClass = _
CType(Activator.GetObject(GetType(SimpleMathClass), _
"http://server1:80/SimpleMathHost/SimpleMath.rem"), SimpleMathClass)
Console.WriteLine(sm.Add(2, 2).ToString())
C. Write the following code in the client application.
Dim sm As SimpleMathClass = _
CType(Activator.GetObject(GetType(SimpleMathClass), _
"tcp://server1:80/SimpleMathHost/SimpleMath.rem"), SimpleMathClass)
Console.WriteLine(sm.Add(2, 2).ToString())
D. Write the following code in the client application.
Dim sm As SimpleMathClass = _
CType(Activator.CreateInstance(GetType(SimpleMathClass), _
New String() {"http: //server1:80/SimpleMathHost/SimpleMath.rem", _
"SimpleMath.SimpleMathClass, SimpleMathLib"}), _
SimpleMathClass)
Console.WriteLine(sm.Add(2, 2).ToString())
Answer: B
23. A Windows service application must host a .NET Framework remoting class named SimpleMathClass.
SimpleMathClass must have the following method, which can be called remotely.
public double Add(double x, double y) {
return x + y;
}
You need to create the SimpleMathClass class.
What should you do?
A. Write the following class definition.
public class SimpleMathClass : MarshalByRefObject {
public double Add(double x, double y) {
return x + y;
}
}
B.
Write the following class definition.
[AutomationProxy(true)]
public class SimpleMathClass {
public double Add(double x, double y) {
return x + y;
}
}
C. Write the following class definition.
[Serializable]
public class SimpleMathClass {
public double Add(double x, double y) {
return x + y;
}
}
D. Write the following class definition.
public class SimpleMathClass : ServicedComponent {
public double Add(double x, double y) {
?
TestInside 70-554
return x + y;
}
}
Answer: A
24. A Windows service application must host a .NET Framework remoting class named SimpleMathClass.
SimpleMathClass must have the following method, which can be called remotely.
Public Function Add(ByVal x As Double, ByVal y As Double) _
As Double
Return x + y
End Function
You need to create the SimpleMathClass class.
What should you do?
A. Write the following class definition.
Public Class SimpleMathClass
Inherits MarshalByRefObject
Public Function Add(ByVal x As Double, ByVal y As Double) _
As Double
Return x + y
End Function
End Class
B. Write the following class definition.
<AutomationProxy(True)> _
Public Class SimpleMathClass
Public Function Add(ByVal x As Double, ByVal y As Double) _
As Double
Return x + y
End Function
End Class
C. Write the following class definition.
<Serializable()> _
Public Class SimpleMathClass
Public Function Add(ByVal x As Double, ByVal y As Double) _
As Double
Return x + y
End Function
End Class
D. Write the following class definition.
Public Class SimpleMathClass
Inherits ServicedComponent
Public Function Add(ByVal x As Double, ByVal y As Double) _
As Double
Return x + y
End Function
End Class
Answer: A
25. Two Web services named PersonService and GreetingService operate on Person objects. The PersonService Web service returns a Person object when it is given a name. The GreetingService returns a greeting message when it is given a Person object. The Person class is common to both Web services.
You need to use these Web services to get a greeting message for a person.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Generate the Web service proxies by using the Add Web Reference option in Microsoft Visual Studio 2005.
B. Generate the Web services proxies by using wsdl.exe with the following arguments and add them to your
Microsoft Visual Studio 2005 project.
wsdl.exe /sharetypes /out:SharedTypesServicesProxies.cs
http: //host/GreetingService.asmx?WSDL
http: //host/PersonService.asmx?WSDL
C. Write the client code as follows:
void GreetPerson() {
PersonService personSvc = new PersonService();
GreetingService greetSvc = new GreetingService();
string ret = greetSvc.GreetPerson(personSvc.FindMember("Howard Gonzalez"));
}
D. Write the client code as follows:
void GreetPerson() {
People.PersonService personSvc = new People.
PersonService ();
People.Person person = personSvc.FindMember("Howard Gonzalez");
Greeting.GreetingService greetSvc = new Greeting.GreetingService();
string ret = greetSvc.GreetPerson(
Convert.ChangeType(person, typeof(Greeting.Person)) as
Greeting.Person);
}
Answer: B AND C
26. Two Web services named PersonService and GreetingService operate on Person objects. The PersonService Web service returns a Person object when it is given a name. The GreetingService returns a greeting message when it is given a Person object. The Person class is common to both Web services.
You need to use these Web services to get a greeting message for a person.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Generate the Web service proxies by using the Add Web Reference option in Microsoft Visual Studio 2005.
B. Generate the Web services proxies by using wsdl.exe with the following arguments and add them to your Microsoft Visual Studio 2005 project.
wsdl.exe /sharetypes /out:SharedTypesServicesProxies.cs
http: //host/GreetingService.asmx?WSDL
http: //host/PersonService.asmx?WSDL
C. Write the client code as follows:
Sub GreetPerson()
Dim personSvc As New PersonService()
Dim greetSvc As New GreetingService()
Dim ret As String = greetSvc.GreetPerson(personSvc.FindMember("Howard Gonzalez"))
End Sub
D. Write the client code as follows:
Sub GreetPerson()
Dim personSvc As New People.PersonService
Dim person As People.Person = personSvc.FindMember("Howard Gonzalez")
Dim greetSvc As New Greeting.GreetingService
Dim ret As String = greetSvc.GreetPerson( _
Convert.ChangeType(person, GetType(Greeting.Person)) _
)
End Sub
Answer: B AND C
27. A Web service named Math uses Web Service Enhancements (WSE) 3.0 policy assertions that are defined in the policy configuration file to implement security. The Web service authenticates access to the Web methods using the UsernameOverTransportAssertion policy assertion.
A client application must call a Web method on the Math Web service. When the client application is executed, it throws an InvalidOperationException exception that displays the following text.
Unable to determine client token to use. Client token type
requested was 'Microsoft.Web.Services3.Security.Tokens.UsernameToken'.
The following code is used to invoke the Web method. (Line numbers are included for reference only.)
01 Math ws = new Math();
02 ws.SetPolicy("Secure");
03 int result = ws.Add(3, 4);
You need to ensure that the Web methods can be invoked without causing the client application to throw the
InvalidOperationException exception.
What should you do?
A. Add the following code between lines 02 and 03.
ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
B. Add the following code between lines 02 and 03.
ws.Credentials = new System.Net.NetworkCredentials(userId, password);
C. Add the following code between lines 02 and 03.
ws.SetServiceCredential<UsernameToken>(new UsernameToken(userId, password));
D. Add the following code between lines 02 and 03.
ws.SetClientCredential<UsernameToken>(new UsernameToken(userId, password));
Answer: D
28. A Web service named Math uses Web Service Enhancements (WSE) 3.0 policy assertions that are defined in the policy configuration file to implement security. The Web service authenticates access to the Web methods using the UsernameOverTransportAssertion policy assertion.
A client application must call a Web method on the Math Web service. When the client application is executed, it throws an InvalidOperationException exception that displays the following text.
Unable to determine client token to use. Client token type
requested was 'Microsoft.Web.Services3.Security.Tokens.UsernameToken'.
The following code is used to invoke the Web method. (Line numbers are included for reference only.)
01 Dim ws As New Math()
02 ws.SetPolicy("Secure")
03 Dim result As Integer = ws.Add(3, 4)
You need to ensure that the Web methods can be invoked without causing the client application to throw the
InvalidOperationException exception.
What should you do?
A. Add the following code between lines 02 and 03.
ws.Credentials = System.Net.CredentialCache.DefaultCredentials
B. Add the following code between lines 02 and 03.
ws.Credentials = New System.Net.NetworkCredentials(userId, password)
C. Add the following code between lines 02 and 03.
ws.SetServiceCredential(Of UsernameToken)(New UsernameToken(userid, _
password))
D. Add the following code between lines 02 and 03.
ws.SetClientCredential(Of UsernameToken)(New UsernameToken(userid, _
password))
Answer: D
29. You are creating a Windows-based application that allows users to store photographs remotely by using a Web
service. Both the Web service and the application are configured to use Web Services Enhancements (WSE) 3.0.
You need to configure the application to ensure that a photograph can be sent to the Web service.
What should you do?
A. Write the following code segment in the application.
ImageServiceWse serviceProxy = new ImageServiceWse();
byte[] img = GetImageBytes();
serviceProxy.RequestSoapContext.Add(imageName, img);
serviceProxy.SaveImage(null, imageName);
B. Write the following code segment in the application.
ImageServiceWse serviceProxy = new ImageServiceWse();
byte[] img = GetImageBytes();
serviceProxy.SaveImage(img, imageName);
C. Write the following code segment in the application.
ImageService serviceProxy = new ImageService();
serviceProxy.SoapVersion = SoapProtocolVersion.Soap12;
byte[] img = GetImageBytes();
serviceProxy.SaveImage(img, imageName);
D. Write the following code segment in the application.
ImageService serviceProxy = new ImageService();
serviceProxy.UserAgent = "Microsoft WSE 3.0";
byte[] img = GetImageBytes();
serviceProxy.SaveImage(img, imageName);
Answer: B
30. You are creating a Windows-based application that allows users to store photographs remotely by using a Web service. Both the Web service and the application are configured to use Web Services Enhancements (WSE) 3.0.
You need to configure the application to ensure that a photograph can be sent to the Web service.
What should you do?
A. Write the following code segment in the application.
Dim serviceProxy As New ImageServiceWse()
Dim img As Byte() = GetImageBytes()
serviceProxy.RequestSoapContext.Add(imageName, img)
serviceProxy.SaveImage(Nothing, imageName)
B. Write the following code segment in the application.
Dim serviceProxy As New ImageServiceWse()
Dim img As Byte() = GetImageBytes()
serviceProxy.SaveImage(img, imageName)
C. Write the following code segment in the application.
Dim serviceProxy As New ImageService()
serviceProxy.SoapVersion = SoapProtocolVersion.Soap12
Dim img As Byte() = GetImageBytes()
serviceProxy.SaveImage(img, imageName)
D. Write the following code segment in the application.
Dim serviceProxy As New ImageService()
serviceProxy.UserAgent = "Microsoft WSE 3.0"
Dim img As Byte() = GetImageBytes()
serviceProxy.SaveImage(img, imageName)
Answer: B



