Export (0) Print
Expand All

RetrievePolicy Message (DiscoveryService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online only

Retrieves a policy from the CrmDiscoveryService Web service.

The relevant classes are specified in the following table.

TypeClass
RequestRetrievePolicyRequest
ResponseRetrievePolicyResponse

Remarks

The policy is used to obtain a Windows Live (Passport) ticket when authenticating the user for Microsoft Dynamics CRM Online. Refer to the LogonManager class in the SDK sample code at SDK\Helpers\CS\IdCrlWrapper.

Example

The following code samples show how to retrieve a policy for use in Microsoft Dynamics CRM Online authentication.

[C#]
// Provide valid Microsoft Dynamics CRM Live server information.
string hostname = "dev.crm.dynamics.com";

// Create the discovery service.
CrmDiscoveryService discoveryService = new CrmDiscoveryService();

// Set the discovery process properties.
discoveryService.UseDefaultCredentials = true;
discoveryService.Url = String.Format("https://{0}/MSCRMServices/2007/{1}/CrmDiscoveryService.asmx", hostname, "Passport");

// Request the Microsoft Dynamics CRM Online policy.
RetrievePolicyRequest policyRequest = new RetrievePolicyRequest();
RetrievePolicyResponse policyResponse = (RetrievePolicyResponse)discoveryService.Execute(policyRequest);
[Visual Basic .NET]
' Provide valid Microsoft Dynamics CRM Online server information.
Dim hostname As String = "dev.crm.dynamics.com"

' Create the discovery service.
Dim discoveryService As New CrmDiscoveryService()

' Set the discovery process properties.
discoveryService.UseDefaultCredentials = True
discoveryService.Url = String.Format("https://{0}/MSCRMServices/2007/{1}/CrmDiscoveryService.asmx", hostname, "Passport")

' Request the Microsoft Dynamics CRM Online policy.
Dim policyRequest As New RetrievePolicyRequest()
Dim policyResponse As RetrievePolicyResponse = CType(discoveryService.Execute(policyRequest), RetrievePolicyResponse)

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft