Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Problem running a Web Service in a Window Service

Problem running a Web Service in a Window Service

Scheduled Pinned Locked Moved C#
helpdatabasemysqlsysadminannouncement
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Varun Sareen
    wrote on last edited by
    #1

    Hello Friends, I have made a Web Service and am using its reference in a Window Service that is being executed/called every 1 min. Through the Web Service, I am connecting to a remote MySQL Server database in which some of the table are accessed and data is being inserted/updated into them. As the current window service is still in development phase, so whenever i install the batch file of the window service every other day, just in order to check that whether the whole process is running fine or not, The web-service throws an error:-"Unable to connect to server". This error comes only when the web-service is unable to connect to the remote server :( . But the moment i rebuild the web-service at my my machine and then update (replace) it on the web-server and again add it as a reference to the window service then after rebuilding the window service when i run the batch installation file of window service; the whole process executes absolutely fine and the web-server database tables gets updated. I am not able to sort out why an unusual behavior is being shown by web service. Please help me out. Thanks Varun Sareen

    A 1 Reply Last reply
    0
    • V Varun Sareen

      Hello Friends, I have made a Web Service and am using its reference in a Window Service that is being executed/called every 1 min. Through the Web Service, I am connecting to a remote MySQL Server database in which some of the table are accessed and data is being inserted/updated into them. As the current window service is still in development phase, so whenever i install the batch file of the window service every other day, just in order to check that whether the whole process is running fine or not, The web-service throws an error:-"Unable to connect to server". This error comes only when the web-service is unable to connect to the remote server :( . But the moment i rebuild the web-service at my my machine and then update (replace) it on the web-server and again add it as a reference to the window service then after rebuilding the window service when i run the batch installation file of window service; the whole process executes absolutely fine and the web-server database tables gets updated. I am not able to sort out why an unusual behavior is being shown by web service. Please help me out. Thanks Varun Sareen

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      I believe your webservice reference includes the IP (is pointing directly) to the remote server. This is probably what is creating the problem. Remove this reference by changing your code to point to a dynamic IP and things should be fine.

      The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick Visit the Hindi forum here.

      V 1 Reply Last reply
      0
      • A Abhinav S

        I believe your webservice reference includes the IP (is pointing directly) to the remote server. This is probably what is creating the problem. Remove this reference by changing your code to point to a dynamic IP and things should be fine.

        The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick Visit the Hindi forum here.

        V Offline
        V Offline
        Varun Sareen
        wrote on last edited by
        #3

        Thanks dear Abhinav for providing such clarity but are you talking about:-
        System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053");
        the italicized text or the Server address in the connection string.?

        Thanks Varun Sareen

        A 1 Reply Last reply
        0
        • V Varun Sareen

          Thanks dear Abhinav for providing such clarity but are you talking about:-
          System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053");
          the italicized text or the Server address in the connection string.?

          Thanks Varun Sareen

          A Offline
          A Offline
          Abhinav S
          wrote on last edited by
          #4

          Er no I was not talking about the connection string. Have a look at the configuration file that includes the IP address you need to point to.

          The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick Visit the Hindi forum here.

          V 1 Reply Last reply
          0
          • A Abhinav S

            Er no I was not talking about the connection string. Have a look at the configuration file that includes the IP address you need to point to.

            The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick Visit the Hindi forum here.

            V Offline
            V Offline
            Varun Sareen
            wrote on last edited by
            #5

            ok dear Abhinav

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups