C#-APP: Using http format in sending XML message to client/server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dantz
    New Member
    • Oct 2008
    • 71

    C#-APP: Using http format in sending XML message to client/server

    hi everyone!
    I am trying to create a client-server application that would communicate
    using xml in a http format.

    I already researched about client-server transferring file using TCP/IP.
    It uses tcclient/tcplistener which worked very fine. However I was trying to
    build an application that could use an http format of request to do the transferring of file.

    I also had downloaded some codes for an implementation of an http server
    but the http client needs to be a web browser, is there a way that I could just have a FORM as a client and pass those http request?

    Is there any suggestion that you can give?

    Thank you very much in advance.
    I hope you could help.
  • mldisibio
    Recognized Expert New Member
    • Sep 2008
    • 191

    #2
    If you already have the Http service running, such as an application hosted in a web server that is ready to accept or send a file, then you should be able to communicate with that http service using the System.Net libraries without the need for a web browser.
    For example, the System.Net.WebC lient class allows you to upload files or strings directly to the specified URI.
    You should also be able to use the System.Net.Http WebRequest, HttpWebResponse and System.Net.Http Listener classes all without the use of a Web Browser.

    If your "server" is in fact a custom, stand-alone service, then another option is to use remoting. This would allow two completely separate assemblies to communcate with each other, and the System.Runtime. Remoting libraries provide out-of-the-box infrastructure for a client and server to communicate using either TCP or HTTP channels. Start with .Net Framework Remoting Overview

    Comment

    • dantz
      New Member
      • Oct 2008
      • 71

      #3
      Originally posted by mldisibio
      If you already have the Http service running, such as an application hosted in a web server that is ready to accept or send a file, then you should be able to communicate with that http service using the System.Net libraries without the need for a web browser.
      For example, the System.Net.WebC lient class allows you to upload files or strings directly to the specified URI.
      You should also be able to use the System.Net.Http WebRequest, HttpWebResponse and System.Net.Http Listener classes all without the use of a Web Browser.

      If your "server" is in fact a custom, stand-alone service, then another option is to use remoting. This would allow two completely separate assemblies to communcate with each other, and the System.Runtime. Remoting libraries provide out-of-the-box infrastructure for a client and server to communicate using either TCP or HTTP channels. Start with .Net Framework Remoting Overview
      Thank you so much for the reply!
      i think the HttpListener and HttpWebRequest are the one i am looking for
      however, i am having a hard time with the HttpListener. When the start() method is called it throws an exception of "Access is denied"

      i already researched on the solution by the netsh.exe,
      in my laptop which is Vista Home Basic it was working but
      in my desktop pc which is Vista Business I cannot have it working.

      i already checked all the reserved one and found the ports that I added.

      Are there any suggestion that you can give?

      Comment

      • mldisibio
        Recognized Expert New Member
        • Sep 2008
        • 191

        #4
        Oh Joy.
        I have not developed on either Vista yet.
        Because you got it to work on one OS but not the other, this is very likely a security issue and not a code issue.
        I did a quick search in Google for - "HttpListen er" "Access Denied" "Vista" and rest assured, you are not alone.
        Do that search. Hear are a few relevant links:
        HttpListener For Dummies
        MSDN Forum - What privilege do I need...

        I will call attention to your issue to other forum experts.

        Comment

        • dantz
          New Member
          • Oct 2008
          • 71

          #5
          Thanks!
          Hope you can help me in this matter.


          Thank you in advance.

          Comment

          • dantz
            New Member
            • Oct 2008
            • 71

            #6
            Originally posted by mldisibio
            Oh Joy.
            I have not developed on either Vista yet.
            Because you got it to work on one OS but not the other, this is very likely a security issue and not a code issue.
            I did a quick search in Google for - "HttpListen er" "Access Denied" "Vista" and rest assured, you are not alone.
            Do that search. Hear are a few relevant links:
            HttpListener For Dummies
            MSDN Forum - What privilege do I need...

            I will call attention to your issue to other forum experts.

            @mldisibio

            Hi! I solved my problem!
            Thank you so much for the support.
            I just needed to run my Visual Studio as Administrator.
            (Right click the icon then select "Run as Administrator")

            hope it can help to others.

            Comment

            Working...