I've a WCF service running just on my laptop. The laptop is connected to the web, IP is static.
What's involved in getting that service consumable by a web user (say I'm in Cyprus and my clients are other in the US), can I restrict users by their IP address?
Please not, I'm aware of WCF support for P2P, but that's not what I'm looking for. The service will be migrated to a proper hosting environment after a while.
I'd let IIS do the heavy work and restrict IPs.
Restrict IP addresses in IIS
Just host the WCF inside a web project and use a dynamic DNS service to pass through to your laptop.
HTH
Related
I have a wcf service (with net.tcp binding) hosted at windows service and a wpf client. when I run the service in a server outside the company's domain it works excellent, the problem is when I host the service in a server inside the company's domain, and try to run the wpf app in a client outside of the company domain.
I'm getting the same error, "The Socket connection was aborted..."
I try with Security Mode None, Transport and the same result.
My question is, what is the correct way to do that? I mean host the wcf net TCP service in a domain server and call it from a client outside of domain?
Thanks a lot!
I change the binding from net.tcp to wshttp and the service works fine!
Server with the corporate domain and client without corporate domain
The thing is I need the make this work with net.tcp
Neither a Windows Domain nor DNS have anything to do with WCF/TCP if you don't explicitly make it so.
Assuming the address you gave actually leads to the PC you host your service on (so no local IP addresses) and nothing in between (like a firewall) blocks the connection, it should work.
The correct way is to make sure client and server can talk to each other. If it's different networks, you will need NAT and if one is a corporate network I'd be very surprised to see no firewall that you need to configure.
As a first step, try to ping your target machine from your client machine.
There are 3 people working on a project, one of which is working on a wcf service, is it possible for him to create an IIS site on his machine locally to host the service and allow the other members to access that service/site on his machine if we are on our company shared Network? I'm trying to see whats the best way to host this service on a test server so the other members can test it out as well without any bugs.
Oh yes, that's the most common way of hosting WCF service.
Under project properties of your WCF service just select "Web" and then "Use local IIS server"
To answer your question directly: yes, this is possible. I have performed this exact setup by hosting a web site on a local laptop. We have been able to access the site from dozens of computers on the same network successfully.
I have develop one simple database application build using SilverLight5.0 + Entity Framework + WCF + VisualStudio 2010 with .NET 4.0.
Database and application located in my personal PC(connected in LAN).
Now i required that this application should accessible through any computer in LAN.
Any computer in LAN can inser,Update or delete data in Database located in my personal PC through the application which i have developed what should be the simple steps i have to follow.....
please help me....
Well you're just asking how you can host your WCF service, there is tonnes of material online or any decent WCF book. You have a number of choices, from simple self hosting, windows service or IIS. Hosting a WCF service in any of the aforementioned ways is not at all complicated. Worth mentioning that since you're on LAN, you should strongly consider netTcpBinding since it has considerable performance gains over other bindings, and you don't need to worry about opening particular ports since you're on LAN.
For example you can have a service hosted in IIS on port 8085 in your LAN, the host machine has a local IP of say 192.68.1.51, now the computers in the network (on the LAN, such as 192.168.6/.7.9/etc.) can consume the service by referencing the service locally like:
http://192.168.1.51:8085/MyService/TheService.svc
Now the benefit of hosting in IIS and having a static IP (public IP) is that you can also consume the service over the internet, so computers outside the LAN can
consume the service with an address like this (if your public IP is 22.175.194.56 for example):
http://22.175.194.56:8085/MyService/TheService.svc
To do this you just need to create a rule on your LANs router to forward the
traffic coming through the port 8085 to the local IP of your service host machine (192.168.1.51), this can be configured somewhere on your routers virtual server under NATs.
Obviously if the host machines' IP changes you need to reference the new IP address to your local and outside clients, but the point of a static IP is that it never changes, for the purposes precisely.
I have a WCF service, and two apps behind the Firewall, and third app connect remotely through internet. I host the service on IIS.
If I restrict the IPs to local IP, and that remote server IP using IIS, would that be sufficient? if yes, Is that a bad idea for another reason rather than security.
Given that the remote server will connect through HTTPs and credentials.
thanks
Securing using IP is a good idea only if you are sure that IPs are static and unlikely to change. For example, local IPs can easily change (typically, they get auto assigned). So, I will go via this route if what you are securing is a critical/sensitive.
This is probably a basic networking issue, but I am new to this stuff and just do not know the answer.
I have written a wcf service and client. I can use one of the http bindings and get the service to work correctly when I put my machine's network IP address as the endpoint address and run the client and server from the same machine. Now, I want to be able to connect to this service from a different machine over the internet. Clearly it does not work when I use my network IP address in this scenario, but simply putting in my router's broadband IP address does not seem to be doing the trick, either. Am I just missing a firewall port that I need to open up, or am I trying to do something that should not be possible?
If you want users from the internet to be able to connect to your service, you'll have to consider a few points:
binding: the lowest common denominator is the basicHttpBinding which is SOAP 1.1 with basically no additional features available - just like ASMX webservices. Just about anyone can connect to that. For more advanced clients, you might also want to expose a wsHttpBinding endpoint on your service
security: how (if at all) do you want to secure access to your web service? Do you have username/password credentials that callers must supply? Check out the WCF Security Guidance for a whole slew of information bits on the various security scenarios
authenticating your service: typically, you should strive to make your service authenticate itself to the rest of the world - this requires a server certificate and enables secured communication (messages signed + encrypted) on the wire
make sure your service endpoint(s) is reachable from the internet, through all firewalls and proxies and everything :-)
Hope that helps a bit!
You need to set up port forwarding on your router. Perhaps someone on ServerFault or SuperUser would be able to help you. Or even a google search now that you know what it's called. The instructions will be different depending on the router. The port you need to forward will be the port you've picked in the WCF config file.
I host WCF services through IIS, but it took me ages to work out how. At the moment I put the files on the webserver and enable websharing on the root folder. Then you can assign them to an appropriate Application Pool in IIS, and add a service reference to any client projects using the URL of the wsdl.
I'm not sure if this is the best way to do it but its the only way I've worked out so far.
Here's the simple solution.
I am assuming that you have made a working WCF application and hosted over the IIS.
The next thing to do is to browse the application from the IIS. It will give you url in the address bar something like:
http://localhost/myservice/service.svc
Next go to www.whatismyip.com. this will give you your system's WAN IP (say, 45.34.56.200).
Replace the URL you got in step 2 with: http://45.34.56.200/myservice/service.svc
Now you can use this URL any where in this world to consume your service.
I found a good Article and it is working fine for me, on the following the Main steps:
1-First you should create WCF Service.
2-add application on IIS and give alias for your virtual directory and set path from your local drive.
3-Make sure your default app pool set to .NET CLR V4.0.
4-test your WCF service is running successfully on localhost.
5-To access the same via LAN (Local Area Network) you must disable Firewall for you Private network.
6- try to use ngrok.com, you will get Temp URL to use via internet to access your LocalHost anywhere.
Then Everything will be fine.
For More Information Check the following Link:
https://www.codeproject.com/Tips/813650/Host-WCF-on-LocalHost-and-access-via-Internet