Results 1 to 4 of 4

Thread: Web Service as function return value [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    Web Service as function return value [RESOLVED]

    I want to be able to switch between a local test Web Service and a server
    based live Web Service.
    When testing numerous web forms I need to switch their Web Service reference between a local development service and the live one.
    At the moment this involves replacing the declaration 'TestWebService' with 'LiveWebService' in each form.
    What I would like to do is have a utilities class that has a static function
    that returns a reference to the appropriate web service depending upon a key
    in web.config.
    I would be able to do this if I knew how to declare the return value of the
    function:

    Code:
    internal static ???????? GetWebService()
    {
       string lstrWebService = 
           ConfigurationSettings.AppSetting["WebService"].ToString();
       if(lstrWebService == "Test")
       {
           return ????????;
       }
       else
       {
           return ????????;
       }
    }
    Anyone know what the ?????????s should be or if what I want is not possible.
    Last edited by GlenW; Jul 22nd, 2005 at 05:03 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width