Null reference exception
-
hi everyone, i'm developing 2 applications that can communicate to each other. application1 is using a tcp socket to send a message to application2. application2 should receive the message through its webservice. now, my problem is i'm not getting the message in application2. i tried running ethereal to check the packets and i can see that the message is going to the computer where application2 is running but i'm getting a Null reference exception on application2. i tried using stacktrace but it's only giving me the line where the null reference occured no further information. so, i need advise what's going on. why am i not getting the message from the application? i have been working on this problem for a week now. so, please advice. thanks.
-
hi everyone, i'm developing 2 applications that can communicate to each other. application1 is using a tcp socket to send a message to application2. application2 should receive the message through its webservice. now, my problem is i'm not getting the message in application2. i tried running ethereal to check the packets and i can see that the message is going to the computer where application2 is running but i'm getting a Null reference exception on application2. i tried using stacktrace but it's only giving me the line where the null reference occured no further information. so, i need advise what's going on. why am i not getting the message from the application? i have been working on this problem for a week now. so, please advice. thanks.
Near to impossible to answer from your description. Please post the relevant receiver code and probably also the sending code (and don't forget to mark the line where the exception occurs).
-
Near to impossible to answer from your description. Please post the relevant receiver code and probably also the sending code (and don't forget to mark the line where the exception occurs).
hi, thanks for your reply. i didn't post the code since it's very long. basically i only used BeginSend()(tcp socket) method to send the message and i get to this part of the other application : //------WebService file-------- public string EndSendMessage(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } //---Form.cs file--------- MyWebService ws = new MyWebService(); //other code here... string str = ws.EndSendMessage(); //<---- string is null I've been looking around for a code that works like this but i can't find one. Is it really possible to send a message from a TCP socket to a Webservice? :confused: Thanks.