Table of Contents

Search

  1. Preface
  2. Introduction to REST V2 Connector
  3. REST V2 connections
  4. REST V2 operations
  5. Mappings and mapping tasks with REST V2 Connector
  6. Appendix A: Supported swagger objects

REST V2 Connector

REST V2 Connector

XML objects

XML objects

REST V2 Connector supports XML objects such as, XML attributes, the wrapper object, and the namespace object.
You can define attributes only for XML objects. You cannot define attributes for XML elements in the swagger specification file. Wrapper objects are supported for a simple type array element only when the array element has inline definitions. REST V2 Connector supports qualified and unqualified namespace objects in Response for source, midstream, and target transformations. Whereas, REQUEST with qualified and unqualified namespace objects is supported for midstream and target transformations.
Swagger definition for an XML attribute:
"XMLAttrArray_Request##body##Employee##dep##Mangr" : {
"properties" : {
"desg" : {
"type" : "string",
"xml": { "attribute": true }
}, "mid" : { "type" : "string" },
The XML attribute sample:
<dep>
<Mangr desg="Director">
<mid>em09</mid>
<mname>mg</mname>
</Mangr>
<id>did</id>
<name>dname</name>
</dep>
An XML attribute is always of type string. Even if the swagger definition has attribute with type as number, the REST V2 connector always treats the attribute as string. The XSD generated has the data type as string for the XML attribute.
Swagger definition for a Wrapper object:
"books" : {
"type" : "array",
"items" : { "type" : "string" },
"xml": {
"wrapped" : "true", "name": "books-array"
}
}
The Wrapper object sample:
<books-array>
<books>1</books>
<books>2</books>
</books-array>
Swagger definition for a Namespace object:
root" : {
"properties" : {
"table" : {
"$ref" : "#/definitions/NSResReq_Request##body##root##table"
}
},
"xml":{
"prefix": "h",
"namespace": "http://www.w3.org/TR/html4/"
}
}
The namespace object sample:
<h:root xmlns:h="http://www.w3.org/TR/html4/">
<table>
<tr>
<td>Apples</td>
<td>Bananas</td>
</tr>
</table>
</h:root>


Updated December 14, 2020