You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Peter White <pe...@m1global.com> on 2004/09/13 21:02:13 UTC

WSDL Upper-case tripping up De/Serialization in Complex requests

 
Greetings! 

I am contacting this list about a naming issue I've run across for
complex types in document-based complex messages.  The short version of
the issue is that if you pass the following blurb in a Document-style
WSDL used with WSDL2Java will create beans that de/serialize properly

	<xs:complexType name="EmailAddType">
		<xs:sequence>
			<xs:element name="email" type="xs:string"/>
			<xs:element name="emailKind" type="EmailKind"/>
		</xs:sequence>
	</xs:complexType>

However... the blurb with upper case starting letters below will cause
Invalid element user exceptions when the corresponding request is sent
to axis.

	<xs:complexType name="EmailAddType">
		<xs:sequence>
			<xs:element name="Email" type="xs:string"/>
			<xs:element name="EmailKind" type="EmailKind"/>
		</xs:sequence>
	</xs:complexType>

This seems to be an issue that has been addressed before in the axis
user list (I looked to see if there was a way around it or if it was
known) and it seems that the lower-case names are more in line with JSR
101 mapping.  It's not a big problem, and there is an easy enough work
around.  But it was still an inconsistency that was really confusing at
first, and I wonder if anything can be done to either allow upper-case
names in complex requests or to force the change in lower-case in the
WSDL2Java tool.

More Detailed Explanation, background and examples: 


First , I have been having a wonderful time tinkering with AXIS, I
basically was presented with it two weeks ago as "something that can
publish a web service" and I still boggle at the usefulness of the
WSDL/Java tools and how easy it is to make a de/serializing webservice
interface for my enterprise application.  I have also loved just being
able to write the document WSDL I want and have WSDL2Java generate all
the classes and have it work.  I initially hit a few other issues, like
the axis generated WSDL having strange package back-references to some
of the types... And attributes not going through... But most of those
went away with me tinkering with WSDL/Schema... and upgrading from 1.0
to 1.1

When I started, my service had fairly simple requests:  Things that just
had one string or int going in.  In fact, the WSDL I've attached the
simple requests like GetCustomerByID have upper-case first letters that
are accepted without fuss.  When I started making the more complex
AddCustomer request however, I started having SOAP requests cause
errors... I would have been completely stuck until I thought of trying
to make the first letter lower case.  I went into the metadata for the
add-type beans and changed the names there to lower case.  The Axis
auto-generated WSDL started having lower-case names so that the requests
would match the bean names that were being sought. 

Thus, in future versions of my webservice code, I kept making sure that
the add-type names were all started with a lower case letter, and still
kept getting tripped up every other version... And making one of my
first steps after using WSDL2Java to deploy unimplimented classes to
make sure that the de/serializers all worked.

The thing that strikes me is that WSDL2Java is generating a situation
that will not work and looks like it should:  The Axis-Generated WSDL
presents the add-types with upper-case names... So XMLSpy will make
requests with upper case that end up blowing up.  One can tweak the
metadata so that the axis-generated WSDL is lower case, or one can just
make it lower-case in the original WSDL... But I haven't figured out
what needs to be done to make Upper case work.  Otherwise, you can use
Upper case first letters in simpler requests... And complex data types
that are used in responses de/serialize just fine.  Not to mention that
all upper-case names (Like SSN in the customer add type) have to remain
all upper-case or THEY blow up. 

Perhaps there is a flag or limitation I'm just not aware of? If not I
feel that the de/serializers in beans created by the WSDL2Java tool
should be able to handle upper case names... Or the beans should be
autogenerated with metadata that force the JSR 101 convention into the
auto-generated WSDL (have lower-case first letters, even if the WSDL
they are being generated from has upper-case first letters).  I'd prefer
the first case over the second case, because that increases flexibility
of Axis encoding rather than pushing an axis convention out to these
webservices.

Any Thoughts/Comments are appreciated.