BPM, Workflow, and Case

 View Only
Expand all | Collapse all

Getting Error 400 Bad request while calling the BPM REST service hosted on bpm cloud trail version

  • 1.  Getting Error 400 Bad request while calling the BPM REST service hosted on bpm cloud trail version

    Posted Tue April 14, 2020 12:28 PM
    Hi

    I have created simple service in cloud bpm and trying to call with SOAP UI/Postman however i am not getting response. Any pointers would be appreciated.


    ------------------------------
    Niranjan Hiremath
    ------------------------------


  • 2.  RE: Getting Error 400 Bad request while calling the BPM REST service hosted on bpm cloud trail version

    Posted Tue April 14, 2020 03:18 PM
    It would be helpful if you supplied more data, some specifics that would help - 
    • Is this asset created in Process Designer or IID?
    • What steps did you take in creating it?
    • What did you do to expose it for invocation?
    • Can you share the call you made to invoke the service?

    The data you've provided so far is very vague, which means the community isn't sure where to start in order to attempt to duplicate your use case.

    ------------------------------
    Andrew Paier
    ------------------------------



  • 3.  RE: Getting Error 400 Bad request while calling the BPM REST service hosted on bpm cloud trail version

    Posted Wed April 15, 2020 01:48 PM
    ould be helpful if you supplied more data, some specifics that would help - 


    ------------------------------
    Niranjan Hiremath
    ------------------------------



  • 4.  RE: Getting Error 400 Bad request while calling the BPM REST service hosted on bpm cloud trail version

    Posted Thu April 16, 2020 11:27 AM
    TBH, a more through set of details would be nice when you are asking people to take time out of their day to help you with your issues.  Keeping your responses to the minimum required to answer the question doesn't make one inclined to help out.  For example, here is the writeup of the steps I took to attempt to duplicate the problem you are articulating -

    Hey there!  I was unable to duplicate the issue you encountered so I'm not sure what is different.  As a side note I tried this on BAW 190001 Here are the steps I took -

    SETUP - 
    (How I created the service)
    1. In the Process Designer I created a new service called "Test Invocation".
    2. Created an output variable called "randomOutput" of type string.
    3. Added a Script task between the begin and end that sets the variable to "Hi There!"
    4. Went to the over view t​ab and under "Ajax Access" I clicked the "Allow calls from all users" value.
    CALL SETUP
    (how I got the details for my call)
    I don't tend to trust invocation by names, since it is easy for a developer to easily change the name an break an integration.  So my default is to invoke the items by GUID.  To get the GUID I did the following -
    1. Get the list of PA - GET /rest/bpm/wle/v1/processApps
    2. Find my PA in the list.
    3. Get the Assets for my PA -  GET GET /rest/bpm/wle/v1/assets?processAppId=2066.931c959c-101c-498c-9726-79c4f6d22c22
    4. Find my service in the list.

    INVOKE SERVICE
    Using the above Invoked the service - /rest/bpm/wle/v1/service/1.b32cb247-b82e-4f92-b526-5cc5a1e6dd26?action=start&createTask=false&parts=all

    This worked.  So I tried the way you did it - /rest/bpm/wle/v1/service/ZZAPSND@Test%20Invocation?action=start&createTask=false&parts=all

    Which also worked.  But then I noticed you %40, so I tried that - /rest/bpm/wle/v1/service/ZZAPSND%40Test%20Invocation?action=start&createTask=false&parts=all

    And this worked as well.  A bit stymied I tried doing wrong things to duplicate the problem.  

    • I restarted my ReST app to make sure I didn't have some authentication cached.  That didn't cause a problem.
    • I tried giving the wrong app short name - that gave a 404
    • Incorrect service name - 404
    • Modified service to allow no AJAX calls - 401
    • Modified service to allow calls from "Trusted Users" - 400 !  Aha!
    I then added "Basic Auth" to my call.  Still the same problem!  But there is an error message ! -

    CWTBG0022E: The 'callerTaskId' or 'callerModelId' query parameter was required but was not specified.  Looking at the documentation (here) it says that the ModelId is required for secured AJAX calls.  I honestly have no clue what to pass for that in this scenario, so I reset the access to "All Users" to see if I could find another way to cause the problem.  (Buy you should totally double check that setting).

    • Added bad code to service - result 500
    • Added input variable "randomInput" to the service - result 200

    Honestly at this point, without some sort of way to reproduce your underlying issue, I'm at a loss for how to help you.  The only way I was able to get the response you got was to do something different from what you've said you have done.



    ------------------------------
    Andrew Paier
    ------------------------------