On May 16, 2008, at 1:31 PM, Daniel Kulp wrote > > On May 16, 2008, at 12:29 PM, Daniel Lipofsky wrote: > > > > I choose the "all services in one directory" strategy > > because many of my services use the same message wrapper > > objects (the @XmlRootElement objects), and I have extended > > some of those classes, so I am not even using the generated > > versions of them. > > > > I don't even use package-info.java or ObjectFactory.java > > (I generate to a temp directory and don't bother to copy them). > > Same with many of the @XmlRootElement objects, most of my methods > > are called unwrapped, so I only need them for the few methods that > > are wrapped. So the only thing I really generate and use is > > *PortType.java and *Service.java > > Startup performance would probably be slightly better if you grabbed > all of the wrapper types, even the ones for the unwrapped methods. > If you look in the service interface for those methods, you'll see a > @RequestWrapper/@ReponseWrapper annotation that points to those > classes. With 2.1, if they are there, we use them. If not, we use > ASM to dynamically generate them at startup time. Thus, if you have > them, we can avoid the ASM stuff.
Avoiding ASM would be nice. I am still wondering though, if I am using an unwrapped method signature, then I am not using the RequestWrapper or ReponseWrapper, at least not anywhere in my code, neither client nor server side. So is it using it behind the scenes in CXF code where I can't see it? If not can we avoid generating those objects and avoid ASM without including them in my build? > > I use one namespace per service > > Well, there is the namespace for the service and then there is the > namespace of the types. Are all the types in the same namespace? > If so, you may be OK. If not, you could have issues. My WSDL declares <xsd:schema targetNamespace="http://...."> and doesn't declare any other namespaces or do any imports in the schema section. My SOAP messages look like <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns1:GetObjects xmlns:ns1="http://www.foobar.com/Tx"> <searchTerms> <key>alphaId</key> <value>TX-WS-EXAMPLE</value> <type>like</type> </searchTerms> <offset>0</offset> <length>100</length> </ns1:GetObjects> </soap:Body> </soap:Envelope> *BUT* what I do might be unusual. Things like "GetObjects" and "searchTerms" exist in many namespaces, it is identical across all of them. I duplicate them in each WSDL rather than doing an import. > > So far it seems to work fine, I just had to do the > > hack for ObjectFactory when I switched from 2.0.5 to 2.1, > > but that class seems to be unused since I made an empty > > one and it still works. All my unit tests work. > > You're schemas might be simple enough. If all your schemas are set > for elementForm="unqualified", this becomes easier as the namespaces > don't really go on the wire. Thus, it's more immune to these types > of issues. I don't explicitly say "unqualified" anywhere, but maybe that is the default. Thanks, Dan
