Hello,

I'm starting to make a callout like the example in the sdk
& I just want to write everything to a txt file so I can see what I'm
recieving from CRM but in the eventlog I get the following error:

entity: account, event: postupdate, exception:
System.UnauthorizedAccessException: Access to the path "C:\Program
Files\Microsoft CRM\Server\bin\assembly\Update.txt" is denied.


strange huh? :)


here's my code:
public override void PostUpdate(CalloutUserContext userContext,
CalloutEntityContext entityContext,
string preImageEntityXml,
string postImageEntityXml)
{
TextWriter log = TextWriter.Synchronized(
File.AppendText(@"C:\Program
Files\Microsoft CRM\Server\bin\assembly\Update.txt"));

log.WriteLine("PostUpdate");
log.WriteLine("ObjectType: " +

entityContext.EntityTypeCode.ToString());
log.WriteLine("ObjectId: " +
entityContext.InstanceId.ToString());
log.WriteLine("CreatorId: " +
userContext.UserId.ToString());
log.WriteLine();
log.Close();
}

Re: Callout Security issue by Jeffry

Jeffry
Mon Mar 06 10:11:27 CST 2006

If I remember correctly callouts run under the Network Service account, so
make sure that account has rights to write to that folder.

HTH,

--
Jeffry van de Vuurst
CWR Mobility
www.cwrmobility.com
--
"Wouter" <W.VandenBergh@mobileaccess.REMOVETHIS.be> wrote in message
news:evlo02tme7ot960o44c0mhofeh5llr6mp6@4ax.com...
>
> Hello,
>
> I'm starting to make a callout like the example in the sdk
> & I just want to write everything to a txt file so I can see what I'm
> recieving from CRM but in the eventlog I get the following error:
>
> entity: account, event: postupdate, exception:
> System.UnauthorizedAccessException: Access to the path "C:\Program
> Files\Microsoft CRM\Server\bin\assembly\Update.txt" is denied.
>
>
> strange huh? :)
>
>
> here's my code:
> public override void PostUpdate(CalloutUserContext userContext,
> CalloutEntityContext entityContext,
> string preImageEntityXml,
> string postImageEntityXml)
> {
> TextWriter log = TextWriter.Synchronized(
> File.AppendText(@"C:\Program
> Files\Microsoft CRM\Server\bin\assembly\Update.txt"));
>
> log.WriteLine("PostUpdate");
> log.WriteLine("ObjectType: " +
>
> entityContext.EntityTypeCode.ToString());
> log.WriteLine("ObjectId: " +
> entityContext.InstanceId.ToString());
> log.WriteLine("CreatorId: " +
> userContext.UserId.ToString());
> log.WriteLine();
> log.Close();
> }



Re: Callout Security issue by Wouter

Wouter
Wed Mar 08 03:48:49 CST 2006


>If I remember correctly callouts run under the Network Service account, so
>make sure that account has rights to write to that folder.

tnx, that worked!

I have another question now: Is there an easy way to know what was
updated in a PostUpdate Callout ?
In v1.2 he only gave me the data that was changed if I remeber
correctly. Now I'm going to have to compare everything "manually"...

Re: Callout Security issue by Jeffry

Jeffry
Wed Mar 08 09:12:57 CST 2006

I'm afraid you will have to compare the pre and postvalues. I think the Pre
callouts only provide data that has changed.

--
Jeffry van de Vuurst
CWR Mobility
www.cwrmobility.com
--
"Wouter" <W.VandenBergh@mobileaccess.REMOVETHIS.be> wrote in message
news:0u9t02ttrqesfismnv9shdamju63u9ojnj@4ax.com...
>
>>If I remember correctly callouts run under the Network Service account, so
>>make sure that account has rights to write to that folder.
>
> tnx, that worked!
>
> I have another question now: Is there an easy way to know what was
> updated in a PostUpdate Callout ?
> In v1.2 he only gave me the data that was changed if I remeber
> correctly. Now I'm going to have to compare everything "manually"...