Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I have a device which records data and is able to connect to the Wi-fi. It can connect to one specific IP address (which in this case is our PC IP) and a port (4001) or URL. I would like to write a service so i can get the data from the device in to SQL database. I am new to writing services. I am very familiar with asp.net, MVC and C#. Any help is really appreciated. I can give more details if necessary.
Posted
Comments
Sergey Alexandrovich Kryukov 18-Feb-15 16:30pm    
The same way as to any other port.
—SA

1 solution

You need to start with getting understanding of how WCF works through channels: https://msdn.microsoft.com/en-us/library/ms729840%28v=vs.110%29.aspx[^].

The channels are easily replaceable and, essentially, allows you to isolate transport layer of your functionality from your application layer (which is more usually custom in WCF, can be defined by your code, your service contract and the like). Please see:
http://en.wikipedia.org/wiki/Transport_layer[^],
http://en.wikipedia.org/wiki/Application_layer[^].

WCF can be configured using the standard configuration XML Schema or using any custom configuration means. Please see:
https://msdn.microsoft.com/en-us/library/ms731734%28v=vs.110%29.aspx[^],
https://msdn.microsoft.com/en-us/library/ms733932%28v=vs.110%29.aspx[^].

The port is configured a a part of address in the EndPoint configuration:
https://msdn.microsoft.com/en-us/library/ms734786%28v=vs.110%29.aspx[^],
https://msdn.microsoft.com/en-us/library/system.servicemodel.endpoint%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900