Thank you!

I do have a question - the complex object in question is an existing class;
that is, I'm not in a position to generate the code for the class via the
well-known processes.

That being the case, how does Axis know how to generate the response XML?
There isn't any data binding information in this example, that I can see.



Raghu Upadhyayula wrote:
> 
> Hi Feh,
> 
>  
> 
>      Here is how you return complex object with Axis2 (I'm showing this
> in WSDL 1.1 version).
> 
>       
> 
>       For Example:
> 
>       Say you have the following method.
> 
>       
> 
>       public Employee findEmployee (long empId);
> 
>       
> 
>       This method is returning an Employee object which is a complex
> object.
> 
>       
> 
>       The Employee object looks like this.
> 
>       
> 
>       Employee
> 
>           String empName;
> 
>           String empDesignation;
> 
>           int    empAge
> 
>           String empDepartmentName
> 
>       
> 
>       In your WSDL you represent this as follows (I'm showing the WSDL
> in document/literal style and I'm showing only the schema definition
> part, not the message, portType, binding & service parts, I hope you can
> handle those).
> 
>       
> 
> <definitions targetNamespace="urn:ws.rsys.com" 
> 
>              xmlns="http://schemas.xmlsoap.org/wsdl/"; 
> 
>              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
> 
>              xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> 
>              xmlns:tns="your namespace">
> 
>       <types>
> 
>           <schema elementFormDefault="qualified"
> 
>                   xmlns="http://www.w3.org/2001/XMLSchema"; 
> 
>                   targetNamespace="your namespace">
> 
>  
> 
>               <element name="findEmployee">
> 
>                   <complexType>
> 
>                       <sequence>
> 
>                           <element name="empId" type="xsd:long"/>
> 
>                       </sequence>
> 
>                   </complexType>
> 
>               </element>
> 
>               
> 
>               <complexType name="Employee">
> 
>                   <sequence>
> 
>                       <elemenet name="name" type="xsd:string"/>
> 
>                       <elemenet name="designation" type="xsd:string"/>
> 
>                       <elemenet name="age" type="xsd:int"/>
> 
>                       <elemenet name="departmentName"
> type="xsd:string"/>
> 
>                   </sequence>
> 
>               </complexType>
> 
>               
> 
>               <element name="findEmployeeResponse">
> 
>                   <complexType>
> 
>                       <sequence>
> 
>                           <element name="findEmployeeReturn"
> type="tns:Employee"/>
> 
>                       </sequence>
> 
>                   </complexType>
> 
>               </element>
> 
>           </schema>
> 
>       </types>
> 
>       ... message ...
> 
>       ... portType ...  
> 
>       ... binding ...
> 
>       ... service ...
> 
> </definitions>
> 
>       
> 
> Thanks
> 
> Raghu
> 
> -----Original Message-----
> From: feh [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, August 09, 2007 1:58 PM
> To: [email protected]
> Subject: returning complex object with Axis2
> 
>  
> 
>  
> 
> Please bear with me...it's been a few months since I've worked with Axis
> 2,
> 
> so my description of the situation may not be very clear...
> 
>  
> 
> I've learned just enough about Axis 2 to write a soap service. It is a
> 
> little bit unusual, in that the soap service was added to an existing
> web
> 
> application, running under Tomcat. From what I remember, Axis 2 was
> designed
> 
> to be its own container, so I had to find instructions somewhere on the
> net
> 
> (where, I don't remember), which outlined how to incorporate Axis2 into
> an
> 
> existing web app. Needless to say, this is probably not a "standard"
> 
> installation.
> 
>  
> 
> Anyway, all my services currently return primitive values (String, int,
> 
> int[], etc). I'm wondering how to return complex objects, if it's
> possible. 
> 
>  
> 
> Is there documentation or a howto that covers this situation? In all the
> 
> examples I've looked at so far, the service methods all return
> primitives.
> 
>  
> 
> Thanks.
> 
> -- 
> 
> View this message in context:
> http://www.nabble.com/returning-complex-object-with-Axis2-tf4245196.html
> #a12080657
> 
> Sent from the Axis - User mailing list archive at Nabble.com.
> 
>  
> 
>  
> 
> ---------------------------------------------------------------------
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> 
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>  
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/returning-complex-object-with-Axis2-tf4245196.html#a12128081
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to