How to bind SoapHttpClientProtocol to certain local endpoint?

Discussion in 'ASP .Net Web Services' started by Harri Pesonen, Jan 16, 2006.

  1. My web service client is running under ASP.NET in a web site, that has a
    different ip address than the local machine. When calling a web service, my
    client uses the ip address of the local machine, not the address of the web
    site. This is a problem, because later the remote endpoint uses the ip
    address that was used, and sends another soap call to that address, but there
    is no active web site at that address.

    Is it possible to bind SoapHttpClientProtocol to certain local endpoint?

    If not, how the incoming soap call could be redirected to the correct web
    site?

    Thanks, Harri
     
    Harri Pesonen, Jan 16, 2006
    #1
    1. Advertising

  2. Harri Pesonen

    Josh Twist Guest

    You can set the Url property of the web service proxy at runtime, e.g.

    MyService myService = new MyService();
    myService.proxy = "http://therealendpoint.com/webservice"; // TODO -
    read this from config

    In the above example MyService is autogenerated by adding a Web
    Reference, but it inherits from SoapHttpClientProtocol class.
     
    Josh Twist, Jan 16, 2006
    #2
    1. Advertising

  3. Are you sure that proxy sets the local endpoint of the web service? I really
    need to set the local endpoint of the socket that is used in soap http client
    call. Proxy sounds like it would be used as a proxy to access the remote
    endpoint.
     
    Harri Pesonen, Jan 16, 2006
    #3
  4. Harri Pesonen

    Josh Twist Guest

    Sorry Harri, misunderstood you...

    ... I'm still not sure I get it...

    You have two computers, A & B, where B is running a webservice at
    http://B/MyService.asmx and A is a client of that web service. You can
    already configure A to talk to B at http://B/MyService.asmx but you
    also want to configure which port A uses? Right?

    Why?

    TCP/IP doesn't really work like that. A opens a connection with B, and
    B sends the data requested back down using that connection.
     
    Josh Twist, Jan 16, 2006
    #4
  5. Two reasons: I would like to use the ip address of the web site, because the
    ip address of the machine should not be visible. Also I would like to select
    the port that I use, so that firewall configuration would be easier.
     
    Harri Pesonen, Jan 17, 2006
    #5
  6. Harri Pesonen

    Josh Twist Guest

    Hi Harri,

    With regards to hiding the IP, that kind of thing is down to your
    network setup and nothing to do with your code.

    I'm afraid I don't know how to control the port responses come back to
    when making web requests. I've never had any reason to try (but I doubt
    you can). Normally you just configure your firewall to allow
    connections to port 80 on the target server and the firewall will look
    after the connection back to the client (usually ports over 1200) for
    you.

    Josh
    http://www.thejoyofcode.com/
     
    Josh Twist, Jan 17, 2006
    #6
  7. Harri Pesonen

    Josh Twist Guest

    Hi Harri,

    With regards to hiding the IP, that kind of thing is down to your
    network setup and nothing to do with your code.

    I'm afraid I don't know how to control the port responses come back to
    when making web requests. I've never had any reason to try (but I doubt
    you can). Normally you just configure your firewall to allow
    connections to port 80 on the target server and the firewall will look
    after the connection back to the client (usually ports over 1200) for
    you.

    Josh
    http://www.thejoyofcode.com/
     
    Josh Twist, Jan 17, 2006
    #7
    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. Scott McFadden

    SoapHttpClientProtocol and Keep-Alive

    Scott McFadden, Oct 8, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    567
    Scott McFadden
    Oct 8, 2003
  2. todd
    Replies:
    1
    Views:
    1,202
    Lucien
    May 28, 2004
  3. Soheil

    Overriding SoapHttpClientProtocol.GetWebResponse

    Soheil, Sep 7, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    246
    Soheil
    Sep 7, 2004
  4. Cheung Wai Lun

    SoapHttpClientProtocol.Invoke method problem

    Cheung Wai Lun, Jul 21, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    282
    Cheung Wai Lun
    Jul 21, 2005
  5. manish pendse
    Replies:
    0
    Views:
    208
    manish pendse
    Aug 21, 2005
Loading...

Share This Page