Hi Gerry Schmitz, I know this, but I might to throw again the exception. This is more simple to debug like this. Each catched exception is specific. I know exactly within the specific method where it crashes. I am sorry! If we find the problem, I will make another code with just one try-catch and I will post to you. Other than that, do you know where I made a mistake? I recall to you that this code runs perfectly within Windows Forms Application. Have a nice day my friend! :)
razzqc
Posts
-
Why BeginGetContext of HTTPListener within Window's Service didn't react or trigger? -
Why BeginGetContext of HTTPListener within Window's Service didn't react or trigger?Hi everyone, I created two kind of programming codes. The first one, I simply use HTTPListener class in .NET. The last one, I use a complex method with more than one thread to treat entering SOAP Request. For them, I return SOAP Response. These solutions runs perfectly within Windows Forms Application (of course, by moving the content of OnStart within the click of start button). But, I have a big problem. The BeginGetContext of HTTPListener seems to be quiet and never react or trigger just within Windows Service. I don't think this issue is normal. These two algorithms runs without issue within Windows Forms Application. Naturally, if I start the Windows Service, the Windows Forms Application doesn't listen in same time. I only run one of them at once. I have a valid self signed certificate. It runs under Windows Forms Application with no issue. I use the same for Windows Service, except with using OnStart and OnStop. Only at this moment, the situation is problematic. I delete and add a SSL Certificate each time to be sure that I have loaded certificate within Windows. I prefer to have simplicity with programming code. I am a fan to "keep it simple". I don't care to keep any of them. I want the best one. Do you experiment this behavior in your life? I transfer many application from Windows Forms Application to Windows Service without any kind of issue in the past. If I execute the DOS command : " telnet localhost 30010 ", the Windows Service listen really the port of communication 30010. But, the BeginGetContext didn't trigger to my function ListenerCallback or ContextReady like it is supposed to do. I read basic documentations concerning HTTPListener class. I control the situation within Windows Forms Application. All methods runs perfectly. This is just if I use the Windows Service. The BeginGetContext doesn't react like it is supposed to react within Windows Service environment. First one :
public partial class SOAPServer_Service : ServiceBase {
public string ErrorMessage = ""; private HttpListener Listener; public SOAPServer\_Service() { InitializeComponent(); } protected void OnStart(string\[\] args) { try { this.ErrorMessage = ""; string Port = "30010", HashCertificat = "8f3146c64cb75a716a3543dfc10c2967acab9471", URLEnvironment = "https://10.182.133.101:30010/WS/"; Process ProcessusDelete = new Process(); ProcessSta