Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Microsoft CRM entitie's attribute Metadata retreival error in J2EE Client using web service

$
0
0
Hello all. I just started using CRM with java client to retrieve entity data. it works fine when i query using GUID or retrieve all records. but when i try to get metadata of any entity's attribute, it gives following error.

    Caused by: org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Can not invoke the getTypeObject method in the extension mapper class     	at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)    	at com.gr.grid.crm.ws.client.OrganizationServiceStub.fromOM(OrganizationServiceStub.java:39738)    	at com.gr.grid.crm.ws.client.OrganizationServiceStub.execute(OrganizationServiceStub.java:2306)    	at com.gr.grcom.integration.mscrm.service.CRMMembershipSyncService.updateMembershipsFromCRM(CRMMembershipSyncService.java:216)    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_21]    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_21]    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_21]    	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_21]    	at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:202) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:306) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]    	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]    	at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]    	at com.gr.grcom.integration.mscrm.service.CRMMembershipSyncServiceLocal$$$view2.updateMembershipsFromCRM(Unknown Source)    	at com.gr.grcom.integration.mscrm.service.CRMIntegrationService.updateGRcom(CRMIntegrationService.java:40)    	... 41 more    Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Can not invoke the getTypeObject method in the extension mapper class     	at com.gr.grid.crm.ws.client.OrganizationServiceStub$KeyValuePairOfstringanyType$Factory.parse(OrganizationServiceStub.java:2608)    	at com.gr.grid.crm.ws.client.OrganizationServiceStub$ParameterCollection$Factory.parse(OrganizationServiceStub.java:11565)    	at com.gr.grid.crm.ws.client.OrganizationServiceStub$OrganizationResponse$Factory.parse(OrganizationServiceStub.java:51571)    	at com.gr.grid.crm.ws.client.OrganizationServiceStub$ExecuteResponse$Factory.parse(OrganizationServiceStub.java:18982)    	at com.gr.grid.crm.ws.client.OrganizationServiceStub.fromOM(OrganizationServiceStub.java:39725)    	... 83 more    Caused by: org.apache.axis2.databinding.ADBException: Can not invoke the getTypeObject method in the extension mapper class     	at org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(ConverterUtil.java:1642)    	at com.gr.grid.crm.ws.client.OrganizationServiceStub$KeyValuePairOfstringanyType$Factory.parse(OrganizationServiceStub.java:2585)    	... 87 more    Caused by: java.lang.reflect.InvocationTargetException    	at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source) [:1.7.0_21]    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_21]    	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_21]    	at org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(ConverterUtil.java:1633)    	... 88 more    Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://schemas.microsoft.com/xrm/2011/Contracts}CanBeChanged    	at com.gr.grid.crm.ws.client.OrganizationServiceStub$AttributeRequiredLevelManagedProperty$Factory.parse(OrganizationServiceStub.java:22152)    	at com.gr.grid.crm.ws.client.OrganizationServiceStub$StateAttributeMetadata$Factory.parse(OrganizationServiceStub.java:25949)    	at com.gr.grid.crm.ws.client.OrganizationServiceStub$ExtensionMapper.getTypeObject(OrganizationServiceStub.java:5803)    	... 92 more    Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://schemas.microsoft.com/xrm/2011/Contracts}CanBeChanged    	at com.gr.grid.crm.ws.client.OrganizationServiceStub$AttributeRequiredLevelManagedProperty$Factory.parse(OrganizationServiceStub.java:22146)    	... 94 more



the code is

Execute execute = new Execute(); 			OrganizationRequest orgReq = new OrganizationRequest();			orgReq.setRequestName("RetrieveAttribute"); 			KeyValuePairOfstringanyType asIfPublished = new KeyValuePairOfstringanyType(); 			asIfPublished.setKey("RetrieveAsIfPublished"); 			asIfPublished.setValue(true); 			KeyValuePairOfstringanyType entityLogicalName = new KeyValuePairOfstringanyType(); 			entityLogicalName.setKey("EntityLogicalName"); 			entityLogicalName.setValue("new_retailmembership"); 			KeyValuePairOfstringanyType logicalName = new KeyValuePairOfstringanyType(); 			logicalName.setKey("LogicalName"); 			logicalName.setValue("statecode"); 			KeyValuePairOfstringanyType metadataId = new KeyValuePairOfstringanyType(); 			metadataId.setKey("MetadataId"); 			Guid guid = new Guid(); 			guid.setGuid("00000000-0000-0000-0000-000000000000"); 			metadataId.setValue(guid); 			ParameterCollection params = new ParameterCollection(); params.addKeyValuePairOfstringanyType(metadataId); 			params.addKeyValuePairOfstringanyType(asIfPublished); 			params.addKeyValuePairOfstringanyType(entityLogicalName); 			params.addKeyValuePairOfstringanyType(logicalName); 						orgReq.setParameters(params); 			execute.setRequest(orgReq);   						ExecuteResponse execResponse = stub.execute(execute); 			OrganizationResponse orgResponse = execResponse.getExecuteResult(); 			ParameterCollection results = orgResponse.getResults(); 			KeyValuePairOfstringanyType[] resultsKeyVals = results.getKeyValuePairOfstringanyType();				OptionMetadata[] optionsMetadata = ((EnumAttributeMetadata)resultsKeyVals[0].getValue()).getOptionSet().getOptions().getOptionMetadata(); 			for(int i=0; i<optionsMetadata.length; i++){ 				logger.log(optionsMetadata[i].getValue()+""+ optionsMetadata[i].getLabel().getUserLocalizedLabel().getLabel()); 			}



   



I verified that data is being retrieved from CRM on my local machine using "Fiddler" as a proxy. following is the WSDL document of my Microsoft CRM

    <?xml version="1.0" encoding="utf-8"?><wsdl:definitions name="OrganizationService" targetNamespace="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:i0="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><wsdl:import namespace="http://schemas.microsoft.com/xrm/2011/Contracts/Services" location="http://devdyn01/devdyndb/XrmServices/2011/Organization.svc?wsdl=wsdl0"/><wsdl:types/><wsdl:service name="OrganizationService"><wsdl:port name="CustomBinding_IOrganizationService" binding="i0:CustomBinding_IOrganizationService"><soap12:address location="http://devdyn01/devdyndb/XrmServices/2011/Organization.svc"/><wsa10:EndpointReference><wsa10:Address>http://devdyn01/devdyndb/XrmServices/2011/Organization.svc</wsa10:Address><Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity"><Upn>LUCANE@GR.local</Upn></Identity></wsa10:EndpointReference></wsdl:port><wsdl:port name="CustomBinding_IOrganizationService1" binding="i0:CustomBinding_IOrganizationService1"><soap12:address location="https://devdyn01/devdyndb/XrmServices/2011/Organization.svc"/><wsa10:EndpointReference><wsa10:Address>https://devdyn01/devdyndb/XrmServices/2011/Organization.svc</wsa10:Address><Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity"><Upn>GR\LUCANE</Upn></Identity></wsa10:EndpointReference></wsdl:port></wsdl:service></wsdl:definitions>




no matter which entity or which attribute's metadata i retrieve, it gives the same error. plus it gives unknown attribute or unknown entity error when i retrieve non existing entity or its attribute. 
the connection is fine along with the authentication. 

Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>