« XML Patterns | Main | Back from vacation »
August 27, 2004
Data Binding in Web Services
Often when using webservices you are confronted with a decision on how to bind the XML Schema you have into java. If you are starting with a WSDL you can either bind each complex type to a DOM or to a generated java class. Each method has its advantages and disadvantages. Fine-grained binding into java is nice if you are going to use each data type in the application, are satisfied with the default binding and are planning on writing a lot of java centric logic. Use DOM when you want to delegate to a different binding solution (say JAXB rather than using JAXB types) or you want to only use standard XML tools on the data types.
For example your method signature could be
or
Foo echo(Foo complexObj);
DOM echo (DOM complexXML);
Don Box has made the point that probably web service engines like Indigo should be in the business of routing, reliability and security and be out of the business of data binding. At first I thought this was wrong but then I realized it was a really nice factoring of the plumbing with the data types. Let the WebService engines deal with the messages and then delegate the type resolution and binding to a later stage.
Posted by Chris at August 27, 2004 09:45 PM