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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. WCF Service

WCF Service

Scheduled Pinned Locked Moved ASP.NET
csharpwcftutorialquestion
2 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.
  • S Offline
    S Offline
    Satish_S
    wrote on last edited by
    #1

    Hi I have created a WCF service and hosted the service as a windows service, i am able to browse from the browser like

    http://localhost:8080/webservices/dataservice.svc?

    when i browse i am getting the intro screen saying about svcutil.exe and generating proxies. i have some 2 methods inside the WCF service and is running as a windows service.when i make a call to the service in order to call and execute the function inside it , i am not getting any reply but always it shows the intro screen with metadata. How to call the method inside windows service(WCF service as windows service) method call from browser

    http://localhost:8080/webservices/dataservice.svc/GetQuote

    procedure created to make wcf as winservice

    public class ServiceProjectInstaller:ServiceBase
    {
    public ServiceHost serviceHost = null;

       public ServiceProjectInstaller()
       {
           //Name of the Windows Service.
            ServiceName = "WCFService";
       }
    
        public static void Main()
        {
            ServiceBase.Run(new ServiceProjectInstaller());
        }
        //Start the Windows Service.
        protected override void OnStart(string\[\] args)
        {
    
            TraceWinService("Starting a Service");
    
            Timer timer = new Timer();
            timer.Elapsed += new ElapsedEventHandler(OnElapsedTime);
            timer.Interval = 60000;
            timer.Enabled = true;
    
    
            if (serviceHost != null)
            {
                serviceHost.Close();
            }
            //Create a ServiceHost for the CService type and provide the base address.
    
            serviceHost=new ServiceHost(typeof(myService.dataService.CDataService));
    
            // Open the ServiceHostBase to create listeners and start 
            // listening for messages.
            serviceHost.Open();
    
        }
        private void OnElapsedTime(object source, EventArgs e)
        {
            TraceWinService("Another Event at: " + DateTime.Now);
        }
        protected override void OnStop()
        {
            if (serviceHost != null)
            {
                serviceHost.Close();
                serviceHost = null;
            }
        }
        private void TraceWinService(string content)
        {
            FileStream fs = new FileStream(@"d:\\ScheduledService.txt", FileMode.Open, FileAccess.Write);
            StreamWriter sw = new StreamWriter(fs);
    
    L 1 Reply Last reply
    0
    • S Satish_S

      Hi I have created a WCF service and hosted the service as a windows service, i am able to browse from the browser like

      http://localhost:8080/webservices/dataservice.svc?

      when i browse i am getting the intro screen saying about svcutil.exe and generating proxies. i have some 2 methods inside the WCF service and is running as a windows service.when i make a call to the service in order to call and execute the function inside it , i am not getting any reply but always it shows the intro screen with metadata. How to call the method inside windows service(WCF service as windows service) method call from browser

      http://localhost:8080/webservices/dataservice.svc/GetQuote

      procedure created to make wcf as winservice

      public class ServiceProjectInstaller:ServiceBase
      {
      public ServiceHost serviceHost = null;

         public ServiceProjectInstaller()
         {
             //Name of the Windows Service.
              ServiceName = "WCFService";
         }
      
          public static void Main()
          {
              ServiceBase.Run(new ServiceProjectInstaller());
          }
          //Start the Windows Service.
          protected override void OnStart(string\[\] args)
          {
      
              TraceWinService("Starting a Service");
      
              Timer timer = new Timer();
              timer.Elapsed += new ElapsedEventHandler(OnElapsedTime);
              timer.Interval = 60000;
              timer.Enabled = true;
      
      
              if (serviceHost != null)
              {
                  serviceHost.Close();
              }
              //Create a ServiceHost for the CService type and provide the base address.
      
              serviceHost=new ServiceHost(typeof(myService.dataService.CDataService));
      
              // Open the ServiceHostBase to create listeners and start 
              // listening for messages.
              serviceHost.Open();
      
          }
          private void OnElapsedTime(object source, EventArgs e)
          {
              TraceWinService("Another Event at: " + DateTime.Now);
          }
          protected override void OnStop()
          {
              if (serviceHost != null)
              {
                  serviceHost.Close();
                  serviceHost = null;
              }
          }
          private void TraceWinService(string content)
          {
              FileStream fs = new FileStream(@"d:\\ScheduledService.txt", FileMode.Open, FileAccess.Write);
              StreamWriter sw = new StreamWriter(fs);
      
      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Satish_S wrote:

      call services method from browser

      AFAIK you can't

      Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns

      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