title: Sending an object throug a webservice and retrieve data in asp.net or silverlight
body: <p>I am using silverlight to develop a windows gadget,I need to call a asp.net web service and which is return an object with some data.
  I want to receive that object and show data.</p>
  
  <p>My codes are below</p>
  
  <p>Web services code.</p>
  
  <pre><code>[WebMethod]
          public userdata LogIn(string username,string user_password)
          {
  
                  return udata;
              }
              return new userdata();
          }
      }
  </code></pre>
  
  <p>My custom class code is </p>
  
  <pre><code> public class userdata
      {
          string name;
  
          public string Name
          {
              get { return name; }
              set { name = value; }
          }
          string userName;
  
          public string UserName
          {
              get { return userName; }
              set { userName = value; }
          }
          string department;
  
          public string Department
          {
              get { return department; }
              set { department = value; }
          }
          string designation;
  
          public string Designation
          {
              get { return designation; }
              set { designation = value; }
          }
          string email;
  
          public string Email
          {
              get { return email; }
              set { email = value; }
          }
          string mobile;
  
          public string Mobile
          {
              get { return mobile; }
              set { mobile = value; }
          }
          string ip;
  
          public string Ip
          {
              get { return ip; }
              set { ip = value; }
          }
          string id;
  
          public string Id
          {
              get { return id; }
              set { id = value; }
          }
  
  
      }
  </code></pre>
  
  <p>it returns </p>
  
  <pre><code>&lt;userdata&gt;
  &lt;Name&gt;Asik&lt;/Name&gt;
  &lt;UserName&gt;asikcse&lt;/UserName
  &gt;&lt;Department&gt;technical&lt;/Department&gt;
  &lt;Designation&gt;Software Programmer&lt;/Designation&gt;
  &lt;Id&gt;1&lt;/Id&gt;
  &lt;/userdata&gt;
  </code></pre>
  
  <p>And in the end of my project I add web references as that references but havent any solution to this.</p>
  
  <pre><code>LoginServiceSoapClient login = new LoginServiceSoapClient();
              login.LogInCompleted+=new EventHandler&lt;LogInCompletedEventArgs&gt;(login_LogInCompleted);
              login.LogInAsync(log._nameText, log._surnameText);
          }
  
          void login_LogInCompleted(object sender, LogInCompletedEventArgs e)
          {
  
                How can I retrieve this object returned by webmethod
  
          }
  </code></pre>