Skip to Content

Hi Everyone,

Below are the payload request details required to post complex business entities( 1 : N records) into gateway framework.

Scenario : Header with 1 product and multiple notes

XML payload:

<?xml version=”1.0″ encoding=”UTF-8″?>

<atom:entry xmlns:atom=”http://www.w3.org/2005/Atom” xmlns:d=”http://schemas.microsoft.com/ado/2007/08/dataservices” xmlns:m=”http://schemas.microsoft.com/ado/2007/08/dataservices/metadata“>

<atom:content type=”application/xml”>

<m:properties>

    <d:Partner>3602102164</d:Partner>

    <d:Category m:null=”true”/>   

    <d:CommType m:null=”true”/>

    <d:Telephone>9944380099</d:Telephone>

    <d:Email>prabaasokan@gmail.com</d:Email>

</m:properties>

</atom:content>

<atom:link rel=”http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products” type=”application/atom+xml;type=feed” title=”Sales_Products”>

<m:inline>

    <atom:feed>

        <atom:entry>

            <atom:content type=”application/xml”>

            <m:properties>             

             <d:ProductId>G_CLEARSIMPLE</d:ProductId>

              <d:ProductGuid></d:ProductGuid>

                <d:ShortText m:null=”true”/>

                <d:BaseCategoryId>4545</d:BaseCategoryId>

                <d:BaseCategoryDesc m:null=”true”/>

            </m:properties>

        </atom:content>

    </atom:entry>

</atom:feed>

</m:inline>

</atom:link>

<atom:link rel=”http://schemas.microsoft.com/ado/2007/08/dataservices/related/Notes” type=”application/atom+xml;type=feed” title=”Sales_Notes”>

<m:inline>

    <atom:feed>

        <atom:entry>

            <atom:content type=”application/xml”>

            <m:properties>

                <d:Tdformat>*</d:Tdformat>

  <d:Tdline>[SUMMARY]Please check the functionality and correct the issues in both</d:Tdline>                 

            </m:properties>

        </atom:content>

    </atom:entry>

      <atom:entry>

            <atom:content type=”application/xml”>

            <m:properties>

                <d:Tdformat>*</d:Tdformat>

  <d:Tdline>the products[SUMMARY][ACTIONS]Please check the functionality and correct</d:Tdline>                 

            </m:properties>

        </atom:content>

    </atom:entry>

    <atom:entry>

            <atom:content type=”application/xml”>

            <m:properties>

                <d:Tdformat>*</d:Tdformat>

  <d:Tdline>the issues in both the products[ACTIONS]</d:Tdline>                 

            </m:properties>

        </atom:content>

    </atom:entry>

</atom:feed>

</m:inline>

</atom:link>

</atom:entry>

JSON payload – Navigation property points to a multiple cardinality entity:Header with 1 product and 3 notes.(Separate first 2 notes by comma operator and last entry without comma)

{

“Partner”:”3602102164″,

“CommType”:”mobile”,

“Telephone”:”877845545″,

“Email”:”prabaasokan@gmail.com“,

Products“:[{

“ProductId”:”G_CLEARSIMPLE”,

“ProductGuid”:”0001″,

“ShortText”:”test”,

“BaseCategoryId”:”5656″,

“BaseCategoryDesc”:”” }],

Notes“:[{

“Tdformat”:”*”,

“Tdline”:”[SUMMARY]Please check the functionality and correct the issues in both”

},

{

“Tdformat”:”*”,

“Tdline”:”the products[SUMMARY][ACTIONS]Please check the functionality and correct”

},

{

“Tdformat”:”*”,

“Tdline”:”the issues in both the products[ACTIONS]”

}

]

}

JSON payload – Navigation property points to a single cardinality entity:Header with 1 product and 1 note.


{

“BusPartner”:”3602102164″,

“Telephone”:”9944380099″,

“Email”:”prabaasokan@gmail.com“,

Products“:[{

“ProductId”:”G_CLEARSIMPLE”,

“ProductGuid”:”0001″,

“ShortText”:”Test”,

“BaseCategoryId”:”5655″,

“BaseCategoryDesc”:”Utility” }],

Notes“:[{

“Format”:”*”,

“Line”:”[SUMMARY]Please check the functionality and correct the issues in both” }]

}

Note: Bold ones are the Navigation properties.

Cheers 🙂

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply