Hello,
Please, if someone can help me, I would like to know why Axis2 Engine
includes an attribute "type" in the "return" tag of a SOAP myMethodResponse
message, when the returning type of this method is a complex,
custom-defined, object.
Hereby there is an example of a SOAPMessage Response generated by Axis2 (as
seen in SOAPMonitor) after invoking this Web Method which returns a complex
object.
This complex object has been previously transformed into WSDL and Schema of
the invoked WebService from an Entity Class using java2wsdl implementation
included in Axis2:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
">
<soapenv:Body>
<ns:myMethodResponse xmlns:ns="myNameSpace">
<ns:return type="QualifiedPackageAndNameOfTheEntityClass">
<ns:field1>Value1</ns:field1>
<ns:field2>Value2</ns:field2>
<ns:field3>Value3</ns:field3>
</ns:return>
</ns:myMethodResponse>
</soapenv:Body>
</soapenv:Envelope>
This drives to an error in schema validation because, as it is defined in
doc/lit wrapped wsdl, the type of the object in the response message of a
web method is already defined in the wsdl and the schema:
<xs:element name="myMethodResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return"
nillable="true" type="xsd:myObjectEntity"/>
</xs:sequence>
</xs:complexType>
</xs:element>
...
<xs:complexType name="myObjectEntity">
<xs:complexContent>
<xs:extension base="xsd:myParentObjectEntity">
<xs:sequence>
<xs:element minOccurs="0" name="field1"
nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="field2"
nillable="true" type="xs:dateTime"/>
<xs:element minOccurs="0" name="field3"
nillable="true" type="xs:long"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
If, just for testing, I remove the type="xsd:myObjectEntity" from the
WSDL, then schema validation passes, but I get the next error when I test
the Web Service with a generic Web Service Testing client application
"Attribute not allowed (no wildcards allowed): type in element
[EMAIL PROTECTED]
It seems again there is a problem sending that "type" attribute. I have
even seen SOAP Message Response samples, and this attribute is not sent for
doc/lit wrapped web services.
Is this a bug of Axis2 Message Builder? Am I doing something wrong?
I connect EJB Endpoint with Axis2 EJBProvider, I use Axis2 1.4 and my WSDL
is doc/lit wrapped style, WS-I compliant.
Kind regards,
Luis Bobo