Ok, ran into a nice XmlDocument XPath bug in .NET (selectsinglenode when there is a tempuri.org namespace: you have to fake the prefix!)
But, after fixing that (or better: adding a workaround) I could do the following:
[WebMethod]
public CustomerEntity GetCustomer(string customerID)
{
CustomerEntity toReturn = new CustomerEntity(customerID);
using(DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchEntity(toReturn);
return toReturn;
}
}
then, create a silly client with a grid and a textbox + a button:
private void _getCustomerButton_Click(object sender, System.EventArgs e)
{
try
{
Zeus.CustomerService service = new ServiceTester.Zeus.CustomerService();
CustomerEntity c = (CustomerEntity)service.GetCustomer(_customerIDTextBox.Text);
EntityCollection col = new EntityCollection();
col.Add(c);
_mainGrid.DataSource = col;
}
catch(Exception ex)
{
ExceptionViewer viewer = new ExceptionViewer(ex);
viewer.ShowDialog(this);
}
}
and... it works!
... though, there is one caveat: because the XmlSerializer in .NET 1.x is stupid, it thinks every class implementing IXmlSerializable is a DataSet. So when you add a webreference to the webservice, you'll get a class generated for you (the so called stub class) which contains your method as a method which returns a DataSet. Simply add a reference to the namespace of your generated code to the class, and alter the methods so they return the entity type they should return instead.
Though this IS cumbersome as VS.NET is so silly to re-generate this class whenever it can nail you.
However it is as close to webservice support as I can get. I now have to test the return of a changed entity to get it saved by the webservice.