web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Sending a Retrieve request via SOAP

(0) ShareShare
ReportReport
Posted on by

I am currently doing some preliminary testing using SOAPUI and have hit the first stumbling block with retrieving data from the system, I have generated my CipherValues and KeyIdentifier but am unsure of how to implement these in a security header for the retrieve message.

I am struggling to find any information regarding SOAP connections to Dynamics CRM Online, so I have extracted what I assume to be the security header from the SDK example project and have attempted the below message structure with no success.

Does anyoune have any examples with the security header? or know where i can find some more infomation on testing with SOAP

Endpoint URL: https://[SITE ADDRESS].api.crm.dynamics.com/XRMServices/2011/Organization.svc/web

<soap:Envelope xmlns:soap="www.w3.org/.../soap-envelope" xmlns:ser="schemas.microsoft.com/.../Services" xmlns:con="schemas.microsoft.com/.../Contracts" xmlns:arr="schemas.microsoft.com/.../Arrays">
   <soap:Header>
<EncryptedData     xmlns="www.w3.org/.../xmlenc"     Id="Assertion0"     Type="www.w3.org/.../xmlenc">
	<EncryptionMethod         Algorithm="www.w3.org/.../xmlenc"/>
	<ds:KeyInfo         xmlns:ds="www.w3.org/.../xmldsig">
		<EncryptedKey>
			<EncryptionMethod                 Algorithm="www.w3.org/.../xmlenc"/>
			<ds:KeyInfo Id="keyinfo">
				<wsse:SecurityTokenReference       xmlns:wsse="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-secext-1.0.xsd">
					<wsse:KeyIdentifier        EncodingType="docs.oasis-open.org/.../oasis-200401-wss-soap-message-security-1.0"                         ValueType="docs.oasis-open.org/.../oasis-200401-wss-x509-token-profile-1.0">[IDENTIFIER]</wsse:KeyIdentifier>
				</wsse:SecurityTokenReference>
			</ds:KeyInfo>
			<CipherData>
				<CipherValue>[FIRST VALUE]</CipherValue>
			</CipherData>
		</EncryptedKey>
	</ds:KeyInfo>
	<CipherData>
		<CipherValue>[SECOND VALUE]</CipherValue>
	</CipherData>
</EncryptedData>
	</soap:Header>
   <soap:Body>
      <ser:Retrieve>
         <!--Optional:-->
         <ser:entityName>contact</ser:entityName>
         <!--Optional:-->
         <ser:id>5CDAA018-1803-E611-811F-C4346BAC0910</ser:id>
         <!--Optional:-->
         <ser:columnSet>
            <!--Optional:-->
            <con:AllColumns>false</con:AllColumns>
            <!--Optional:-->
            <con:Columns>
               <!--Zero or more repetitions:-->
               <arr:string>fullname</arr:string>
            </con:Columns>
         </ser:columnSet>
      </ser:Retrieve>
   </soap:Body>
</soap:Envelope>

- Additional SOAP Header Paramaters -

Content-Type: text/xml; charset=utf-8

SOAPAction: schemas.microsoft.com/.../Retrieve

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ScottDurow Profile Picture
    21 on at
    RE: Sending a Retrieve request via SOAP

    Hi,

    When using the Organization.svc/web endpoint, you don't need the security header because it's handled by cookies that are created by the user authentication when they log on.

  • Community Member Profile Picture
    on at
    RE: Sending a Retrieve request via SOAP

    Hi Scott,

    I appreciate the Quick response, I am probably using the wrong endpoint when downloading the Organization.wsdl the endpoint is

    https://[SITE ADDRESS].api.crm.dynamics.com/XRMServices/2011/Organization.svc

    Would I then requite a security header when Sending a Retrieve request via SOAP

    I am trying to break down the individual steps from the SDK sample project and see if I can replicate the process using SOAPUI,

    e.g.

    Security token request (I have successfully retrieved the values for the security header)

    retrieve contact / account / opportunity requests

    update opportunity request

    delete opportunity  request

    Thanks for your assistance

    Ryan

  • Suggested answer
    ScottDurow Profile Picture
    21 on at
    RE: Sending a Retrieve request via SOAP

    Hi,

    If you are accessing Dynamics crm from an external system then you are probably better of using the new WebAPI.

    https://msdn.microsoft.com/en-us/library/mt593051.aspx

    If you really need to use the SOAP endpoint then you should use OAuth - see https://msdn.microsoft.com/en-us/library/mt593051.aspx

  • Verified answer
    ScottDurow Profile Picture
    21 on at
    RE: Sending a Retrieve request via SOAP

    Of course if you are using C# - you should use the OrganizationServiceProxy class in the SDK assemblies - www.microsoft.com/.../details.aspx

  • ScottDurow Profile Picture
    21 on at
    RE: Sending a Retrieve request via SOAP

    How did you get on? Do you need any more help?

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Sending a Retrieve request via SOAP

    Hi Scott,

    Thanks for your assistance it looks i should be utalizing the new the new webAPI using OAuth as i will be accessing Dynamics from an external system and will need to use the SOAP endpoint.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
UllrSki Profile Picture

UllrSki 2

#3
SC-08081331-0 Profile Picture

SC-08081331-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans