Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 50686 invoked from network); 6 Apr 2005 17:24:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Apr 2005 17:24:46 -0000 Received: (qmail 8540 invoked by uid 500); 6 Apr 2005 17:24:42 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 8511 invoked by uid 500); 6 Apr 2005 17:24:42 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 8495 invoked by uid 99); 6 Apr 2005 17:24:41 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from whale.cs.indiana.edu (HELO whale.cs.indiana.edu) (129.79.246.27) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 06 Apr 2005 10:24:41 -0700 Received: from [127.0.0.1] (rainier.extreme.indiana.edu [129.79.246.105]) by whale.cs.indiana.edu (8.12.11/8.12.11/IUCS_2.65) with ESMTP id j36HObob005803; Wed, 6 Apr 2005 12:24:37 -0500 (EST) Message-ID: <42541B54.7050908@cs.indiana.edu> Date: Wed, 06 Apr 2005 12:24:36 -0500 From: Aleksander Slominski User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050318) X-Accept-Language: en-us, en MIME-Version: 1.0 To: axis-dev@ws.apache.org CC: "Mark D. Hansen" Subject: Re: [Axis2] XML views and flexible/efficient databindg [Re: [Axis2] Can OM with differed building really be so effective in Axis2? References: <64EE0DBA15556341AF577C102564465D172ECE@admin-server.javector.com> In-Reply-To: <64EE0DBA15556341AF577C102564465D172ECE@admin-server.javector.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Mark D. Hansen wrote: >But a POJO <--> XML binding is essential for business applications that interoperate via web services standards (i.e., SOAP, XML, WSDL). > i do not agree. if you have POJO you should use RMI if all you services are Java or CORBA if you can assure that everybody get the same IDL that is under central control and changes can be controlled and updates rolled out. that will work way better then using XML as serialization format ... > I agree that it is awkward. > XML schemas and WSDL should be crafted first so only appropriate level of coupling is required and Web Services peers can interact independent form programming language, and in particular independent if they use POJO, data bindings or just work with XML directly. message medium contract (XML, SOAP, and WSDL/XS/...) should be the essential for business applications - of course that is theory but in practice ... > And there are always going to be lots of different ways that people do it (e.g., JAXB, Castor, XmlBeans, custom mappings, etc). > > i would add JiBX as it seems to be the most complete of all those mappings. JAXB Castor and Xmlbeans are not POJO - there is lot of stuff inside those "POJOs" they generate ... (BTW: i think JAXB does not even generate POJO as it generates interfaces and not classes ...) >IMO, the java binding should NOT be part of core Axis2 (or any SOAP processing engine) - because you don't want to force users to pick a specific binding. A binding should be a "plug-in". You can have a plug-in for JAXB, JAX-RPC 1.1, Castor, XmlBeans, etc. > > i agree >Axis2 needs a clear boundary between SOAP processing (AXIOM for speed) and Web Service invocation (which requires memory intensive java binding). > > yes >This approach requires that you create an API for the java binding plug-in. A shortcoming of Axis 1.x is that the SAX-based java binding mechanism is deeply intertwined with the SOAP handling mechanism. Axis2 needs a clean separation of SOAP handling (i.e, header processing) from the java binding that is required for web service invocation. > > i do not see that this separation ca work. headers needs data binding (even DOM or SAAJ can be called databinding as they provide java view on XML and many more may be needed...) >The components of such a plug-in binding API primarily would include: type mapping registry, [de]serialization (binding) context, [de]serializers, and a deployment mechanism for POJOs (that allows you to specify the binding to use). > > i am very uncomfortable with lossy conversions - unless yo have extremely reach mapping metadata you loose infoset in XML->Java conversion and when doing Java->XML you may be no longer able to construct XML required in contract (XML Schema etc.) moreover some handlers may need to access XML Infoset even even after data binding(s) were executed >The [de]serializer API needs to be something really simple like: > >public XmlObject serialize(Object obj, BindingContext ctx) >public Object deserialize(XmlObject xojb, BindingContext ctx) > >In the above, I use the XmlBeans interface XmlObject as the universal representation of an underlying XML instance. I like XmlBeans in this role because it is easy to work with. It can give you DOM like access if the [de]serialization mechanism that you want to port to Axis2 is DOM oriented and it can give you SAX like access to use with SAX based [de]serializers. > > >I can't comment on what the impact on performance would be of inserting XmlBeans in between AXIOM and the java binding framework. I assume that it could be a problem. > > i suspect that too ;-) especially that Xmlbeans is like dual tree: XML infoset + Java binding >Of course, going from XML --> POJO via any deserializer requires pulling the entire XML into memory. > actually it does not require it if you have deserializer that can read from XML event stream (SAX, XmlPull, StAX, etc) for example: public Object deserialize(XmlPullParser pp, BindingContext ctx) which i think is already more or less provided by JiBX AFAIK > So, if the ultimate web service deployed on Axis2 (the business application) requires a POJO, there is no way to avoid brining the entire XML instance into memory. We just need to make sure that we aren't doing it more than once. > > it is possible to avoid but that lends itself to use of XML as "inefficient serialization" format (the way i used it in SOAP RMI) - clunky but works >So perhaps the Axis2 engine should be designed so that the java binding is handled by a separate pool of threads from the AXIOM-based handler chain? Users who really care a lot about server performance could configure it so that seperate CPUs handle SOAP processing (high volume) vs. java binding (memory intensive). > > actually clustering AXIS2 engines would be much more efficient in case when services are relatively contained and stateless >These are just some thoughts. I'm actually putting some of this stuff (independent of Axis2) into a book, along with a "toy implementation" of a java binding "plug-in" framework for JAX-RPC. So, I would appreciate any feedback from you gurus out there! > > > interesting. alek > > > >>-----Original Message----- >> >> > > > >>as of data binding: i have less and less conviction that >>creating pure >>Java objects (POJO) from XML is a good idea - XML is *not* >>POJO and if >>you have only POJO you need to maintain (somehow automatic?) very >>complicated mappings to reconstruct XML from POJO during >>serialization >>(i think JiBX attempts to do that). >> >> > > > -- The best way to predict the future is to invent it - Alan Kay