WCF Service
-
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);
-
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);
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