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
  1. Home
  2. General Programming
  3. C#
  4. Null reference exception

Null reference exception

Scheduled Pinned Locked Moved C#
helpquestion
3 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.
  • L Offline
    L Offline
    lagumaster
    wrote on last edited by
    #1

    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.

    R 1 Reply Last reply
    0
    • L lagumaster

      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.

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      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).

      L 1 Reply Last reply
      0
      • R Robert Rohde

        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).

        L Offline
        L Offline
        lagumaster
        wrote on last edited by
        #3

        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.

        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