Skip to Content

How to get the incoming payload based on the condition

Dear All.

Please find my scenario snapshot

Requirement is:

when we receive the incoming payload we need post the records to Odata.

the validation is:

before posting we need to check the Odata service whether it's exist or not. if records are exist we need send a mail saying that 'the records already exist' else we need to post the records to Odata.

the validation result is:

if the records are exist in Odata i'm getting a records from Odat like below

<Invoices>
    <Invoice>
      <BuyerID/>
      <VendorName>Roield</VendorName>
      <VendorNo>4716001571</VendorNo>
      <StatusID>01</StatusID>
      <InvoiceNo>R20</InvoiceNo>
      <StatusDesc>Received</StatusDesc>
      <InvoiceAmt>-144309</InvoiceAmt>
      <InvoiceDate>2016-10-31T13:51:39.000</InvoiceDate>
      <Currency>INR</Currency>
      <BuyerName>Technologies Private Limited</BuyerName>
    </Invoice>
  </Invoices>


if the records are not exist, i'm getting an response value from OData like below

 <Invoices/>

And the condition which i placed is working fine is working fine.

the issue is:

when , if the records are not available in OData we need to post the actual incoming payload, but the condition passing the value only <Invoices/> .

how can i get the actual payload here.

please suggest further.

Regards

Ramesh

t1.png (47.5 kB)
t2.png (15.0 kB)
t3.png (26.4 kB)
t4.png (46.5 kB)
t5.png (46.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Feb 03, 2017 at 01:38 PM

    Hello Ramesh,

    Its very easy to do using Properties and content Modifier .

    1 ) You need to include 2 content Modifier like below one to store and another to restore.

    First Content Modifier:

    Set the property to hole incoming message ( ${in.body} ).

    Second Content Modifier:

    Call the property set before Request Reply to Body part which will restore the original message.

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 04, 2017 at 07:07 AM

    Thank you Sri. it's working.

    i can see ${body} and {in.body} is working fine in property value. is there any differences.

    Regards

    Ramesh

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 04, 2017 at 02:07 PM

    Hello Ramesh,

    There is no difference between ${body} and ${in.body} as per the Apache Documentation both of them refers to input message body.Similarly there is some thing called ${out.body} which refers to output body.

    From SAP HCI perspective we use input message expressions more.

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded