Results 1 to 8 of 8

Thread: [RESOLVED] Help with Web Reference

  1. #1

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Resolved [RESOLVED] Help with Web Reference

    hi guys! can anybody please help me. I have a Web Reference under my Web References. How can i change the 'Web Reference Url' property of that programmatically? Thanks in advance!

  2. #2

  3. #3
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

    Re: Help with Web Reference

    Create an instance of the web service, and set the (if memory serves correctly) Url property.
    Alternatively, set the Behavior property to "Dynamic" - a web.config entry will be created with the current URL, and you may change this at will.

    http://www.google.co.za/search?q=c%2...ient=firefox-a

  4. #4

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: Help with Web Reference

    Yap! a web referenced to Sharepoint Web Service.

  5. #5
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: Help with Web Reference

    I assumed that you already have a wisdil file in your project. In the wisdil file .cs you can make another constructor that accept a string. That string is the new url address. I hope I make myself clear.

  6. #6

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: Help with Web Reference

    I dont have wisdil. How can i have wisdil in my project?

  7. #7
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

    Re: Help with Web Reference

    Popskie's referring to the proxy class (i.e. the class you instantiate when you wish to query the web service) generated when you add a web reference - if you show all files within a project, the web reference will have a WSDL file, and a .cs proxy.
    Popskie's solution will work, however, if you ever update the web reference, you will have to manually recreate the constructor.

    It would be easiest to set the web reference's "Behaviour" property to dynamic; as said before, an appSetting entry will be created in the application's [app/web].config file - this will be loaded when you create an instance of the web service.

    Reference material

  8. #8

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: Help with Web Reference

    Ok. Thanks a bunch for the input guys!

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