Workshop
The workshop is designed to help you review what you've learned in this hour and to prepare you for the material that will be covered in future hours. The answers to the quiz are in Appendix A.
Quiz
You have created an XML Web service that compiles correctly but when run exposes no methods. Why?
You forgot to include the <WebMethod()> declaration in your code.
Why is it important to create a new WSDL file after deploying your XML Web service?
The original WSDL file points to your development server, not the location where the service has been deployed.
You need to close down a connection to a database and drop some object references. Where should this be done?
The Dispose() method is where XML Web services do their cleanup.
Exercises
Experiment with the four-function calculator. Try creating other simple mathematical functions, such as squaring an integer, returning the sine and cosine of a number, or returning the value of pi to some user-requested number of decimal places. You can cheat on that last function by simply storing pi as a constant of some arbitrary length and rounding it to fit the user's request.
The following code could be added to your FourFunctionCalc code to create a squaring function:
1: <WebMethod()> Public Function Squared(iNum1 as Integer) _ 2: As Long 3: 4: Return (iNum1 * iNum1) 5: End Function
It must be noted that the FourFunctionCalc is now grossly misnamed.