Today I needed to write some webservices to talk to our Microsoft Navision system, but instead of just passing over individual data types, I needed to pass over large amounts of data in one call. To achieve this, I created classes to hold the data to pass back and forth. To achieve this, I created a folder in my webservice, and placed the classes in the folder.
The structure of one of the classes (customer) is show below:
namespace WebService
{
  public class wss_Customer
 {
   public string No_ = string.Empty;
   public string Names = string.Empty;
   public string Name2 = string.Empty;
   public string Address = string.Empty;
   public string Address2 = string.Empty;
   public string City = string.Empty;
   public string Contact = string.Empty;
   public string PhoneNo_ = string.Empty;
   public decimal CreditLimit_LCY = 0.0M;
   public string CurrencyCode = string.Empty;
   public string SalespersonCode = string.Empty;
   public string CustomerDiscGroup = string.Empty;
   public bool PricesIncludingVAT = false;
   public string PostCode = string.Empty;
   public string County = string.Empty;
   public string VATBusPostingGroup = string.Empty;
   public int CreditStatus = 0;
   public int Blocked = 0;
   public bool AllowLineDisc_ = false;
   public string CustomerPriceGroup = string.Empty;
 }
}
Once I had created the classes, I thought I'd return to my console, calling app, update the webservice reference and start filling the class structure, without first writing the web method routines. But I couldn't see the class structures. After much 'faffing' about, I found that I needed to at least write the web method stubs, including the necessary class structure, as show below:
[WebMethod]
    public int PostUnsynchedCustomer_18(wss_Customer custToSynch, string value)
   {
   }
After doing this, compiling the webservice, updating the webservice reference in the console app, I found that I could see the class structure and start populating it with data.

I would love to hear if anyone else has had similar problems or alternative ways of achieving this.