thuphinguyen / php-dynamics-crm-2011

Automatically exported from code.google.com/p/php-dynamics-crm-2011
0 stars 0 forks source link

Enable use of the Create action #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Add functionality to the DynamicsCRM2011_Connector to send a Create request to 
the server.

A Create message looks like this:

<s:Envelope xmlns:s="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-util
ity-1.0.xsd">
    <s:Header>
        <a:Action s:mustUnderstand="1">http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Create</a:Action>
        <a:ReplyTo>
            <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
        </a:ReplyTo>
        <a:To s:mustUnderstand="1">https://customerportaldev.aldata-solution.com/XRMServices/2011/Organization.svc</a:To>
        <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            ...
        </o:Security>
    </s:Header>
    <s:Body>
        <Create xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services">
            <entity xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                <b:Attributes xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
                    <b:KeyValuePairOfstringanyType>
                        <c:key>name</c:key>
                        <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">Fourth Coffee</c:value>
                    </b:KeyValuePairOfstringanyType>
                </b:Attributes>
                <b:EntityState i:nil="true"/>
                <b:FormattedValues xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
                <b:Id>00000000-0000-0000-0000-000000000000</b:Id>
                <b:LogicalName>account</b:LogicalName>
                <b:RelatedEntities xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
            </entity>
        </Create>
    </s:Body>
</s:Envelope>

The response from the server looks like this:

<s:Envelope xmlns:s="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-util
ity-1.0.xsd">
    <s:Header>
        <a:Action s:mustUnderstand="1">http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/CreateResponse</a:Action>
        <a:RelatesTo>urn:uuid:af5c8672-0cb8-459c-8b4b-6622a0b40e9f</a:RelatesTo>
        <ActivityId CorrelationId="cf7de72a-a5dd-4297-a196-8463ebeba346" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">00000000-0000-0000-0000-000000000000</ActivityId>
        <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <u:Timestamp u:Id="_0">
                <u:Created>2012-02-28T11:36:45.398Z</u:Created>
                <u:Expires>2012-02-28T11:41:45.398Z</u:Expires>
            </u:Timestamp>
        </o:Security>
    </s:Header>
    <s:Body>
        <CreateResponse xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services">
            <CreateResult>bbe3847d-0062-e111-b520-00155d021910</CreateResult>
        </CreateResponse>
    </s:Body>
</s:Envelope>

Original issue reported on code.google.com by N.M.Pr...@gmail.com on 15 Mar 2012 at 2:07

GoogleCodeExporter commented 9 years ago
Changed to Enhancement

Original comment by N.M.Pr...@gmail.com on 15 Mar 2012 at 2:08

GoogleCodeExporter commented 9 years ago

Original comment by N.M.Pr...@gmail.com on 15 Mar 2012 at 2:08

GoogleCodeExporter commented 9 years ago

Original comment by N.M.Pr...@gmail.com on 15 Mar 2012 at 2:10

GoogleCodeExporter commented 9 years ago
Done - Commited changes including new Account class

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 12:07