MultiSelect Picklist Attribute Metadata not returned when using OAuth authentication in Dynamics CRM (Online version).

0
23
Role Image


When using OAuth authentication in Dynamics CRM Online MultiSelectPicklistAttributeMetadata EntityType is not returned . The request being sent is like below:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	<soap:Body>
		<Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
			<request i:type="a:RetrieveEntityRequest" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
				<a:Parameters xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
					<a:KeyValuePairOfstringanyType>
						<b:key>EntityFilters</b:key>
						<b:value i:type="c:EntityFilters" xmlns:c="http://schemas.microsoft.com/xrm/2011/Metadata">Attributes Relationships</b:value>
					</a:KeyValuePairOfstringanyType>
					<a:KeyValuePairOfstringanyType>
						<b:key>MetadataId</b:key>
						<b:value i:type="c:guid" xmlns:c="http://schemas.microsoft.com/2003/10/Serialization/">00000000-0000-0000-0000-000000000000</b:value>
					</a:KeyValuePairOfstringanyType>
					<a:KeyValuePairOfstringanyType>
						<b:key>RetrieveAsIfPublished</b:key>
						<b:value i:type="c:boolean" xmlns:c="http://www.w3.org/2001/XMLSchema">false</b:value>
					</a:KeyValuePairOfstringanyType>
					<a:KeyValuePairOfstringanyType>
						<b:key>LogicalName</b:key>
						<b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">contact</b:value>
					</a:KeyValuePairOfstringanyType>
				</a:Parameters>
				<a:RequestId i:nil="true"/>
				<a:RequestName>RetrieveEntity</a:RequestName>
			</request>
		</Execute>
	</soap:Body>
</soap:Envelope>

 

However, when I use Basic authentication, I can get these fields. I noticed that with this form of authentication I get as part of the metadata the attribute type for these fields and its data related. I have included the request and the response below.

 

Request:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
	<soap:Header>
		<a:Action soap:mustUnderstand="1">
    http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute</a:Action>
		<SdkClientVersion xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">9.0.9002.0</SdkClientVersion>
		<a:MessageID>
    urn:uuid:xxxxx</a:MessageID>
		<a:ReplyTo>
			<a:Address>
      http://xxxx</a:Address>
		</a:ReplyTo>
		<a:To soap:mustUnderstand="1">
    https://xxx.crm.dynamics.com/XRMServices/2011/Organization.svc</a:To>
		<o:Security soap:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
			<u:Timestamp xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" u:Id="_0">...
			</u:Timestamp>
			<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
				<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
				<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
					<EncryptedKey>
						<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
							<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
						</EncryptionMethod>
						<ds:KeyInfo>
							<wsse:SecurityTokenReference xmlns:wsse="xxxxxx">
								<wsse:KeyIdentifier ValueType="http://xxxx.SubjectKeyIdentifier" EncodingType="http://docs.xxxx.wss-soap-message-security-1.0#Base64Binary">xxxxx</wsse:KeyIdentifier>
							</wsse:SecurityTokenReference>
						</ds:KeyInfo>
						<CipherData>
							<CipherValue>xxxxxxxxx</CipherValue>
						</CipherData>
					</EncryptedKey>
				</ds:KeyInfo>
				<CipherData>
					<CipherValue>xxxxxxxxx</CipherValue>
				</CipherData>
			</EncryptedData>
		</o:Security>
	</soap:Header>
	<soap:Body>
		<Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
			<request i:type="a:RetrieveEntityRequest" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
				<a:Parameters xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
					<a:KeyValuePairOfstringanyType>
						<b:key>EntityFilters</b:key>
						<b:value i:type="c:EntityFilters" xmlns:c="http://schemas.microsoft.com/xrm/2011/Metadata">Attributes Relationships</b:value>
					</a:KeyValuePairOfstringanyType>
					<a:KeyValuePairOfstringanyType>
						<b:key>MetadataId</b:key>
						<b:value i:type="c:guid" xmlns:c="http://schemas.microsoft.com/2003/10/Serialization/">00000000-0000-0000-0000-000000000000</b:value>
					</a:KeyValuePairOfstringanyType>
					<a:KeyValuePairOfstringanyType>
						<b:key>RetrieveAsIfPublished</b:key>
						<b:value i:type="c:boolean" xmlns:c="http://www.w3.org/2001/XMLSchema">false</b:value>
					</a:KeyValuePairOfstringanyType>
					<a:KeyValuePairOfstringanyType>
						<b:key>LogicalName</b:key>
						<b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">contact</b:value>
					</a:KeyValuePairOfstringanyType>
				</a:Parameters>
				<a:RequestId i:nil="true"/>
				<a:RequestName>RetrieveEntity</a:RequestName>
			</request>
		</Execute>
	</soap:Body>
</soap:Envelope>

Response:

<d:AttributeMetadata i:type="e:MultiSelectPicklistAttributeMetadata" xmlns:e="http://schemas.microsoft.com/xrm/9.0/Metadata">
	...
</d:AttributeMetadata>

 

 

Is there any type of configuration that needs to be made in my custom app to get these fields when using OAuth authentication? Or any kind of configuration from the UI of my account?

 

Thanks for the help.



Source link

Leave a reply

Please enter your comment!
Please enter your name here