Hi Christoph,
Please use BasicHttpBinding to test. I use this binding to implement your requirement without any problem. Commonly you need to note security configuration with namedpipebinding.
namespace SimpleWSTest
{
public partial class MyWServiceTest : ServiceBase
{
public MyWServiceTest()
{
InitializeComponent();
if (!System.Diagnostics.EventLog.SourceExists("DoDyLogSoursetest"))
System.Diagnostics.EventLog.CreateEventSource("DoDyLogSoursetest",
"DoDyLogtest");
eventLog1.Source = "DoDyLogSoursetest";
// the event log source by which
//the application is registered on the computer
eventLog1.Log = "DoDyLogtest";
}
protected override void OnStart(string[] args)
{
Process.Start(@"C:\ConsoleApplication18\ConsoleApplication18\bin\Debug\ConsoleApplication18.exe");
}
protected override void OnStop()
{
try
{
ServiceReference1.SimpleServiceClient sc = new ServiceReference1.SimpleServiceClient();
sc.Open();
string sr = sc.SimpleMethod("test");
eventLog1.WriteEntry(sr);
sc.Close();
}
catch (Exception ex)
{
eventLog1.WriteEntry(ex.Message);
}
}
protected override void OnContinue()
{
}
}
}
Best regards,
Riquel
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.