Kinda off-topic, but I would like to have some input on versionning issues
with web services. Below is what I propose ... I would be happy to have your
comments on that. I know .. sounds like reinventing the wheel, but it never
hurt to re/validate our practices.


Target namespace of the web service follows the template
http://webservices.mySystem.myCompany.com/version/ where version is 1.0, 1.1,
2.0, etc. That means there is only one web service project per system, which
in turn contains many services (.asmx) with many methods.

Each version is a different and independant project. It may happen that 99%
of the new project is a copy of the previous version, but in that case, I
would seriously question the need of a new version.

Each method takes a single parameter which is a structure and also return a
structure, even if the structure has only one field. This is to allow adding
parameters or results without breaking compatibility and/or having to create
a new method. In the case of a new parameter, the method has to handle the
case where clients will not pass any value for that parameter.

The target namespace of those structures will be in the form
http://webservices.mySystem.myCompany.com/version/method/

For example:

[Serializable]
[XmlType([Namespace]:="
http://webservices.humanResources.myCompany.com/1.0/searchEmployees/";)]
public struct SearchEmployeesRequest
{
 public string FirstName;
 public string LastName;
 public DateTime? HiringDate;
}

[Serializable]
[XmlType([Namespace]:="
http://webservices.humanResources.myCompany.com/1.0/searchEmployees/<http://webservices.humanresources.mycompany.com/1.0/searchEmployees/>
")]
public struct SearchEmployeesResponse
{
 public EmployeeCollection Employees;
 public bool TooManyResults;
}

In cases where one or more recordsets are returned, a separate method must
be provided to get only the schema.

public enum SearchEmployeesSchema
{
 Employees
 // ... could add more over time
}

[WebMethod]
public XmlSchema GetSchemaSearchEmployees(SearchEmployeesSchema schema)
{
 // ...
}

Thanks !

--
Sébastien
www.sebastienlorion.com

Reply via email to