Skip to Content
author's profile photo Former Member
Former Member

SOAP receiver query

Hi,

I am connecting SAP CPI to a SOAP receiver web service.

But, I am stuck in a requirement.

If SOAP response contains more than 100 employee data, then I have to make another call to SOAP receiver with a fieldname Start=100 , 200,300 etc.. But, How to know that whether the SOAP response has more than 100 fields and how many more call CPI should make.. Is it possible in CPI ?

Regards

Add a comment
10|10000 characters needed characters exceeded

Related questions

7 Answers

  • Best Answer
    Posted on Jul 27, 2020 at 02:46 PM

    Hi Former Member,

    Please find below the blog-post.

    https://blogs.sap.com/2020/07/27/handle-dynamic-paging-for-odata-services-using-looping-process-call/

    Hope this helps !

    thanks and regards,

    Praveen T

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 01, 2020 at 08:01 AM

    Hi Former Member,

    You could keep a [Router] Step after your first webservice call and have a two routes.

    Route 1 --> condition --> [/root/count(node1)>100]

    Route 2 -> default.

    Now apply logic in Route 1 for making next call.

    hope this helps !

    thanks and regards,

    Praveen T

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 01, 2020 at 04:32 PM

    Hi,

    Once you receive the soap response, I think in the content modifier you can use the expression to count the number of records it has with the below expression. Once you have the count then you can proceed.

    Example 1 :- count(//cricketers/cricketer)
    2 :- count(//element/Element1[namespace-uri()='mynamespace'])

    Thanks and Regards,

    Vijay.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 13, 2020 at 12:28 PM

    Praveen Tirumareddy , Vijay Kumar Kapuganti , Sriprasad Shivaram Bhat

    I have clear question now on this topic.

    In receiver webservice, totalrecords field is containing how many number of employees details need to be sent. If totalrecords field is 250. Then web service call need to be made using field start. If start=1 pick first 100 records. If start = 101 pick next 100 records. If start = 201 pick rest records till 250.

    totalrecords field can be any number may be 1000,1150 etc..

    How to ensure that CPI picks all records in batch of 100 in this case.

    Can you please try to help on it.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 13, 2020 at 01:48 PM

    Hi Former Member,

    You have to use looping process and within that you have write a custom code to use this start & pick.

    it should something like below:

    1) fetch call total count of records

    2) make looping process call

    a --> set sart & pick

    b --> make api call

    c --> see if you have reached max exit the looping process else continue a -> b -> c

    Hope this helps !

    thanks and regards,

    Praveen T

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi.

      How to put The totalrecords field logic. Its dynamic , if its less than 101 then web service need to be called 1 time, if it is less than 201 then web service need to be called 2 times and henceforth. It can be any number.

      and I have to increase start field as 1 for 1st call, 101 for 2nd call etc.

      Can you let me know the code and where to put this logic in detail.

      Regards

  • Posted on Jul 15, 2020 at 01:11 PM

    Hi Vijay,

    Yes hence I have asked you to use looping process and set the exit condition based on the dynamic total count. The exit condition would be set within looping process based on the the total count you would have received before making looping process call.

    thanks and regards,

    Praveen T

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Praveen Tirumareddy ,

      Thanks for your reply.

      I did these 2 steps -

      1) fetch call total count of records

      2) make looping process call - What will be my condition expresession here as I do not the maximum number of totRecords. It may be 10,000 or 100,000 etc... What shall I put here ${header.totRecords} = '10000'

      Please let me know how can I change start field in soap request dynamically so that it is Start=100,200,300 etc.

      Regards

  • Posted on Jul 21, 2020 at 04:00 PM

    Hi Vijay,

    That's the interesting piece.

    You can set a flag as false before you start local process.

    Then you start subtracting or reducing total count in the looping process after every call and then set the flag once you are exhausted.(There are different ways you could achieve this)

    hope this helps !

    thanks and regards,

    Praveen T

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.