You create an XML Web service named PhoneNumberService that returns the telephone numbers of people in a specified geographical region. If an error occurs when the service is processing requests, a custom application exception named PhoneNumberException is thrown.
You create an ASP.NET application named MyPhoneBook that contains a Web reference to PhoneNumberService. You need to wrap any calls made to PhoneNumberService in a try/catch block to catch any PhoneNumberException that may be thrown.
Which two code segments are possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A.
try {
// Code to call PhoneNumberService method goes here.
}
catch (SoapException ex) {
// Handle the exception.
}
B.
try {
// Code to call PhoneNumberService method goes here.
}
catch (SoapHeaderException ex) {
// Handle the exception.
}
C.
try {
// Code to call PhoneNumberService method goes here.
}
catch (Exception ex) {
// Handle the exception.
}
D.
try {
// Code to call PhoneNumberService method goes here.
}
catch (ApplicationException ex) {
// Handle the exception.
}