GetUriWithoutSuffix static method
Performs an implicit conversion from
The credentials.
Performs an implicit conversion from
The credentials.
Return the url without suffix.
The url
Implementation
// static implicit operator ExchangeCredentials(NetworkCredential credentials)
// {
// return new WebCredentials(credentials);
// }
/// <summary>
/// Performs an implicit conversion from <see cref="System.Net.CredentialCache"/> to <see cref="Microsoft.Exchange.WebServices.Data.ExchangeCredentials"/>.
/// This allows a CredentialCache object to be implictly converted to an ExchangeCredential which is useful when setting
/// credentials on an ExchangeService.
/// </summary>
/// <example>
/// <code>CredentialCache credentials = new CredentialCache();</code>
/// <code>credentials.Add(new Uri("http://www.contoso.com/"),"Basic",new NetworkCredential(user,pwd));</code>
/// <code>credentials.Add(new Uri("http://www.contoso.com/"),"Digest", new NetworkCredential(user,pwd,domain));</code>
/// This operator allows you to type:
/// <code>service.Credentials = credentials;</code>
/// instead of:
/// <code>service.Credentials = new WebCredentials(credentials);</code>
/// </example>
/// <param name="credentials">The credentials.</param>
/// <returns>The result of the conversion.</returns>
// static implicit operator ExchangeCredentials(CredentialCache credentials)
// {
// return new WebCredentials(credentials);
// }
/// <summary>
/// Return the url without suffix.
/// </summary>
/// <param name="url">The url</param>
/// <returns>The absolute uri base.</returns>
static String GetUriWithoutSuffix(Uri url) {
String absoluteUri = url.toString();
int index = absoluteUri.indexOf(WsSecurityPathSuffix);
if (index != -1) {
return absoluteUri.substring(0, index);
}
return absoluteUri;
}