You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Luis Bobo_Alten <lu...@nxp.com> on 2008/06/11 17:51:54 UTC

Why Axis2 Engine sends "type" in the "return" tag of SOAP Response Messages?



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
return@myNameSpeceURI

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

Re: Why Axis2 Engine sends "type" in the "return" tag of SOAP Response Messages?

Posted by ChandraR <se...@gmail.com>.
Hi Deepal,

I'm also facing the same problem. Is this fixed? 

Regards,
Chandra R



Deepal Jayasinghe wrote:
> 
> 
>> 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.
>>
> Actually that is something in my list for immediate fix. The idea of 
> type is something like xsi:type. But we are not handling that correctly. 
> So with this you can have interface which returns interfaces , but at 
> the run time you can return any implementation class of that interface. 
> So putting the type attribute help other side to figure out the type of 
> the object in the message.
> 
> Thank you!
> Deepal
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Why-Axis2-Engine-sends-%22type%22-in-the-%22return%22-tag-of-SOAP-Response-Messages--tp17781129p21857991.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: Why Axis2 Engine sends "type" in the "return" tag of SOAP Response Messages?

Posted by Luis Bobo_Alten <lu...@nxp.com>.
Thanks to you, Deepal, for your response.

Anyways, do you think that I could, manually, try to "handle" somehow the
Axis2 response message to remove this "type" attribute in the "return"
type, before it is delivered to the Client? Maybe in one of the phases?

Regards,
Luis Bobo



                                                                           
                                                                           
                                                                           
                                                                        To 
                                       axis-user@ws.apache.org             
                                                                        cc 
     Deepal Jayasinghe                                                     
     <de...@opensource.lk>                                        Subject 
                                       Re: Why Axis2 Engine sends "type"   
     2008-06-12 07:03 AM               in the "return" tag of SOAP         
                                       Response Messages?                  
                                                                           
         Please respond to                                                 
      axis-user@ws.apache.org                                              
                                                                           
                                                                           
                                                                           





> 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.
>
Actually that is something in my list for immediate fix. The idea of
type is something like xsi:type. But we are not handling that correctly.
So with this you can have interface which returns interfaces , but at
the run time you can return any implementation class of that interface.
So putting the type attribute help other side to figure out the type of
the object in the message.

Thank you!
Deepal


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Why Axis2 Engine sends "type" in the "return" tag of SOAP Response Messages?

Posted by Deepal Jayasinghe <de...@opensource.lk>.
> 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.
>
Actually that is something in my list for immediate fix. The idea of 
type is something like xsi:type. But we are not handling that correctly. 
So with this you can have interface which returns interfaces , but at 
the run time you can return any implementation class of that interface. 
So putting the type attribute help other side to figure out the type of 
the object in the message.

Thank you!
Deepal


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org