How to reference and call a webservice?

Discussion in 'ASP .Net' started by Big George, Dec 13, 2006.

  1. Big George

    Big George Guest

    Hello Experts !

    I'm using: VS.NET 2003

    I have a webservice1.Service1. I have installed it on IIS. No problem.

    I can access it through:
    http://localhost/WebService1/Service1.asmx
    or
    http://192.168.1.109/WebService1/Service1.asmx

    At my ASP.net application, I have referenced WebService1 as web
    reference and on its window properties I have set up:
    URL Behavior = Dynamic

    On the web.config of the ASP.net application is stated:
    <appSettings><add key="MyApplication.localhost.WebService1"
    value="http://localhost/WebService1/Service1.asmx"/>
    </appSettings>

    On an aspx page, I call the webservice in this way:

    Imports MyApplication.localhost
    .....
    Dim ws As New WebService1.Service1
    Dim sMess As String = ws.HelloWorld

    My question is: If I need to install the webservice in other server,
    how could I reference it on my ASP.NET Application?

    a. If I change the webservice to server 192.168.1.200, should I change
    on the web.config:
    <appSettings><add key="MyApplication.localhost.WebService1"
    value="http://192.168.1.200/WebService1/Service1.asmx"/>
    </appSettings>
    b. How could I get this
    value="http://192.168.1.200/WebService1/Service1.asmx" ?
    On my ASP.NET app is stated:
    Imports MyApplication.localhost

    Is it possible to change the value on the web.config and not to change
    anything on the aspx.vb ?

    Thank you !
     
    Big George, Dec 13, 2006
    #1
    1. Advertising

  2. What you are looking for is availlable in following Link :

    http://www.gotdotnet.com/Community/...mpleGuid=35c47ebb-d806-4995-8797-a42251a8ace3

    Thanks and Regards,
    manish bafna

    "Big George" wrote:

    > Hello Experts !
    >
    > I'm using: VS.NET 2003
    >
    > I have a webservice1.Service1. I have installed it on IIS. No problem.
    >
    > I can access it through:
    > http://localhost/WebService1/Service1.asmx
    > or
    > http://192.168.1.109/WebService1/Service1.asmx
    >
    > At my ASP.net application, I have referenced WebService1 as web
    > reference and on its window properties I have set up:
    > URL Behavior = Dynamic
    >
    > On the web.config of the ASP.net application is stated:
    > <appSettings><add key="MyApplication.localhost.WebService1"
    > value="http://localhost/WebService1/Service1.asmx"/>
    > </appSettings>
    >
    > On an aspx page, I call the webservice in this way:
    >
    > Imports MyApplication.localhost
    > .....
    > Dim ws As New WebService1.Service1
    > Dim sMess As String = ws.HelloWorld
    >
    > My question is: If I need to install the webservice in other server,
    > how could I reference it on my ASP.NET Application?
    >
    > a. If I change the webservice to server 192.168.1.200, should I change
    > on the web.config:
    > <appSettings><add key="MyApplication.localhost.WebService1"
    > value="http://192.168.1.200/WebService1/Service1.asmx"/>
    > </appSettings>
    > b. How could I get this
    > value="http://192.168.1.200/WebService1/Service1.asmx" ?
    > On my ASP.NET app is stated:
    > Imports MyApplication.localhost
    >
    > Is it possible to change the value on the web.config and not to change
    > anything on the aspx.vb ?
    >
    > Thank you !
    >
    >
     
    =?Utf-8?B?TWFuaXNoIEJhZm5h?=, Dec 13, 2006
    #2
    1. Advertising

  3. Hi,
    for this i think you will need to invoke web services dynamically.Exact URL
    where you will find details as to how to invoke web services dynamically is
    as follows:
    http://www.gotdotnet.com/community/...web services dynamic&Sites=(www.GotDotNet.com)

    Regards,
    manish bafna

    "Big George" wrote:

    > Hello Experts !
    >
    > I'm using: VS.NET 2003
    >
    > I have a webservice1.Service1. I have installed it on IIS. No problem.
    >
    > I can access it through:
    > http://localhost/WebService1/Service1.asmx
    > or
    > http://192.168.1.109/WebService1/Service1.asmx
    >
    > At my ASP.net application, I have referenced WebService1 as web
    > reference and on its window properties I have set up:
    > URL Behavior = Dynamic
    >
    > On the web.config of the ASP.net application is stated:
    > <appSettings><add key="MyApplication.localhost.WebService1"
    > value="http://localhost/WebService1/Service1.asmx"/>
    > </appSettings>
    >
    > On an aspx page, I call the webservice in this way:
    >
    > Imports MyApplication.localhost
    > .....
    > Dim ws As New WebService1.Service1
    > Dim sMess As String = ws.HelloWorld
    >
    > My question is: If I need to install the webservice in other server,
    > how could I reference it on my ASP.NET Application?
    >
    > a. If I change the webservice to server 192.168.1.200, should I change
    > on the web.config:
    > <appSettings><add key="MyApplication.localhost.WebService1"
    > value="http://192.168.1.200/WebService1/Service1.asmx"/>
    > </appSettings>
    > b. How could I get this
    > value="http://192.168.1.200/WebService1/Service1.asmx" ?
    > On my ASP.NET app is stated:
    > Imports MyApplication.localhost
    >
    > Is it possible to change the value on the web.config and not to change
    > anything on the aspx.vb ?
    >
    > Thank you !
    >
    >
     
    =?Utf-8?B?TWFuaXNoIEJhZm5h?=, Dec 13, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. batista
    Replies:
    1
    Views:
    926
    Laurent Bugnion
    Jan 26, 2006
  2. Cyril
    Replies:
    2
    Views:
    4,510
    Cyril
    Jun 1, 2006
  3. ravi
    Replies:
    10
    Views:
    1,154
    Chris Torek
    Feb 23, 2007
  4. Saeed Amrollahi

    Call by value vs. Call by reference

    Saeed Amrollahi, Jul 11, 2008, in forum: C++
    Replies:
    10
    Views:
    635
    KalleGuld
    Jul 15, 2008
  5. René Preußler

    Asynchronous Call of WebService method within a WebService

    René Preußler, Oct 29, 2008, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    198
    René Preußler
    Oct 29, 2008
Loading...

Share This Page