You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`methodReturningList` returns a list of Strings. `methodAcceptingListArguments` accepts a list and returns its size. As
379
+
you can see we have passed the identity of the first call, `fetchStringsList` to the second one `fetchSubjects`. Here
380
+
is the return payload:
381
+
382
+
```JSON
383
+
{
384
+
"callDurations": {
385
+
"fetchStringsList": 5,
386
+
"fetchSubjects": 1
387
+
},
388
+
"returnValues": {
389
+
"fetchStringsList": [
390
+
"NA1",
391
+
"NA2",
392
+
"NA3",
393
+
"NA4"
394
+
],
395
+
"fetchSubjects": 4
396
+
}
397
+
}
398
+
```
399
+
322
400
#### Call Chaining and Instance Methods
323
401
324
402
We now have the possibility of injecting call results from one call to the other. In the example below we instantiate an
@@ -349,19 +427,66 @@ the `instance` value for the following call.
349
427
In the example above "ID-2" will use call the instance method of the object created in call "ID-1".
350
428
351
429
### Argument Types
430
+
352
431
Since we are using JSON to pass values to the method, we need to cover how different types are passed.
353
432
354
433
#### Simple Java Objects
434
+
355
435
The internal Java objects such as int, String and boolean can be passed with no problems
356
436
357
437
#### Lists and Arrays
358
-
List and Arrays can be passed as JSONArrays. IBS will transform them to the target argument when needed (_Available since 2.116_).
438
+
439
+
List and Arrays can be passed as JSONArrays. IBS will transform them to the target argument when needed (_Available
440
+
since 2.116_).
359
441
360
442
#### Complex Types
361
-
Some methods require complex Objects as arguments. In this case you need to have a constructor/factory call in one call, and pass they key as an argument.
443
+
444
+
Some methods require complex Objects as arguments. In this case you need to have a constructor/factory call in one call,
445
+
and pass they key as an argument.
362
446
363
447
#### Files
364
-
As of version 2.11.16 we have the possibility to pass a file to the bridgeService. When doing so, you need to send your request as a multi-part request. As in most multi-part requests, you need to give each uploaded file a key value. In that case the file is referenced with that key value.
448
+
449
+
As of version 2.11.16 we have the possibility to pass a file to the bridgeService. When doing so, you need to send your
450
+
request as a multi-part request. As in most multi-part requests, you need to give each uploaded file a key value. In
451
+
that case the file is referenced with that key value.
452
+
453
+
Below is an example using curl (_executed from the project root_). We are uploading the file `integroBridgeService/src/test/resources/uploadFiles/testaRosa.txt` with the id `uploaded_file`, like in call chaining we have passed this id to the method call `fileReader`, whose job is to return the file contents.
Copy file name to clipboardExpand all lines: integroBridgeService/src/main/java/com/adobe/campaign/tests/bridge/service/IntegroAPI.java
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ public class IntegroAPI {
48
48
protectedstaticfinalStringERROR_JAVA_OBJECT_NOT_ACCESSIBLE = "The java object you want to call is inaccessible. This is very possibly a scope problem.";
0 commit comments