title: Passing class object to a WebService
body: <p>How can I  pass a class object 'obj' of the class ' BL_Customer' from my Web application to a function 'Insert()' in my Webservice (ASMX) and then access the properties of that object in the Webservice?. I have included my remote webservice by 'Add WebReference' facility. I have included 'using WebRererence;' namespace also. Any help will be appreciated.</p>
  
  <p>This is my  BL_Customer class in Business Layer:</p>
  
  <pre><code>public class BL_Customer
  {
      public BL_Customer()
      {
  
      }  
      string c_Cust_Name = string.Empty;    
      string c_Mobile_no = string.Empty;    
      public string Cust_Name
      {
          get { return c_Cust_Name; }
          set { c_Cust_Name = value; }
      }  
      public string Mobile_no
      {
          get { return c_Mobile_no; }
          set { c_Mobile_no = value; }
      } 
  
  }
  </code></pre>
  
  <p>This is my Data Access Layer:</p>
  
  <pre><code>public class DAL_Customer
  {
      public SqlConnection con = new SqlConnection();
      WebReference.Service objWEB = new WebReference.Service();  //objWEB -&gt; Webservice object
      Connection c = new Connection(); 
      public DAL_Customer()
      {
      }
      public int Customer_Insert(BL_Customer obj)
      {
        ---------
        ---------
          return objWEB.Insert(obj);  // Insert() is a function in my remote webservice 
      }
  }
  </code></pre>
  
  <p>This is my webservice: </p>
  
  <pre><code>public class Service : System.Web.Services.WebService
  {   
     public Service () {
      }
  
      [WebMethod]
      public string insert(**What should be here?**)
      {
          -----
          -----
  
      }
  }
  </code></pre>
  
  <p>Regards,
  David</p>