Please create a jira with wsdl if you have this problem with Axis2 1.5.
thanks,
Amila.
On Wed, Nov 18, 2009 at 4:09 PM, Kang, YongLiang ylk...@telenav.cn wrote:
Hi guys,
I use axis2 v1.4
I claim a complex type as abstract in xsd and derived some subclass from
it. Then I use soapUi for testing.
In soapUI when I set the subtype and request, everything works fine.
However I found I can set the field as the 'abstract' type and do the
request.
I suppose to received some warning in soapUI. However it reaches my
axis2 server directly.
I use wsdl2java to generate code. I checked the generated code and found
this:
public static FieldBase parse(javax.xml.stream.XMLStreamReader
reader) throws java.lang.Exception{
FieldBase object =
null;
...
...
// handle attribute id
java.lang.String tempAttribId =
reader.getAttributeValue(null,id);
if (tempAttribId!=null){
java.lang.String content = tempAttribId;
object.setId(
org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(tempAttri
bId));
Seems the auto generated code declare a null object and set value for it
directly. No matter how soapUI works. I think it is a bug in axis2
code-gen part.
Please correct me if I am wrong about some parts.
soap with normal subtype: field xsi:type=v101: fieldText id=1 ...
soap with abstract subtype: field id=1 ...
xsd sample:
complexType name=fieldBase abstract=true
complexContent
extension base=comm10:tExtensibleElement
sequence
...
complexType name=fieldText
complexContent
extension base=tns: fieldBase
...
Best wishes!
Peter Y.L.Kang
msn: peter_ylk...@hotmail.com
Software Engineer, Sever Dept.
--
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/