The Service Generator outputs several files including XML Schema Definition (XSD) documents for each request or response message, message classes generated from the XSD, and a service class which includes the provisioning methods of the Well-Enabled Service (WES).
The following document structure shows the typical output from a generation.
Note
The file list is truncated for brevity.
In summary, the generator creates the following items for each Microsoft Provisioning System (MPS) Public Procedure found in a namespace:
The Service Generator creates an XSD and associated message class for both the input and output schema. The following shows an example of these schemas which conform to the recommendations made by the WES toolkit:
<?xml version="1.0" encoding="iso-8859-1"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://provisioning.microsoft.com/hostedexchangemobility" elementFormDefault="qualified" targetNamespace="http://provisioning.microsoft.com/hostedexchangemobility" id="GetUserPolicyRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="GetUserPolicyRequest">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Data">
<xs:annotation>
<xs:documentation>The root data node</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element minOccurs="1" maxOccurs="1" name="path" type="xs:string">
<xs:annotation>
<xs:documentation>The LDAP path of the user. </xs:documentation>
<xs:appinfo xmlns="http://provisioning.microsoft.com/examples">LDAP://CN=user@alpineskihouse.com, OU=AlpineSkiHouse,OU=ConsolidatedMessenger,OU=Hosting,DC=Fabrikam,DC=Com</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="preferredDomainController" type="xs:string">
<xs:annotation>
<xs:documentation>The name of the preferred domain controller. </xs:documentation>
<xs:appinfo xmlns="http://provisioning.microsoft.com/examples">AD01.Fabrikam.com</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="Username" type="xs:string" />
<xs:element name="Password" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Schemas for a WES contain the following major elements:
Note
This is the exact schema embedded in the MPS namespace. It is extracted and from the namespace and wrapped in this new schema "envelope" that is specific to a WES.
Output schemas are nearly identical in format, but do not include the Username and Password elements. For example:
<?xml version="1.0" encoding="iso-8859-1"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://provisioning.microsoft.com/hostedexchangemobility" elementFormDefault="qualified" targetNamespace="http://provisioning.microsoft.com/hostedexchangemobility" id="GetUserPolicyResponse" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="GetUserPolicyResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Data">
<xs:annotation>
<xs:documentation>The root data node</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element minOccurs="1" maxOccurs="1" name="path" type="xs:string">
<xs:annotation>
<xs:documentation>The LDAP path of the user. </xs:documentation>
<xs:appinfo xmlns="http://provisioning.microsoft.com/examples">LDAP://CN=user@alpineskihouse.com, OU=AlpineSkiHouse,OU=ConsolidatedMessenger,OU=Hosting,DC=Fabrikam,DC=Com</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="preferredDomainController" type="xs:string">
<xs:annotation>
<xs:documentation>The name of the preferred domain controller. </xs:documentation>
<xs:appinfo xmlns="http://provisioning.microsoft.com/examples">AD01.Fabrikam.com</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="policyName" type="xs:string">
<xs:annotation>
<xs:documentation>The unique name of the policy. </xs:documentation>
<xs:appinfo xmlns="http://provisioning.microsoft.com/examples">AlpineSales</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="policyDescription" type="xs:string">
<xs:annotation>
<xs:documentation>Description of the policy. </xs:documentation>
<xs:appinfo xmlns="http://provisioning.microsoft.com/examples">Mobile Device policy for mobile sales force</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Message classes are generated from these XSD files using standard code generation from XSD. For example:
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("ServiceGenerator", "1.0.0.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://provisioning.microsoft.com/hostedexchangemobility", IsNullable=false, ElementName="QueryWipeEventsByUserRequest")]
public partial class QueryWipeEventsByUserRequest {
The generation routine also generates a service class which contains all the provisioning methods extracted from the MPS Namespace. The following excerpts demonstrate the typical structure of this class.
namespace Microsoft.Provisioning.WellEnabledService.HostedExchangeMobility {
using System.Xml;
using System.Web;
using System.Web.Services.Protocols;
using Microsoft.ConnectedServices.Sdk;
using Microsoft.ConnectedServices.Sdk.Messaging;
using Microsoft;
/// <summary>Exposes Service provisioning tasks as web service methods.</summary>
[CsfService(Name="Service", Namespace="http://provisioning.microsoft.com/wellenabledservice/hostedexchangemobility")]
public class Service : Microsoft.Provisioning.WellEnabledService.ServiceBase {
/// <summary>Cancel an in-progress mobile device wipe if it is not yet complete.</summary>
/// <param name="request">Request document</param>
[Operation(Name="CancelActiveSyncDeviceWipe",
Action=Constants.CANCELACTIVESYNCDEVICEWIPEACTION)]
public CancelActiveSyncDeviceWipeResponse CancelActiveSyncDeviceWipe(CancelActiveSyncDeviceWipeRequest request)
{
CancelActiveSyncDeviceWipeResponse response = new CancelActiveSyncDeviceWipeResponse();
response.Data
= this.Submit<CancelActiveSyncDeviceWipeRequestData,
CancelActiveSyncDeviceWipeResponseData>
(request.Data,
"Hosted Exchange Mobility",
"CancelActiveSyncDeviceWipe",
request.Username, request.Password);
return response;
}
Non-provisioning-related functionality is covered in the WES API sections of this kit.