cancel
Showing results for 
Search instead for 
Did you mean: 

REST Receiver Adapter (ARRAY) - 2 elements with same name

cleybersantos
Member
0 Kudos

Hey

I have the next integration:
SAP ECC-->PO-->REST Receiver

I am facing a problem, where I have 2 elements with same name in my structure.

My structure:

<xsd:element name="fonte" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="nome" type="xsd:string" minOccurs="0" />
<xsd:element name="registro" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="tabela" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="nome" type="xsd:string" minOccurs="0" />
<xsd:element name="ocorrencia" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="atributo" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="nome" type="xsd:string" minOccurs="0" />
<xsd:element name="valor" type="xsd:string" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="tabela" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="nome" type="xsd:string" minOccurs="0" />

As you can see above, I have twice the element tabela, in the first time this element is not array 0..1 , but in the second time is a array 0..unbounded.

How can I specify just the element tabela 0..unbounded as array in my REST Receiver Adapter?

Regards.,

Cleyber Santos

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I doubt that below blog will not be helpful in your case as once your provide "tabela" as array type, the enhanced settings are going to consider as array no matter if it having one element or other(nome,ocorrencia..etc)

https://blogs.sap.com/2016/01/13/rest-adapter-in-sap-pipo-enhanced-xmljson-conversion/

you may use java mapping to convert the xml to json as it is based on the sub elements condition.

But simple solution would be ask the target to have different name if it is possible from target side to make the structure change.