Results 1 to 26 of 26

Thread: Internet Service

  1. #1

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Internet Service

    Hello, i'm developing a contact manager called "contacts", i got an idea which i would like to add to the program, i would like users to be able to share contacts through the internet, for example "A" person has one contact that "B" person would like to have it, the problem is i have no idea on how to do it, how to share data through pcs through the internet, so if someone can give me a hand with this one, i'll really appreciate it.

    Thanks
    C# and WPF developer
    My Website:
    http://singlebits.com/

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Internet Service

    If you want users to be able to share the contacts then you'll need some sort of an online 'repository' to hold this information so that it can be retrieved. It's probable that a user won't constantly keep sharing this information so you can keep managing all the contacts on the local computer, but when the user chooses to share, 'export' it in an XML format to a web service. The web service can store it in a manner that attributes it to person B so that person B can get his application to query the web service, get the information out and 'add' it to their local repository.

  3. #3

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: Internet Service

    Ok, thanks for the answer, the contacts of the user will be located in his or her computer, what i need to know is how can i create that type of internet service, to share the xml file the contacts are being exported, or to create a peer to peer connection, i was searching at the C4F vista peer to peer toolkit but without results.
    Does anyone knows more about this ? thank you
    C# and WPF developer
    My Website:
    http://singlebits.com/

  4. #4
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: Internet Service

    This is rather over simplified but you would need to have a server (or rent some space, like you do for a website) On this server you would have an application (which is sometimes confusingly called a server too). This application would accept requests from user A and send them to user B. The reason for the XML is it can be serialised easily and yet still retain the structural integrity of the data.

  5. #5

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: Internet Service

    Ok, thanks for your answer
    C# and WPF developer
    My Website:
    http://singlebits.com/

  6. #6

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: Internet Service

    I was thinking and maybe the file the user wants to share, if he or she has a live id, maybe the file can be uploaded to the skydrive of that user, and then when the user is using other computer with the program i did, he or she just gives his or her live id, and then the file containing certain values is found and load the contacts from there, but has anyone tried to upload files to skydrive using C#.

    thanks
    C# and WPF developer
    My Website:
    http://singlebits.com/

  7. #7
    Hyperactive Member
    Join Date
    Mar 2008
    Location
    Zeist, The Netherlands
    Posts
    266

    Re: Internet Service

    What??? A web server??? Rent room??? Isn't this the WCF forum?
    Couldn't you just build a WCF service into your application that exposes a method to add a contact to your address book? The 'client' (the one wanting to send the contact) could just call it and pass it a contact object.

    [edit]
    This has 2 assumptions: (A) You have a class for your contacts.... (B) Both users are online at the time.
    [/edit]

  8. #8
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Internet Service

    I would agree with Hamish on this one (and I think both of those assumptions are fair ones). Why bother uploading the contacts to one location just for the other user to download them, just send them straight from one user to the other.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  9. #9

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: Internet Service

    Thanks for your answers, i've been reading a little bit about WCF, but what i've read doesn't say i can use WCF to share data, or a file, etc.. between User A and User B, if i'm wrong please correct me, does WCF use peer to peer ?? thanks
    C# and WPF developer
    My Website:
    http://singlebits.com/

  10. #10
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Internet Service

    From what I understand WCF can 'share' whatever you want it to share... in your case it would be a class that holds the data for the contact (e.g a class that contains the name, phone number etc of the contact).

    Have a look at this to get an idea of how you actually create a WCF service: http://channel9.msdn.com/shows/Endpo...t-WCF-Service/
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  11. #11

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: Internet Service

    What if what i want to share is a generic list, containing the data for the contact, would that be possible ?
    C# and WPF developer
    My Website:
    http://singlebits.com/

  12. #12

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: Internet Service

    Thank you very much chris128, that video made me get started on how to do it. thanks
    C# and WPF developer
    My Website:
    http://singlebits.com/

  13. #13
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Internet Service

    Quote Originally Posted by Pac_741
    What if what i want to share is a generic list, containing the data for the contact, would that be possible ?
    Yeah I think that should be no problem at all
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  14. #14
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Internet Service

    I disagree with Chris and Hamish - those are quick and dirty solutions with no regards to scalability or performance. A WCF service sitting on the Internet does not constrain you to having both both machines on at the same time and you're going to have trouble performing netTcp over the Internet, ISPs won't be happy with that. Having the contacts in a single place also allows reinstalls or usage on more computers, by the same user, so that the contacts are in sync.

  15. #15
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: Internet Service

    I agree.

  16. #16
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Internet Service

    What do you mean by "trouble performing netTcp over the Internet" :S
    TCP/IP is THE standard internet protocol (which you know of course) so I'm a little confused.

    Anyway, when you send a file to someone over Microsoft's MSN Messenger, you dont send the file through the MSN services (unless the newer versions of MSN do things differently), MSn establishes a connection directly between you and the recipient. So I dont see how this is a "quick dirty" solution if it is good enough for one of the most popular IM apps out there.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  17. #17
    Hyperactive Member
    Join Date
    Mar 2008
    Location
    Zeist, The Netherlands
    Posts
    266

    Re: Internet Service

    Chris, netTcp may not necessarily be 100% equal to TCP/IP (there is no mention of IP in the name, and if it's just TCP it's non-routable), so I don't know, it may be a problem. I wonder why you wouldn't just use wsHttps though... HTTPS is available almost anywhere....

    And I personally think that exchanging contact information should be something that's done while both users are online and can give confirmation. I would not want to expose my contact list on a web service. I may be paranoid, but when they're out to get you, that makes perfect sense.

  18. #18
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Internet Service

    Ah it seems you are right, I just assumed it was TCP/IP as I have never actually heard the TCP protocol being used with anything other than IP, but I guess I should not have assumed!
    Quote Originally Posted by msdn
    Windows Communication Foundation (WCF) provides a new TCP-based network protocol (net.tcp://) for high-performance communication
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  19. #19
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Internet Service

    Hey, assumptions are alright, I make those about WPF all the time. (See other thread)

  20. #20

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: Internet Service

    So, guys i really don't know much about internet services, sockets, and all the stuff you are talking about, so i'm pretty lost.

    Thank you anyways for your answers.
    C# and WPF developer
    My Website:
    http://singlebits.com/

  21. #21
    Hyperactive Member
    Join Date
    Mar 2008
    Location
    Zeist, The Netherlands
    Posts
    266

    Re: Internet Service

    I guess our combined answer to you is another question:
    What do you want your application to do? Should it be able to exchange contact information when the sending party is offline? If so, you need a web server to run a WCF service that offers the contents of the address book. If not, you can use the application itself to run that same service.

  22. #22

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: Internet Service

    Ok, what i want to do, is really simple, but i don't know how to do it, what i want my application to do, is let's say User A wants a contact, he or she wants to share, with User B, and both have an internet connection, and then User A, sends that contact to user B, then User B gets a message Displaying User A wants to share this contact with you, so User B can add that contact, i want to do no more and no less than that, i don't want contacts to be stored in a service, i want nothing of that, the contacts are being saved in the application startup path, give that explanation of what i want to do, will i still have to use WCF services? is that the only way to do it, is it the easiest way ?

    Thank you all of your answers.
    C# and WPF developer
    My Website:
    http://singlebits.com/

  23. #23
    Hyperactive Member
    Join Date
    Mar 2008
    Location
    Zeist, The Netherlands
    Posts
    266

    Re: Internet Service

    OK. Clear...
    First of all, WCF is not the only way to send information from one program to another, this is however the WPF, WCF and WF forum, so it's logical you're going to get a WCF answer here.
    Second, if you are going to use WCF, you are always going to use a service. The question we discussed was if you wanted to build this service into your application, or use an seperate web server to host it. From what you described, you want to build it into your application.

    I am quite new to WCF myself (it's new, so most people are), so I can't give you a full explanation on how to do it, but I have watched the first couple of videos from this list, and I think with some time (and help from this forum) I could do it. So I think you can too.....
    Last edited by Hamish; Feb 24th, 2009 at 03:37 AM.

  24. #24
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Internet Service

    Several ways to do it.

    One way is to use TcpClient to connect straight to the other user and send the information across. This would be what chris described.

    The other way is to get yourself a web host, create a WCF service on it and have each application poll the service at regular intervals for updates.

    And on and on and on.

  25. #25
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Internet Service

    Isnt there another way - having each client app host its own WCF service that is capable of sending/receiving the information? So basically exactly the same as the TCPClient method you mentioned but just using WCF instead because from my experience (which isnt a lot) its not easy to send anything other than plain text strings via TcpClient.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  26. #26
    Hyperactive Member
    Join Date
    Mar 2008
    Location
    Zeist, The Netherlands
    Posts
    266

    Re: Internet Service

    Yes, that's what I mean by building the service into your application. This video shows you how to do it. Apparently it is called self-hosting.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width