Author |
Message
|
DeadPool |
Posted: Fri May 12, 2017 2:49 am Post subject: REST Request Node - Overridding the Operation |
|
|
Apprentice
Joined: 27 May 2016 Posts: 30
|
All
Have an interesting issue here.
We have a rquirement whereby we have a message flow which ends with a RESTRequest node.
Initial investigation showed that the Operatioin (PUT GET etc) had to be set in the node and therefore we would need to have separate REST nodes for each Operation.
Digging through the "paperwork" we found that the specific operation could be overridden by setting the localenvironment value
SET OutputLocalEnvironment.Destination.REST.Request.Operation
So firstly we created a version where the Operation was set in teh Node and we had a successful response.
Secondly we had a Swagger file with all operations defined so that it would override the Operation and set the value.
This fails with a content length error
Code: |
X-Original-HTTP-Status-Line:CHARACTER:HTTP/1.1 411 Length Required
X-Original-HTTP-Status-Code:INTEGER:411
Content-Type:CHARACTER:text/xml; charset=UTF-8
Content-Length:CHARACTER:168
Set-Cookie:CHARACTER:BIGipServerP_API2PROD-APIMGMT.SAPSF.EU-9001=1175781898.10531.0000; path=/ |
Looking at teh messages in debug prior to the REST node they are identical and both have
Code: |
HTTPRequestHeader
Authorization:CHARACTER:Basic QVBJX1NDUElAcGV0c2F0aG9tZUQ6dUtlaXdvcyE5M2xqeQ==
Content-Length:CHARACTER:287 |
So am assuming something is wrong when the override happens in the node.
My questions
1 Has anyone else experienced this
2 What was the resolution (if any)
Thanks in advance |
|
Back to top |
|
 |
mqjeff |
Posted: Fri May 12, 2017 4:29 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
1) did the message flow work with a predefined operation on the node?
2) Did you ensure that the compute node was passing the LocalEnvironment to the next node?
3) Do you see an error on the REST service? (the thing you are calling) _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
DeadPool |
Posted: Mon May 15, 2017 1:06 am Post subject: |
|
|
Apprentice
Joined: 27 May 2016 Posts: 30
|
mqjeff wrote: |
1) did the message flow work with a predefined operation on the node?
YES
2) Did you ensure that the compute node was passing the LocalEnvironment to the next node?
YES
3) Do you see an error on the REST service? (the thing you are calling)
NO - as it failed in IIB with content length error
|
|
|
Back to top |
|
 |
martinb |
Posted: Tue May 16, 2017 12:52 am Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
Hi
What is the actual BIP....E: / exception you receive for this issue?
You've said the RestRequest node worked with the operation predefined on the node, but have you tested both of the operations in this manner?
You mention GET and PUT in relation to the different operations you want to perform, is it correct that these should be taking the same message body content? |
|
Back to top |
|
 |
DeadPool |
Posted: Tue May 16, 2017 1:11 am Post subject: |
|
|
Apprentice
Joined: 27 May 2016 Posts: 30
|
OK couple of things
- am working on this via proxy (ie not me someone else and they feeding e)
- if the operation id is "updateUserID" in the swagger file and this value is defined in the NODE then we have a succesful message
HOWEVER
if we override that value with a different operatioin with
Code: |
SET OutputLocalEnvironment.Destination.REST.Request.Operation = 'updateCustomerByID'; |
then we get the error of
Code: |
X-Original-HTTP-Status-Line:CHARACTER:HTTP/1.1 411 Length Required
X-Original-HTTP-Status-Code:INTEGER:411
Content-Type:CHARACTER:text/xml; charset=UTF-8
Content-Length:CHARACTER:168
Set-Cookie:CHARACTER:BIGipServerP_API2PROD-APIMGMT.SAPSF.EU-9001=1175781898.10531.0000; path=/ |
showing up within the debug perspective
I will try and get hold of the BIP message |
|
Back to top |
|
 |
martinb |
Posted: Tue May 16, 2017 2:50 am Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
HTTP Status Code 411 (Length Required) is sent by the server as a response when it refuses to accept a message without a content-length header
updateCustomerByID and updateUserID likely need different parameters and body content.
As I noted you need to first setup a predefined RESTRequest node for each operation and then confirm the full set of properties you need to override in addition to the "Operation".
For example
LocalEnvironment.Destination.REST.Request.Parameters.<..>
The response from the server suggest the RESTRequest did not locate anything for the outgoing request body. This is set via the "Input body location" property on the node. This does not have a local environment override, so you'll need to ensure for both operations you provide the content at the same location. |
|
Back to top |
|
 |
DeadPool |
Posted: Tue May 16, 2017 2:54 am Post subject: |
|
|
Apprentice
Joined: 27 May 2016 Posts: 30
|
martin thanks
So basically as long as teh input body location points to teh same place we can put anything in there, as long as valid formats and content etc
mmm so sounds like as you say each one needs to be built and tested individually then we can consolidate them in a SWAGGER file for overriding and building of content |
|
Back to top |
|
 |
mqjeff |
Posted: Tue May 16, 2017 4:02 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
DeadPool wrote: |
mmm so sounds like as you say each one needs to be built and tested individually then we can consolidate them in a SWAGGER file for overriding and building of content |
I think he's saying that you should build and tested using separate REST request nodes, and then consolidate each successful part into one flow calling the rest service using a dynamic node configuration.
That is, make sure you can send the right message to the right operation, then combine the logic to use one node... _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
martinb |
Posted: Tue May 16, 2017 7:31 am Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
Yep that's the approach to adopt, thank mqjeff |
|
Back to top |
|
 |
|