Dynamic WSDL in OIC: Accept Any Payload with xsd:anyType
Use Case
In OIC integrations, it's common to interact with multiple upstream or downstream systems where payload structures differ or aren't fixed. Instead of creating a unique integration for every structure, we can expose a flexible web service that accepts any XML structure. This is especially helpful in hub-and-spoke or generic logging/auditing integrations.
The goal here is to expose a SOAP endpoint in OIC that accepts any type of payload.
Problem Statement
You want to expose an integration in OIC that:
- Accepts varying or dynamic data structures from multiple sources.
- Doesn't require a fixed schema.
- Can act as a dynamic listener or dispatcher based on incoming payload content.
Solution: WSDL with xsd:anyType
Here is the exact WSDL used to expose a SOAP endpoint in OIC with flexible payload capability:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://iec.ch/TC57/2011/schema/message"
targetNamespace="http://iec.ch/TC57/2011/schema/message"
name="CIMAsyncService">
<!-- TYPES -->
<types>
<xsd:schema targetNamespace="http://iec.ch/TC57/2011/schema/message"
elementFormDefault="qualified">
<xsd:element name="ResponseMessage" type="tns:ResponseMessageType"/>
<xsd:complexType name="ResponseMessageType">
<xsd:sequence>
<xsd:element name="Data" type="xsd:anyType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
<!-- MESSAGE -->
<message name="SendResponseMessageInput">
<part name="parameters" element="tns:ResponseMessage"/>
</message>
<!-- PORT TYPE -->
<portType name="CIMAsynType">
<operation name="SendResponseMessage">
<input message="tns:SendResponseMessageInput"/>
</operation>
</portType>
</definitions>
How to Use in OIC
Step 1: Create a SOAP Connection
- Go to Connections.
- Choose connection type: SOAP.
- Use the above WSDL file to configure the connection.
- Set the security policies (None / Basic Auth / WSS, based on your use case).
Step 2: Create an Integration (App Driven - SOAP Trigger)
- Choose the connection as the trigger.
- OIC will auto-generate a structure where the input message will include:
<Data> ... </Data>
- Map this
Data
field directly or useoraext:getElement
orxpath
functions to extract values from it.
Step 3: Process the AnyType Content
- Inside the integration flow, use an Assign or Function Call to extract specific XML elements.
- Alternatively, just log or route the payload to another system without inspecting its structure.
Step 4: Activate and Test
- Deploy and activate the integration.
- Test with different XML structures using SOAP UI or Postman.
Example Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:mes="http://iec.ch/TC57/2011/schema/message">
<soapenv:Header/>
<soapenv:Body>
<mes:ResponseMessage>
<mes:Data>
<Customer>
<ID>123</ID>
<Name>John Doe</Name>
</Customer>
</mes:Data>
</mes:ResponseMessage>
</soapenv:Body>
</soapenv:Envelope>
Benefits
- No schema lock-in: Send anything from upstream systems.
- Reusable: Use this as a generic endpoint for multiple use cases.
- Powerful: Combine with Decision Models, JavaScript, or XSLT for routing or transformation.
No comments:
Post a Comment