Hi guys,
Some weeks ago (maybe monthes :)), I have sent an e-mail on the dev
mailing list to define a kind of standard message format for binding
components.
To remember, currently, each component defines its own format to
marshal/unmarshal JBI normalized messages. This is the purpose on the
component marshaler.
For example, in the SMPP component, we have the DefaultMarshaler that
read/write XML like :
<message>
<toc/>
<npi/>
<destination/>
[...]
</message>
The user can override this marshaler by a new one.
The problem is when we "facade" this component with another one. The
content of the incoming normalized message should be in the format
expected by the component. If it's not the case, the user :
- need to transform the normalized message content to match the required
format
- need to create a marshaler to change the expected format.
Currently, the format expected by each component is not "standard" and
not very well documented.
That's why I propose to define a kind of "contract" inside all SMX
components. At least, this contract can be a XSD defining a standard XML
structure shared by all components. Or, we can use WSDL to define this
contract.
For example, it can be something like :
<?xml version="1.0"?>
<definitions name="Component"
targetNamespace="http://servicemix.apache.org/component.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace="http://servicemix.apache.org/component.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="InRequest">
<complexType>
<all>
<element name="request" type="string"/>
</all>
</complexType>
</element>
<element name="OutResponse">
<complexType>
<all>
<element name="response" type="string"/>
</all>
</complexType>
</element>
</schema>
</types>
<message name="processRequest">
<part name="body" element="process"/>
</message>
<message name="processOutput">
<part name="body" element="response"/>
</message>
<portType name="processPortType">
<operation name="process">
<input message="processRequest"/>
<output message="processOutput"/>
</operation>
</portType>
<binding name="processSoapBinding" type="processPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="process">
<soap:operation
soapAction="http://servicemix.apache.org/process"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="process">
<documentation>Component Exchange Service</documentation>
<port name="processPort" binding="processSoapBinding">
<soap:address location="http://servicemix.apache.org/process"/>
</port>
</service>
</definitions>
It's only a example. In fact the WSDL could contain NormalizedMessage
complex type, map describing properties to process, etc.
What do you think of that ?
Maybe a Binding Component Exchange XSD is enough ?
Thanks
Regards
JB