Sunday 15 April 2012

c# - how should I host my service such that other computers can consume myAppService using Internet -



c# - how should I host my service such that other computers can consume myAppService using Internet -

i have created wcf service called myappservice.

now, don't want host service on servers. host in computer. know how host wcf service in console/windows app, windows service , in iis.

but have problem host service in computer. mean in short want computer work server , other computers should able consume myappservice computer via internet.

so, inquire best hosting alternative me , how should host service such other computers can consume myappservice using internet. 1 more question : if above problem solved, can utilize nettcpbinding or have utilize httpbinding?

i'm still not 100% answering right question, i'll give shot.

i believe asking is: given hosting service in iis on personal computer, how allow others access it? if interpretation incorrect, please take apology in advance.

note: i'm assuming ipv4 in answer. ipv6 may option, reply not apply.

there 2 steps in solution, , there few obstacles may or may not able overcome.

get client's web traffic public ip address. route incoming traffic computer.

step 1

you can determine public ip address in many ways, 1 of inquire google: https://www.google.com/#q=what+is+my+ip

obstacles follows:

your ip address may alter time time. solution utilize dynamic dns service such http://dyn.com/dns/, http://www.thatip.com/, or of several alternatives can found online. these services provide url routes public ip, , provide way maintain public ip up-to-date name resoslution works. maintain in mind dns not reliably alter in realtime, however, should expect downtime if , when ip address changes.

your isp may block incoming traffic. whether , how can around specific ip. specifically, mutual isps block incoming port 20, 22, 23, 25, 80, , 443. may able work around port blocking choosing non-standard port service. (this may not impact wcf , iis configuration detailed in step 2.)

particularly if using kind of shared flat connection, may find not have own public ip address. if case, there nil can do. if router's wan address (or computer's ip addres, if you're not using router) in 192.168.* or 10.* ranges, it's time server options.

step 2

once client request has routed through public net public ip address, needs routed computer.

the easiest, though to the lowest degree mutual these days, scenario if computer straight connected cable/dsl modem. in case, traffic routes public ip handled computer. scenario wcf , iis configuration needs listening on actual port used client. example, if isp blocking port 80, maybe configure service hear on port 34323, , port client needs request in service call.

the mutual scenario have router attached cable/dsl modem. in case, need administration command panel on router , forwards port. example, if computer configured hear port 80 incoming service requests, can forwards port (for example, 34323) port 80 on local machine. how forwards port differs router. should able find poking around or doing net search.

the obstacle here local ip address may change. can overcome setting static address outside of router's dhcp assignment range or setting dhcp reservation within router. either way work. suggest searching net setting static ip or poking around in router administration settings dhcp reservations.

if of settings correct, , if there no obstacles outside of control, client on net can access wcf service.

edit: missed talking local windows firewall concerns. go that, allow me link how-to guide covers pretty well. (remember, wcf service conceptually similar website hosting standpoint, much of applies.) http://www.pcstats.com/articleview.cfm?articleid=1774

c# wcf hosting

No comments:

Post a Comment