Thanks for your answer
Well my web service is working properly. I have another method and is has no problem in addition I generate a file in my bad method and write in that file during working the method this is my code:
public string GetReceivedFaxes(int receivedFaxId)
{
try
{
1 _logFile = string.Format(@"e:\log\_{0}.txt", Guid.NewGuid());
2 var connectionString = @"AuthType = AD; Url = mycrmAddress/;Username=userName;Password=passWord";
3 Log("test2");
4 CrmServiceClient conn = new CrmServiceClient(connectionString);
5 Log("test3");
6 IOrganizationService service;
7 Log("test4");
8 service = (IOrganizationService)conn.OrganizationWebProxyClient != null ? 9(IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
10 Log("test5");
11 List<receivedFax> allReceivedFax = ReceiveFax(receivedFaxId);
12 Log("test6");
13 Entity ownerUser = service.Retrieve("systemuser", Guid.Parse("recordId"), new ColumnSet(true));
14 EntityReference ownerReference = ownerUser.ToEntityReference();
15 Log(ownerUser.Attributes["fullname"].ToString());
16 for (int i = 0; i < allReceivedFax.Count; i++)
17 {
18 Log("we are ok");
19 Guid recordId = CreateFax(Guid.Parse("recordId"), allReceivedFax[i], ownerReference, service);
20 Log("TEST");
21 Activate(service, recordId, 1, 4);
22 Log(recordId.ToString());
23 Entity recordCreated = service.Retrieve("fax", recordId, new ColumnSet(true));
24 EntityReference recordCreatedReference = recordCreated.ToEntityReference();
25 CreateNoteAttachment("ReceivedFaxMessage", "PDFFileForReceivedFax", allReceivedFax[i].FaxFileBase64, 26recordCreatedReference, service);
27 }
28 return "Fax created by this identifier: " + "\n" + receivedFaxId.ToString();
29 }
30 catch (Exception ex)
31 {
32 return "There is an error: "+ex.Message;
33 }
34
35 }
my problem is in line 13 and 19. I used service.create() method in createfax method and that creates an error.