Author |
Message
|
vnb |
Posted: Tue Jan 16, 2018 12:22 pm Post subject: JSON String As Request - IIB |
|
|
Newbie
Joined: 16 Jan 2018 Posts: 4
|
Is there a way to send JSON String as a request in IIB. Normally we have to initiate JSON Object or JSON Array. But we have a requirement where the providers can accept only JSON String as a request.
Set OutputRoot.JSON.Data.id = request.xxxx; (This is JSON Object)
We are looking for not a JSON Object and not key values pairs. Just like a string below...
Request
----------
"xxxx-1234-abcd-xxxx" |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 16, 2018 12:34 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
How does a JSON string differ from a normal string?
Or.....
If you don't want a JSON Array or a JSON Object why are you using the JSON domain? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
vnb |
Posted: Tue Jan 16, 2018 12:53 pm Post subject: |
|
|
Newbie
Joined: 16 Jan 2018 Posts: 4
|
Actually we have one requirement, where the providers accepting string as json without any key and they are responding in JSON format. In their documentation they clearly defined do not send JSON Object and send string only. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 16, 2018 1:00 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
vnb wrote: |
Actually we have one requirement, where the providers accepting string as json without any key and they are responding in JSON format. In their documentation they clearly defined do not send JSON Object and send string only. |
Awesome. How does that address either of my questions? Also you now need to answer this for me:
vnb wrote: |
the providers accepting string as json without any key |
This is presumably the
Code: |
xxxx-1234-abcd-xxxx |
in your original post. How is this in any way a JSON format? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
vnb |
Posted: Tue Jan 16, 2018 1:40 pm Post subject: |
|
|
Newbie
Joined: 16 Jan 2018 Posts: 4
|
For your question: The documentation says that they are accepting either request/response in json format. That is the reason I am trying to achieve using JSON Domain.
My Thought is xxxx-1234-abcd-xxxx??
Can we consider this a JSON as a string format?? |
|
Back to top |
|
 |
timber |
Posted: Tue Jan 16, 2018 2:30 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
Can we consider this a JSON as a string format?? |
Wouldn't it be easier to check the JSON specification, instead of asking us? It's available here: https://www.json.org/
If it does not conform to the JSON spec then it is not JSON. |
|
Back to top |
|
 |
vnb |
Posted: Tue Jan 16, 2018 2:54 pm Post subject: |
|
|
Newbie
Joined: 16 Jan 2018 Posts: 4
|
The specification says no, but we can achieve those kind of scenario's using Java API's. I would like to check here, similar kind of ways exists any??
Nothing wrong with that?? |
|
Back to top |
|
 |
adubya |
Posted: Wed Jan 17, 2018 1:25 am Post subject: |
|
|
Partisan
Joined: 25 Aug 2011 Posts: 377 Location: GU12, UK
|
I can only speak for myself but I have no idea what you're asking us.
Give examples of the exact data you'd send to your provider and the exact data you'd get back.
If it were JSON then a request would be something like
Code: |
{
'request': {
'repeatingStructure': [{
'childElement': 'element value',
'anotherChildElement': 12345
}
]
}
}
|
What would your request look like ? _________________ Independent Middleware Consultant
andy@knownentity.com |
|
Back to top |
|
 |
timber |
Posted: Wed Jan 17, 2018 5:16 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
The specification says no, but we can achieve those kind of scenario's using Java API's |
I agree with adubaya - you are making no sense at all. What Java APIs are you talking about? Are they JSON APIs or something else?
IIB can construct any string of characters you want - but the JSON domain will only read and write valid JSON. |
|
Back to top |
|
 |
souciance |
Posted: Wed Jan 24, 2018 12:54 am Post subject: |
|
|
Disciple
Joined: 29 Jun 2010 Posts: 169
|
vnb wrote: |
For your question: The documentation says that they are accepting either request/response in json format. That is the reason I am trying to achieve using JSON Domain.
My Thought is xxxx-1234-abcd-xxxx??
Can we consider this a JSON as a string format?? |
No, this is not JSON. Why don't you ask the consumer to provide an example message instead? That would make easier for you and for us to help. |
|
Back to top |
|
 |
|