locked
Problem while trying to get meta data from entity in CRM 2011 using java RRS feed

  • Question

  • Hi,

    I have been trying to get the meta data from entity. Below is the code what i have tried.                                                                                                                                                                 

    EntityFilters entfilter = new EntityFilters();

    EntityFilters_type0 eftypes [] = new EntityFilters_type0[]{EntityFilters_type0.Attributes};
    entfilter.setEntityFilters_type0(eftypes);

    EntityFiltersE entityFiltersE = new EntityFiltersE();
    entityFiltersE.setEntityFilters(entfilter);

    Boolean RAIP = new Boolean(true);

    OrganizationServiceStub.ParameterCollection parameterCollection = new OrganizationServiceStub.ParameterCollection();
    OrganizationServiceStub.KeyValuePairOfstringanyType entityFilters = new OrganizationServiceStub.KeyValuePairOfstringanyType();
    entityFilters.setKey("EntityFilters");
    entityFilters.setValue(entityFiltersE);
    OrganizationServiceStub.KeyValuePairOfstringanyType retAsIfPublished = new OrganizationServiceStub.KeyValuePairOfstringanyType();
    retAsIfPublished.setKey("RetrieveAsIfPublished");
    retAsIfPublished.setValue(RAIP);
    parameterCollection.addKeyValuePairOfstringanyType(entityFilters);
    parameterCollection.addKeyValuePairOfstringanyType(retAsIfPublished);

    OrganizationServiceStub.OrganizationRequest request=new OrganizationServiceStub.OrganizationRequest();
                request.setRequestName("RetrieveAllEntities");
                request.setParameters(parameterCollection);

                OrganizationServiceStub.Execute org_execute = new OrganizationServiceStub.Execute();
                org_execute.setRequest(request);

    ExecuteResponse resp  =  serviceStub.execute(org_execute);

    And getting the below error.

    [ERROR] The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.microsoft.com/xrm/2011/Contracts/Services:request. The InnerException message was 'Element value from namespace http://schemas.datacontract.org/2004/07/System.Collections.Generic cannot have child contents to be deserialized as an object. Please use XmlNode[] to deserialize this pattern of XML.'.  Please see InnerException for more details.

    Please help me if any one have an idea on this error.

    Thanks in advance.

    Friday, September 13, 2013 12:27 PM

All replies