Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / January 2006

Tip: Looking for answers? Try searching our database.

How to bind SoapHttpClientProtocol to certain local endpoint?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Harri Pesonen - 16 Jan 2006 14:50 GMT
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
Josh Twist - 16 Jan 2006 20:24 GMT
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.
Harri Pesonen - 16 Jan 2006 21:32 GMT
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.
Josh Twist - 16 Jan 2006 22:19 GMT
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.
Harri Pesonen - 17 Jan 2006 08:50 GMT
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.
Josh Twist - 17 Jan 2006 09:13 GMT
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 - 17 Jan 2006 09:13 GMT
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/

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.