Developing XML Web Services and Server Components with Visual C#™ .NET and the .NET Framework, Exam Cram™ 2 (Exam 70-320) By Amit Kalani, Priti Kalani
Table of Contents
Chapter 6. Advanced Web Services
When a request comes in for the GetBug() method, the Web service notices the SoapDisplayExtension attribute and routes the request and response through the SoapDisplayExtension class. Within that class, the SOAP messages are logged to a disk file and then passed on. Take the following steps to build a client project to test the server-side SOAP extension:
Add a new Visual C# .NET Windows application project (Example6_2) to the solution.
Add a Web reference to http://localhost/EC70320/C06/Example6_1/BugService.asmx.
Place a Button control (btnGetBug) and a TextBox control (txtDescription) on the form. Set the MultiLine property of the txtDescription control to true.
Double-click the Button control and add the following code to handle the Button control's Click event:
Build and run the project. Click the Get Bug button on the form. You'll see the bug description in the textbox.
On the Web server where the Web service is located, open the file C:\Temp\BugService.log. This file contains both the incoming SOAP request and the outgoing SOAP response, as saved by the SOAP extension.