Microsoft 70-320
Developing XML Web Services
and Server Components
with Microsoft Visual C#.NET
Version 10.0
070 - 320
Leading the way in IT testing and certification tools, www.testking.com
- 2 -
Important Note
Please Read Carefully
Study Tips
This product will provide you questions and answers along with detailed explanations
carefully compiled and written by our experts. Try to understand the concepts behind the
questions instead of cramming the questions. Go through the entire document at least twice so
that you make sure that you are not missing anything.
Further Material
For this test TestKing also provides:
* Interactive Test Engine Examinator. Check out an Examinator Demo at
http://www.testking.com/index.cfm?pageid=724
Latest Version
We are constantly reviewing our products. New material is added and old material is revised.
Free updates are available for 90 days after the purchase. You should check your member
zone at TestKing an update 3-4 days before the scheduled exam date.
Here is the procedure to get the latest version:
1. Go to www.testking.com
2. Click on Member zone/Log in
3. The latest versions of all purchased products are downloadable from here. Just click
the links.
For most updates, it is enough just to print the new questions at the end of the new version,
not the whole document.
Feedback
Feedback on specific questions should be send to feedback@testking.com. You should state:
Exam number and version, question number, and login ID.
Our experts will answer your mail promptly.
Copyright
Each pdf file contains a unique serial number associated with your particular name and
contact information for security purposes. So if we find out that a particular pdf file is being
distributed by you, TestKing reserves the right to take legal action against you according to
the International Copyright Laws.
070 - 320
Leading the way in IT testing and certification tools, www.testking.com
- 3 -
Note:
Section A contains 133 questions.
Section B contains 100 questions.
The total number of questions is 233.
Each section starts with QUESTION NO :1. There are no missing questions.
Section A
QUESTION NO: 1
You are creating a .NET Remoting object. You want to add code to the object to log
error messages and warning messages. You want the log messages written to both a log
file and to the Windows application log.
Which code segment should you use?
A. EventLog eventLog = new EventLog(“testkobj”);
FileStream fileLog = File.Create(“testkobj.log”;
Trace.WriteLine(eventLog, “sample message”);
Trace.WriteLine(fileLog, “sample message”);
B. EventLog eventLog = new EventLog(“testkobj”);
FileStream fileLog = File.Create(“testkobj.log”);
Trace.Write(eventLog);
Trace.Write(fileLog);
Trace.WriteLine(“sample message”);
C. Trace.Listeners.Add(new
EventLogTraceListener(“testkobj”));
Trace.Listeners.Add(
new TextFileTraceListener(“testkobj.log”));
Trace.WriteLine(“sample message”);
D. Trace.Listeners.Add(new EventLogTraceListener());
Trace.Listeners.Add(
new.TextFileTraceListener(“testkobj.log”));
Trace.WriteLine(“sample message”);
Answer: C
Explanation: Listeners direct the tracing output to an appropriate target, such as a log,
window, or text file.
An EventLogTraceListener redirects output to an event log. A TextWriterTraceListener
redirects output to an instance of the TextWriter class.
We should take care to use the new EventLogTraceListener(“remobj”) constructor.
Note: Any listener in the Listeners collection gets the same messages from the trace output
methods. If we set up two listeners: a TextWriterTraceListener and an
070 - 320
Leading the way in IT testing and certification tools, www.testking.com
- 4 -
EventLogTraceListener. Each listener receives the same message. The
TextWriterTraceListener would direct its output to a stream, and the EventLogTraceListener
would direct its output to an event log.
Reference: Visual Basic and Visual C# Concepts, Trace Listeners
.NET Framework Class Library, EventLogTraceListener Class [C#]
Incorrect Answers
A: The EventLog object provides interaction with Windows event logs and filestreams
enables writing of data to files. However, they are not appropriate for logging warning
and error messages.
B: The following statements are incorrect.
Trace.Write(eventLog);
Trace.Write(fileLog);
The correct usage is Trace.Write(Parameter), where Parameter is either an Object or a
String that should be written.
D: The EventLogTraceListener Constructor() (with no parameter) initializes a new instance
of the EventLogTraceListener class without a trace listener.
QUESTION NO: 2
You create a serviced component named SessionDispenser. This computer is in the
TestKing.Utilities assembly and is registered in a COM+ server application.
SessionDispenser has multiple callers.
You discover that there are logic problems in the Create New Session method. You want
to debug any calls to this method.
What should you do?
A. Open the SessionDispenser solution.
Set a breakpoint on the CreateNewSession method.
Start the debugger.
B. Attach the debugger to the client process.
Set a breakpoint on the SessionDispenser.CreateNewSession method.
C. Attach the debugger to the TestKing.Utilites.exe process.
Set a breakpoint on the CreateNewSession method.
D. Attach the debugger to a Dllhost.exe process.
Set a breakpoint on the CreateNewSession method.
Answer: D
Explanation: Since this is a COM+ SERVER application we have to attach the debugger to
the Dllhost.exe.
Reference: .NET Framework Developer's Guide, Using Serviced Components with the
Global Assembly Cache
070 - 320
Leading the way in IT testing and certification tools, www.testking.com
- 5 -
Incorrect Answers
A: The debugger must be attached to the program that should be debugged.
B: The debugger should be attached to Dllhost.exe, not to the client process.
C: We are not debugging a Library application, so we should not attach the debugger to the
TestKing.Utilities.exe process.
QUESTION NO: 3
You create an XML Web service named LatLong that converts street addresses to
latitude and longitude coordinates. TestKing Inc. charges for this service and allows only
existing customers to use the service.
If a customer ID is not passed as part of a SOAP header, you want the service to refuse
the request. You want these service refusal messages to be logged to an event log named
LatLongLog. You anticipate that there will be a lot of these log entries over time. A
string object named refusalMessage contains the message to log.
Which code segment should you use?
A. Event log = new EventLog(“LatLongLog”);
log.WriteEntry(refusalMessage, EventLogEntryType.Error);
B. EventLog log = new EventLog();
log.Source = “LatLongLog”;
log.WriteEntry(refusalMessage, EventLogEntryType.Error);
C. if (!EventLog.SourceExists(“LatLongSource”)) {
EventLog.CreateEventSource(“LatLongSource”,
“LatLongLog”);
}
EventLog.WriteEntry(“LatLongSource”,
refusalMessage, EventLogEntryType.Error);
D. if (!EventLog.SourceExists(“LatLongSource”)) {
EventLog.CreateEventSource(“LatLongSource”,
“LatLongLog”;
}
EventLog log = new EventLog(“LatLongLog”);
log.WriteEntry(refusalMessage, EventLogEntryType.Error);
Answer: C
Explanation: First we use the SourcesExists method to search the registry for an existing
event source. If it does not exists we create a new.
Note: The EventLog.CreateEventSource method establishes an application, using the
specified Source, as a valid event source for writing entries to a log on the local computer.
This method can also create a new custom log on the local computer.
Reference: .NET Framework Class Library, EventLog Members