Approving a request programmatically
I am trying to accept a request using the FIM web service. I tried to create an ApprovalResponse setting the Approval and the Decision properties:
RmApprovalResponse response = new RmApprovalResponse ();
response.Approval = approval.ObjectID;
response.Decision = DecisionValues .Approved;
var client = GetWsTransferFactoryClient();
client.CreateResource(response);
When I run the code with the credentials of the approver, I get an error saying "Policy prohibits the request from completing."
Is this the correct way to approve a request using the FIM web service?Paolo Tedesco - http://cern.ch/idm
February 12th, 2010 6:40pm
Each approval object has a unique endpoint so you have to speicify the target endpoint explicitly. There are some code examples on this coming..Eric
Free Windows Admin Tool Kit Click here and download it now
February 15th, 2010 6:19pm
Hi Eric, thanks for your help. Looking at the Endpoint property of the approval object I see the following values: exchange.mail://fimserver.fim.test:5726/ResourceManagementService/WorkflowManager/4e08e4e6-65f1-4783-bdb5-d2e1ceaee405/37 http://fimserver.fim.test:5726/ResourceManagementService/WorkflowManager/4e08e4e6-65f1-4783-bdb5-d2e1ceaee405/37 Then I should issue a request to create an ApprovalResponse object to the http endpoint? Thanks, PaoloPaolo Tedesco - http://cern.ch/idm
February 16th, 2010 6:30pm
Yes... There is some sample code floating around that is an enhancement of the sample on the IDAGuys blog... The Program Manager indicated they were going to merge it into the sample but I don't have a timeline for release.I can ping him and ask him what his plan is.Eric
Free Windows Admin Tool Kit Click here and download it now
February 16th, 2010 7:01pm
Then I should issue a request to create an ApprovalResponse object to the http endpoint?
Correct (to the http endpoint only). There is a catch that the create request must be formatted without using the MS-WSTIM extensions. The sample client on the IDAGuys blog assumes extensions, so it's not quite as simple as simply re-pointing the endpoint.As with most things, Eric is well-informed :)
February 17th, 2010 7:47am