Making a dynamic web service call

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Making a dynamic web service call

    Hi,

    Is there a way to connect to a Web Service dynamically at runtime (Web
    Reference URL)? I have always used Visual Studio to create a Web Reference
    and then used it in my code. However, that always requires the URL to the
    Web Service to be the same on the staging site and the production site. Now
    I have two instances of the same application running (Staging site and
    Production) and want to store the URL in a file instead. Is there a way to
    do this?

    ex. Web.Config AppSetting <add key="WebServiceURL"
    Value=http://....webserv.asmx>

    Thank you
    Maz.


    Maziar Aflatoun Guest

  2. Similar Questions and Discussions

    1. Web Service Call to consume SAP Web Service
      Greetings, I have been stuck trying to get CF 8 to talk to SAP serviced Web Service. Here is code I am using: <cfscript> ws =...
    2. Making Spyr Dynamic
      Have searched for but could not find so I am asking: Can someone clue me into how I can use a Collapsible Panel or Accordion Panel in a PHP page...
    3. Making dynamic pages static
      I need to build a static site (user requirement) with DW template but a number of the pages will contain the same information - a perfect...
    4. Making a dynamic button
      I am bringing into flash xml files via a web service connector and a data set component. Bound to these are are various components to retreive...
    5. Drop down menu and making it dynamic
      Hi All, I have created a Popup menu using Dreamweaver through behaviours. The issue is the menu is bit lengther and when the menu is displayed...
  3. #2

    Default Re: Making a dynamic web service call

    You can use wsdl.exe to generate the proxy instead and use the /urlkey:SomeKey
    command line parameter. "SomeKey" will be the element in <appSettings> where
    you've stored the URL. The proxy will then automatically read <appSettings?
    to fetch the URL. The other option is to manually set the Url property on
    the proxy from you code prior to invoking it.

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]


    > Hi,
    >
    > Is there a way to connect to a Web Service dynamically at runtime (Web
    > Reference URL)? I have always used Visual Studio to create a Web
    > Reference and then used it in my code. However, that always requires
    > the URL to the Web Service to be the same on the staging site and the
    > production site. Now I have two instances of the same application
    > running (Staging site and Production) and want to store the URL in a
    > file instead. Is there a way to do this?
    >
    > ex. Web.Config AppSetting <add key="WebServiceURL"
    > Value=http://....webserv.asmx>
    >
    > Thank you
    > Maz.


    Brock Allen Guest

  4. #3

    Default Re: Making a dynamic web service call

    Thanks found an easier way

    In the properties window of the Web Reference set the property

    URL Behavior = Dynamic

    This will put an entry into the app.config file that looks something like
    this:

    <add key="MyApp.TestService.TestService"
    value="http://MyServer/MyVirtualDir/MyService.asmx"/>

    Which can be edited to reflect the server you wish to work on either in the
    app.config directly or in the Web Reference properties again by changing the
    Web Reference URL property

    Maz.

    "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
    news:857034632538536296323024@msnews.microsoft.com ...
    > You can use wsdl.exe to generate the proxy instead and use the
    > /urlkey:SomeKey command line parameter. "SomeKey" will be the element in
    > <appSettings> where you've stored the URL. The proxy will then
    > automatically read <appSettings? to fetch the URL. The other option is to
    > manually set the Url property on the proxy from you code prior to invoking
    > it.
    >
    > -Brock
    > DevelopMentor
    > [url]http://staff.develop.com/ballen[/url]
    >
    >
    >
    >> Hi,
    >>
    >> Is there a way to connect to a Web Service dynamically at runtime (Web
    >> Reference URL)? I have always used Visual Studio to create a Web
    >> Reference and then used it in my code. However, that always requires
    >> the URL to the Web Service to be the same on the staging site and the
    >> production site. Now I have two instances of the same application
    >> running (Staging site and Production) and want to store the URL in a
    >> file instead. Is there a way to do this?
    >>
    >> ex. Web.Config AppSetting <add key="WebServiceURL"
    >> Value=http://....webserv.asmx>
    >>
    >> Thank you
    >> Maz.
    >
    >
    >

    Maziar Aflatoun Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139