Testing the SOAP Extensions

Team-Fly    

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:

  1. Add a new Visual C# .NET Windows application project (Example6_2) to the solution.

  2. Add a Web reference to http://localhost/EC70320/C06/Example6_1/BugService.asmx.

  3. Place a Button control (btnGetBug) and a TextBox control (txtDescription) on the form. Set the MultiLine property of the txtDescription control to true.

  4. Double-click the Button control and add the following code to handle the Button control's Click event:

     private void btnGetBug_Click(object sender, System.EventArgs e) {     localhost.BugService bugService = new localhost.BugService();     localhost.Bug bug = bugService.GetBug(1);     txtDescription.Text = bug.Description; } 
  5. Build and run the project. Click the Get Bug button on the form. You'll see the bug description in the textbox.

  6. 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.


    Team-Fly    
    Top


    MCAD Developing XML Web Services and Server Components with Visual C#. NET and the. NET Framework Exam Cram 2 (Exam Cram 70-320)
    Managing Globally with Information Technology
    ISBN: 789728974
    EAN: 2147483647
    Year: 2002
    Pages: 179

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net