|
|
||
Giovani Salvador's BlogJava, SOA and XMLPosted by giovanisalvador on July 27, 2008 at 03:32 PM | Comments (1)I have been involved in SOA (Service Oriented Architecture) projects and also studying a lot all the aspects of the SOA world. It is interesting that I thought that I knew SOA before working effectively with SOA. More specifically, I thought my knowledge on XML parsing (of course, using a JAXP implementation) would be sufficient to say that I really know XML. For example, when we think of an XML document we usually think of something like this:
<customer>
<address>
<zipcode>123</zipcode>
…
</address>
<address>
<zipcode>321</zipcode>
…
</address>
</customer>
and not this:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.myservice.com/SyncBusiness/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SyncBusiness"
targetNamespace="http://www.myservice.com/SyncBusiness/">
<types>
<xsd:schema targetNamespace="http://www.myservice.com/SyncBusiness/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:order="http://www.myservice.com/order">
<xs:import namespace="http://www.myservice.com/order" schemaLocation="./order.xsd" />
<xsd:element name="submitOrderResponse" type="order:Order" />
<xsd:element name="submitOrder" type="order:Order" />
</xsd:schema>
</types>
<message name="submitOrderResponse">
...
</message>
<portType name="SyncBusiness">
...
</portType>
<binding name="SyncBusinessSOAP" type="tns:SyncBusiness">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="submitOrder">
...
</operation>
</binding>
<service name="SyncBusiness">
<port binding="tns:SyncBusinessSOAP"
name="SyncBusinessSOAP">
....
</port>
</service>
</definitions>
But when you get involved with SOA using an ESB (Enterprise Service Bus) implementation you start to deal with a world you typically have not any involvement. One may argue that we don’t need to pay attention to such things as we have tools that make all this job for us, especially when we need to consume services published in a specific web service or when we need to expose a service. Design By Contract
<service name="MyService">
<port binding="ms:MyServiceSoapBinding"
name="MyServiceSoapPort">
<soap:address
location="http://172.168.15.1:7101/esb/myservice" />
</port>
</service>
If you use a tool that generated that location pointing to a specific ip address you will probably have some problems with dynamic IP. But if you are responsible for taking care of the contract between the client of an ESB and the ESB itself then you know that you need to specify carefully all the services and their locations. I am not saying here that the design by contract should always be used when designing a service. The bottom line here is that this Schema Transformation CustInfo.xsd
CustInfoOld.xsd
In other words, both legacy and new systems have XML Schema Documents and you may have name conflicts. You avoid problems using namespaces to represent both old and new schemas. xmlns:custnew="http://www.custdata.org/CustInfo" If we need to work with both schemas to perform transformation in a language like XQuery than all we need to do is to declare both schemas, each one being represented by one namespace, and use the namespace as an alias to each one of them and their elements. Note: Transformation inside an ESB implementation can be performed using Java callouts (if you are using an ESB written in Java) and you will probably deal with an object oriented view of your XML document and avoid problems you face when you are performing transformation using a a language like XQuery. What SOA has to do with Java? Nothing, because SOA is not dependent of a specific technology. And everything. SOA has everything to do with Java like Java has everything to do with XML. And in the Java world there is a number of ESB implementations like Aqualogic, Mule, JBoss, etc. Which one do you guys use? And which approach to perform transformations are you guys using (XQuery or any other language or Java Calls)? Thank you all. Bookmark blog post: CommentsComments are listed in date ascending order (oldest first) | Post Comment
| ||
|
|