Here, we will expose rest Trigger API and post XML request payload to Rest api and get back a response as XML by the rest API.
Request schema used:
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.poc.org" xmlns:ns0="http://www.poc.org" targetNamespace="http://www.poc.org"
elementFormDefault="qualified">
<xsd:element name="Employees">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Employee" type="EmployeeType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="EmployeeType">
<xsd:sequence>
<xsd:element name="EMPLOYEE_ID" type="xsd:string"/>
<xsd:element name="FIRST_NAME" type="xsd:string"/>
<xsd:element name="LAST_NAME" type="xsd:string"/>
<xsd:element name="AGE" type="xsd:string"/>
<xsd:element name="DEPARTMENT_NAME" type="xsd:string"/>
<xsd:element name="DEPARTMENT_ID" type="xsd:string"/>
<xsd:element name="COUNTRY" type="xsd:string"/>
<xsd:element name="SALARY" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Response schema used:
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.pocresponse.org" xmlns:ns0="http://www.pocresponse.org" targetNamespace="http://www.pocresponse.org"
elementFormDefault="qualified">
<xsd:element name="EmployeesRes">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="EmployeeRes" type="EmployeeType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="EmployeeType">
<xsd:sequence>
<xsd:element name="EMPLOYEE_ID" type="xsd:string"/>
<xsd:element name="DEPARTMENT_ID" type="xsd:string"/>
<xsd:element name="COUNTRY" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Detailed steps:
Integration view:
Choose response payload as XML_Schema and media type of the response body as XML.
No comments:
Post a Comment