2017-03-01 24 views
1

しかし、自分の新しいレコードを作成することはありません。Webサービスを使用中にエラーが発生しました

Error: Could not connect to net.tcp://103.229.5.53:8201/DynamicsAx/Services/ACX_CaseTab leQ. The connection attempt lasted for a time span of 00:00:21.0658227. TCP erro r code 10060: A connection attempt failed because the connected party did not pr operly respond after a period of time, or established connection failed because connected host has failed to respond 103.229.5.53:8201.

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using Microsoft.Xrm.Sdk; 
using Microsoft.Crm.Sdk; 
using System.ServiceModel.Discovery; 
using System.Runtime.Serialization; 
using Microsoft.Xrm.Sdk.Query; 
using Microsoft.Xrm.Sdk.Client; 
using System.ServiceModel.Description; 
namespace ConsoleApplication1 
{ 
    class Program 
    { 
     static void Main(string[] args) 
     { 
      try 
      { 
       Program test = new Program(); 
       ClientCredentials cc = new ClientCredentials(); 
       cc.UserName.UserName = ""; 
       cc.UserName.Password = ""; 
       OrganizationServiceProxy service = new OrganizationServiceProxy(new Uri(""), null, cc, null); 
       string caseid = ""; string casetype = ""; 
       try 
       { 
        QueryExpression query1 = new QueryExpression 
        { 
         EntityName = "e011_cases", 
         ColumnSet = new ColumnSet("e011_caseid", "e011_casetype", "e011_casesid"), 
         Criteria = new FilterExpression() 
         { 
          FilterOperator = LogicalOperator.And, 
          Conditions = { 
              new ConditionExpression 
              { 
               AttributeName ="e011_caseid", 
               Operator=ConditionOperator.Equal, 
               Values ={"CRM00000098"} 
              }, 
             } 
         } 
        }; 

        EntityCollection ec = service.RetrieveMultiple(query1); 

        if(ec.Entities[0].Contains("e011_caseid")) 
        { 
         caseid = ec.Entities[0].Attributes["e011_caseid"].ToString(); 
        } 
        if(ec.Entities[0].Contains("e011_casetype")) 
        { 
         EntityReference er = (EntityReference)ec.Entities[0].Attributes["e011_casetype"]; 
         casetype = er.Name.ToString(); 
        } 
       } 
       catch (Exception ex) 
       { 
        Console.WriteLine(ex.Message); Console.ReadKey(); 
       } 

       ACX_CaseTableQ.ACX_CaseTableQServiceClient Proxy = new ACX_CaseTableQ.ACX_CaseTableQServiceClient(); 
       ACX_CaseTableQ.CallContext cnx = new ACX_CaseTableQ.CallContext(); 
       cnx.Company = "1100"; 
       Proxy.ClientCredentials.Windows.ClientCredential.UserName = ""; 
       Proxy.ClientCredentials.Windows.ClientCredential.Domain = ""; 
       Proxy.ClientCredentials.Windows.ClientCredential.Password = ""; 
       ACX_CaseTableQ.AxdACX_CaseTableQ ObjCasetableQ = new ACX_CaseTableQ.AxdACX_CaseTableQ(); string objcase = 
       Convert.ToString(ObjCasetableQ.Acx_CaseTable_1); 
       ACX_CaseTableQ.AxdEntity_Acx_CaseTable_1 objAxd = new ACX_CaseTableQ.AxdEntity_Acx_CaseTable_1(); 
       string zipcode = objAxd.Zipcode; 
       string sate = objAxd.State; 
       objAxd.CaseID = caseid; 
       objAxd.CaseCategoryId = casetype; ObjCasetableQ.Acx_CaseTable_1 = new ACX_CaseTableQ.AxdEntity_Acx_CaseTable_1[1] { objAxd }; 
       ACX_CaseTableQ.EntityKey[] ReturnKey = Proxy.create(cnx, ObjCasetableQ); 
      } 
      catch (Exception ex) 
      { 
       Console.WriteLine(ex.Message); Console.ReadKey(); 
      } 
     } 
    } 
} 
+0

あなたが直面しているエラーを投稿して、問題にすばやく注意してください。 –

+0

net.tcpに接続できませんでした://103.229.5.53:8201/DynamicsAx/Services/ACX_CaseTab leQ。接続の試行は、00:00:21.0658227の時間間隔で実行されました。 TCP erro rコード10060: 接続されたホストが103.229.5.53:8201に応答しなかったため、接続された当事者が が応答しなかったために接続が失敗しました。 –

+0

私はmmyファイアウォールをオフにしてもそれを走らせましたが、それでもまだ動作しません。 –

答えて

1

問題は、IPアドレスが含まれているURLに接続するためのCRMオンライン利用できないことに関連することができます。これはシステムの制限です。 IPの代わりにドメイン名を使用するようにしてください

+0

ありがとう、私はそれを修正しました。 –

関連する問題