cancel
Showing results for 
Search instead for 
Did you mean: 

XMII Runner Transaction with JSON response

former_member201620
Participant

Hi folks,

is there a way to force the XMII Runner to return JSON? I already found that Queries can return data using the OData protocol and therefore utilizing json. How can I make this work for Transactions?

This would ease UI5 development against it a lot...

BR

Chris

Accepted Solutions (1)

Accepted Solutions (1)

former_member185280
Active Contributor

If your data is in the query output format ( Rowsets/Rowset/Row ) you can go through an xacute query and get a json result. Otherwise I have wrapped the runner service with a jsp to parse the xml response into json.

Regards,
Christian

former_member201620
Participant
0 Kudos

Hi Christian,

what is a xacute query and how do I tell it to produce json output?

This is how I normally call a transaction:

http://host:port/XMII/Runner?Transaction=...

The Transactions use SQL Queries.

Are you talking about putting a plain json string in an output param of the XML? We already tried this and it does not work well with UI5 JSONModel. I am looking for a pure JSON response.

BR

Chris

former_member185280
Active Contributor
0 Kudos

An xacute query lets you wrap a transaction in a query object. So you can get your xml converted to json output the same way you get it from a standard query ( OData, Illuminator). The only disadvantage being that your xml output must be in the Rowsets/Rowset/Row format.

Xacute Query - SAP Manufacturing Integration and Intelligence - SAP Library

Former Member
0 Kudos

Hi Chris,

Just adding to the answer given by Christian.

After wrapping the transaction with Xacute query, you need to call illuminator service of MII with content type as text/json.

URL:

http://<servername>/XMII/Illuminator?QueryTemplate=<Project>/<Path>/<TemplateName>&Content-Type=text/json

Regards,

Rohit Negi.

Former Member
0 Kudos

Hello,

is there no chance to have this automatically for the transaction? I don't want to wrap it into the xacute query.

My question on this topic

Has the xacute query only Param.XX as parameters or does it contain self named Parameters?

On the transaction details page I see the numbers (same as SQL Query example with Param.1).

I suspect only Param.1 to Param.32 exist in the query.

Regards,

Kai

swaroop_anasane
Active Contributor
0 Kudos

Hi Kai,

Please post a separate question for this.

Thanks,

Swaroop

Former Member
0 Kudos

Hello Swaroop,

I would open a seperate question if it would not directly be linked to this question. I'm working together with Christian on this project.

We have tried the xacute query, which prints out a JSON, the downside of the xacute query is that all our named parameters is are mapped behind param.1 to param.32 which is not our intention. From the UI5 development this is bad behaviour because you can't match the parameters directly on a name. Is this anyhow possible?

Also the transaction URL Post call does not work with content-type=text/json - it only returns xml, your suggestion did not work, not either in MII 14.0

Regards,

Kai

Former Member
0 Kudos

Hi Kai,

Unfortunately only MII Illuminator service supports the content-type as text/json and not the Runner service.

Illuminator service is used for calling query template and Runner service is used to call transactions.

So you would not get transaction output as JSON directly.

So the work around is to wrap the transaction in a Xacute query and then call this query from your UI.

Lets see if MII extends this JSON support to the Runner service in future releases.

Answers to your questions:

1. Has the xacute query only Param.XX as parameters or does it contain self named Parameters?

All the queries have Param.XX and only transactions accept named params

2. On the transaction details page I see the numbers (same as SQL Query example with Param.1).

Here you need to map your transaction named params to Param.XX

3. I suspect only Param.1 to Param.32 exist in the query.

Yes.

Regards,

Rohit Negi.

former_member201620
Participant
0 Kudos

Thanks Rohit,

that finally nails it down

Answers (1)

Answers (1)

swaroop_anasane
Active Contributor

Hi,

I know it's a very old post, came across it and thought of adding my observations.

You can simply provide the parameter names from transaction without mapping it on xacute atleast for 15.x. The xacute passes it as it is to the transaction. So not mandatory to use Param.1......32.

Hope this helps.

Regards,

Swaroop