Intersoft WebDesktop Documentation
Retrieving simple types using WebService
Send Feedback
Intersoft WebDesktop > WebFlyPostBackManager > Tutorials > Retrieving simple types using WebService

Glossary Item Box

Objectives

This tutorial demonstrates the basic function of WebFlyPostBackManager to retrieve simple-type results from a SOAP-based XML WebService page.

  1. Drag WebFlyPostBackManager from Toolbox into a WebForm page.
     


  2. Create a WebService page in the same directory and leave the name as default, which is "WebServiceSamples.asmx". It will automatically create "WebServiceSamples.cs" in the App_code folder.
  3. Set ServiceType to WebService and ServiceUrl to WebServiceSamples.asmx (The URL path of the page) in the properties box.



  4. Add a HTML button and named it "Call WebService".
  5. Add the "OnResponseSuccess" Client Side Events of WebFlyPostBackManager.



  6. Add the following code in client-side:

    Script Copy Code
    <script language="javascript">
    function DoClick()
    {
    var FPBMan = ISGetObject("WebFlyPostBackManager1");

    // call the HelloWorld method of the specified ServiceUrl
    FPBMan.HelloWorld();
    }

    function WebFlyPostBackManager1_OnResponseSuccess(controlId, methodName, returnValue)
    {
    alert("The return value of HelloWorld method is: " + returnValue);
    }
    </script>

  7. Invoke DoClick() function in onclick event like the following:

    Script Copy Code
    <input id="Button1" type="button" value="Call WebService" onclick="DoClick()"/>
    

  8. When you click the button, it will retrieve the simple type result from the defined WebService.
  9. Run the project and you will see something like following:

© 2012 Intersoft Solutions Corp. All Rights Reserved.