Thursday Apr 26, 2007
Today's Page Hits: 231
Thursday Apr 26, 2007
You have to clearly define a strongly typed XML schema for the messages that you exchange between a provider and a consumer and ensure that each of your message exchanges are strongly typed. This also ensures that you establish well-defined and well-understood semantics for communication between your external partners even though each of your internal implementations may evolve independent of each other. Just because having a strongly typed schema for the message is not enforced anywhere, you have to stay away from the tendency to use an xsd:string element to represent your entire message body.
If you go ahead and do represent your message body as an xsd:string type, you could probably develop some simple clients. There may be no issues with interoperability between the frameworks you use - be it Java or .NET - since your whole XML payload within the message body carries the message data as a string.
However the big downsides to this approach are as follows:
Like this write-up? Subscribe to receive more like it.
Disclaimer: The contents of this Weblog represent my personal opinion which may differ from the official views of my employer, Sun Microsystems, Inc. or any past employers.
Posted by Veton on April 27, 2007 at 06:10 AM PDT #
Posted by Frank Wilhoit on April 27, 2007 at 06:13 AM PDT #
<Veton>
1) The consumer does not always talk to the provider directly. When you use SOAP proxy, you do not care about the SOAP BODY. Even the SOAP HEADER is not always useful .... but the protocol headers are. Example routing message: ON SOAP/HTTP, I use the HTTP URI and SOAP action to determine the service to be called.
</Veton>
Relying on SOAPAction is not a good idea since SOAPAction is really only an 'intent' as can be seen from the specification. In fact the SOAPAction field has been removed in SOAP 1.2 version of the spec.
<Veton>
If SOAP/JMS, I will use the JMS header.
</Veton>
JMS is for use within the enterprise. JMS cannot work across firewalls. If you are going to expose a service to external clients outside of your enterprise, you would expose it through SOAP/HTTP, not through SOAP/JMS.
<Veton>
Sometimes you want to have some loose information. In this case xsd:any can be useful (not for the complete message but for a part of the message)... the problem is that it is not well supported by products. When I say loose information, I 'm talking about service that may change in the future (versioning/dynamicity).
</Veton>
The are other ways to do versioning than providing xsd:any extensions in the schema.
Cheers
Gopalan.
Posted by Gopalan Suresh Raj on April 27, 2007 at 11:19 AM PDT #
Comment 2 : Strong typing forces clients to jump through hoops to transform the data when passing parameters. However, if the type definition in your interface is exactly the same as the type definition of data source, no transformation is required - even if the parameter is strongly typed.
That brings us to one of the biggest misconceptions of SOA design which is that service owner s are responsible for the type definition of all parameters of their interfaces. Service owners should instead strive to find the canonical sources of the data that is being passed to service, and reuse their type definition. If the service owner cannot find a canonical source - creating a strongly typed interface will simply make it difficult to reuse the service.
Posted by Alan Ho on April 28, 2007 at 01:32 AM PDT #