On May 19, 2008, at 12:47 PM, Daniel Lipofsky wrote:
On May 16, 2008, at 1:31 PM, Daniel Kulp wrote
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?
Per JAX-WS spec, if the method is supposed to go on the wire as a
"wrapped" doc/lit form, we're supposed to look for the wrapper beans
and use them.
The reference implementation REQUIRES the wrapper beans to be there.
You need to run the wsimport tool to generate them. CXF doesn't
require them. If they aren't there, with 2.1, we'll use ASM to
generate them. If they aren't there and ASM ISN'T available, (no
asm.jar on the classpath), then we make a "best attempt" to work, but
there are various JAXB things that don't work properly that way. For
most cases, it works fine. (FYI: CXF 2.0 didn't do the asm thing.
Thus, the jax-ws 2.0 use cases should work fine without asm, it's the
newer jax-ws 2.1 stuff that requires it)
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.
Yep. Unqualified is the default. Thus, you're probably OK in this
case.
---
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog