Example XML Response
MPS XML Response in string format:
<response>
<data>
<preferredDomainController>AD01.fabrikam.com</preferredDomainController>
<container>LDAP://OU=litwareinc2,OU=WH,OU=Hosting,DC=fabrikam,DC=Com</container>
<userPrincipalName>bob2@litwareinc2.com</userPrincipalName>
<sAMAccountName>bob2</sAMAccountName>
.<omitted for brevity>
<user path="LDAP://AD01.fabrikam.COM/cn=bob2@litwareinc2.com,OU=litwareinc2,OU=WH,OU=Hosting,DC=fabrikam,DC=Com" name=""/>
</data>
</response>
Typical C# Usage
//Get user name and password.
string userName = this.Request.ServerVariables.Get("AUTH_USER");
string pass = this.Request.ServerVariables.Get("AUTH_PASSWORD");
//Set credentials.
hostedExch.PreAuthenticate = true;
hostedExch.Credentials = new NetworkCredential(userName,pass);
lblMsg.InnerHtml = mpsResponseHeaderLabel;
//Display response.
this.mpsResponse.DocumentSource = "";
response = hostedExch.CreateConsumerUser(container,userPrinicipalName, proxyAddressesXml,samAcctName, displayName, givenName,alias,lastName, planName,password, propertiesXmlString, preferredDomainController);
// set the response XML to match the return from MPF
responseXml.LoadXml(response);
this.mpsResponse.Document = responseXml;
lblDone.InnerText = successMsg;