0

サーバーを変更しましたが、fechxml で問題が発生しました。他のすべての SOAP サービスは、更新、作成、削除、フェッチの期待など、100% 動作していますが、これが発生する理由や理由がわかりません。

メッセージ エラー:

@"Server was unable to process request.
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at ws.CrmService.CrmService.Fetch(String fetchXml) in c:\CRMServer\ws\ws\Web References\CrmService\Reference.cs:line 180
       at wsService.Crm2013test(String nomechave) in c:\CRMServer\ws\ws\test\test2013.cs:line 416"

Reference.cs ファイル:

[System.Web.Services.Protocols.SoapHeaderAttribute("CorrelationTokenValue")]
[System.Web.Services.Protocols.SoapHeaderAttribute("CrmAuthenticationTokenValue")]
[System.Web.Services.Protocols.SoapHeaderAttribute("CallerOriginTokenValue")]         [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/crm/2007/WebServices/Fetch",
 RequestNamespace="http://schemas.microsoft.com/crm/2007/WebServices",
 ResponseNamespace="http://schemas.microsoft.com/crm/2007/WebServices",
 Use=System.Web.Services.Description.SoapBindingUse.Literal,
 ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string Fetch(string fetchXml) {
    object[] results = this.Invoke("Fetch", new object[] {fetchXml});
    return ((string)(results[0]));
}

test2013 ファイル:

 public PrxActivityResult Crm2013test(string nomechave)

{
    PrxActivityResult res = new PrxActivityResult();
    Tb_Log_Create("WS.Crm2013test", "Entrada", "Codigo; valor:" + nomechave, "Anónimo");


    try
    {

        OrganizationServiceProxy organizationProxy = CrmServiceManager.GetOrganisationServiceProxy();
        CrmService service = CrmServiceManager.GetCrmService();

        Microsoft.Xrm.Sdk.Query.ConditionExpression condition = new Microsoft.Xrm.Sdk.Query.ConditionExpression("name", Microsoft.Xrm.Sdk.Query.ConditionOperator.Like, new string[] { nomechave });

        Microsoft.Xrm.Sdk.Query.FilterExpression filter = new Microsoft.Xrm.Sdk.Query.FilterExpression();
        filter.AddCondition(condition);
        filter.FilterOperator = Microsoft.Xrm.Sdk.Query.LogicalOperator.And;

        Microsoft.Xrm.Sdk.Query.QueryExpression query = new Microsoft.Xrm.Sdk.Query.QueryExpression();
        query.EntityName = "account";
        query.ColumnSet = new Microsoft.Xrm.Sdk.Query.ColumnSet(true);
       // query.Criteria = filter;

        EntityCollection ec = organizationProxy.RetrieveMultiple(query);

        string fetchXml = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
            <entity name='account'>
            <attribute name='name'/>
            <attribute name='telephone1'/>
            </entity></fetch>";

        string ret = service.Fetch(fetchXml);
        res.XmlContent = ret;

        }


    catch (Exception ex)
    {
    }
    return res;
}

誰もが何であるかの考えを持っていますか? どうもありがとう

4

1 に答える 1

1

他に何かあるかどうかはわかりませんが</Entity>、フェッチ XML に終了タグがありません。

編集

なぜあなたはFetch SOAPを所有しているのか疑問に思っています。

次のようなことをするだけです:

string fetchXml = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
    <entity name='account'>
    <attribute name='name'/>
    <attribute name='telephone1'/>
</fetch>";

EntityCollection ec = organizationProxy.RetrieveMultiple(new FetchExpression(fetchXml));

また、OrganizationServiceProxyimplementsIDisposibleとそのため、using ステートメントでラップする必要があります。

于 2013-09-25T18:23:10.953 に答える