If XSDHelper.define() was called the second time and the namespace already exists, do we want to throw an exception if the Types and Properties in the registering namespace are different from the registered namespace? I know comparing namespace is expensive and also returning the registered namespace is going to fail the second application anyway. Just wondering.
Another scenario is that if I registered my namespace and later on I like to extend my namespace (i.e., adding more types and properties). Can I register my namespace with the same name the second time without bringing down the SDO runtime? Frank Budinsky <[EMAIL PROTECTED]> 03/02/2006 07:47 PM Please respond to [email protected] To [email protected] cc Subject Re: Defining WSDL to SDO Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote on 03/02/2006 07:10:55 PM: > Jean-Sebastien Delfino wrote: > > ant elder wrote: > >> For the new Axis2 based WS binding we need to get WSDL defined to SDO so > >> that the SOAP Body XML can be (de)serialized to DataObjects > >> correctly. Could > >> that happen when the import.wsdl in the sca.module is being > >> processed? Thats > >> done by org.apache.tuscany.model.assembly.impl.AggregateImpl in the > >> initialize method. Adding the following line just after the > >> getAssemblyLoader().loadDefinition call seems to work: > >> > >> XSDHelper.INSTANCE.define(url.openStream(), null); > >> > >> Would this be ok? > >> > >> Thanks, > >> > >> ...ant > >> > >> > > Yes I think this is OK. If your service is flowing complex types and > > you have generated SDO classes then you just need one of the > > components in your application module to reference the generated SDO > > Factory to trigger the initialization of the metadata for your complex > > types. But in scenarios flowing elements of simple types e.g. <element > > name="getGreetings" type="xsd:string"> you won't have generated SDO > > classes so you definitely need to invoke > > XSDHelper.INSTANCE.define(url.openStream(), null) to get the metadata > > for your elements in place. > > > I have a set of related SDO questions - and depending on the answers we > may have a problem or not :) > > Let's say that at build time I give x.wsdl to the SDO code generator. I > get SDO classes generated for the XSD types defined in my WSDL <types> > section . Then at runtime I want to use these SDO classes in an SCA > component. To trigger the initialization of the SDO metadata for these > types I simply reference the generated factory or use > SDOUtil.registerStaticTypes(...) when my SCA component starts. Then > Ant's Axis2 Entry Point runtime does XSDHelper.INSTANCE.define(the exact > same x.wsdl)... My understanding is that this will dynamically generate > SDO metadata from the given WSDL.. > > Which version of the metadata is the SDO runtime going to use? the first > one that gets registered? the last one? Is XSDHelper going to detect > that already have SDO metadata registered with static types for the > given namespace? Do we get new SDO metadata each time we invoke > XSDHelper.define(...)? If XSDHelper.define() is called more than once, the second and subsequent calls just return the already defined types. But this is not true for statically generated classes. I think that with the current implementation the dynamically defined model will hide the generated classes. I suppose I could put a check in XSDHelper.define() to do nothing (just return) if the namespace is already registered with static classes, if that's what we want. It's an easy change, but we should think about what the right long term answer is for this whole issue. > > -- > Jean-Sebastien >
