cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction Output when invoked Web Service

former_member190457
Contributor
0 Kudos

Hi all,

I have developed a transaction which has an output parameter of type list, derived from the classic ERP BAPI Flight Get List

When I invoke the transaction as web service from a SOAP test tool I get a SOAP response like:


<MyTestOutput>
[[string:FRA], [string:TYO], [string:FCO],  [string:KIX]]
</MyTestOutput>

So the output xml element is just one, containing the whole list.

I don't like this because the web service consumer must parse that element to get all the result items.

What I would like is a more xml-like output structure, such as:


<MyTestOutput>[string:FRA]</MyTestOutput>
<MyTestOutput>[string:TYO]</MyTestOutput>
<MyTestOutput>[string:FCO]</MyTestOutput>
<MyTestOutput>[string:KIX]</MyTestOutput>

Is there a simple way to achieve that?

In the help/guides I have studied there's no hint about how to do so.

Thanks, regards

Vincenzo

Accepted Solutions (1)

Accepted Solutions (1)

agentry_src
Active Contributor
0 Kudos

Hi Vincenzo,

I reopened your thread.

Instead of making your output parameter type of List, create an output parameter of type xml. If you look at most of the transactions available as downloads, you will see numerous examples of the types of structures the xml will accomodate. And you will not have to convert the outputs back to xml for further processing.

If you use a repeater to build your xml, you can accomplish the structure you desire. Alternatively, you can build an MII Document and the format will be




<Rowsets>
<Rowset>
<Row>
<your Fieldname>
data1
</your Fieldname>
</Row>
<Row>
<your Fieldname>
data2
</your Fieldname>
</Row>
<Row>
<your Fieldname>
data3
</your Fieldname>
</Row>
<Row>
<your Fieldname>
data4
</your Fieldname>
</Row>
</Rowset>
</Rowsets>


Regards,

Mike

Edited by: Michael Appleby on Sep 20, 2011 1:29 PM

Answers (0)