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 feh <ra...@berbee.com> on 2007/08/09 22:57:45 UTC
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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: returning complex object with Axis2
Posted by feh <ra...@berbee.com>.
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:ramin@berbee.com]
> Sent: Thursday, August 09, 2007 1:58 PM
> To: axis-user@ws.apache.org
> 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: 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/returning-complex-object-with-Axis2-tf4245196.html#a12128081
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
[Axis1.4] Web service not showing in the list of deployed Web services
Posted by Ce...@linedata.com.
Hi,
i see the service name of my web service in the configuration file
server-config.wsdd but it is not showing when i click in the list link in
the page http://localhost:9000/noeews/servlet/AxisServlet
does anyone know why ?
Thanks for your help.
Here is the service name in question, extracted from the
server-config.wsdd file.
<service name="SituationCompte" provider="java:RPC" style="rpc" use=
"encoded">
<parameter name="wsdlTargetNamespace" value=
"http://soap.noyau.tc.noee.lds.com"/>
<parameter name="wsdlServiceElement" value="SituationCompteService"
/>
<parameter name="schemaUnqualified" value=
"http://soap.noyau.tc.noee.lds.com,http://bean.situationcompte.soap.noyau.tc.noee.lds.com,http://bean.soap.noyau.infra.noee.lds.com"
/>
<parameter name="wsdlServicePort" value="SituationCompte"/>
<parameter name="className" value=
"com.lds.noee.tc.noyau.soap.SituationCompteSoapBindingImpl"/>
<parameter name="wsdlPortType" value="SituationCompte"/>
<parameter name="typeMappingVersion" value="1.2"/>
<operation name="situationCompte" qname="operNS:situationCompte"
xmlns:operNS="http://soap.noyau.tc.noee.lds.com" returnQName=
"situationCompteReturn" returnType="rtns:SituationCompteRetour" xmlns:rtns
="http://bean.situationcompte.soap.noyau.tc.noee.lds.com" soapAction="" >
<parameter qname="codeTccp" type="tns:string" xmlns:tns=
"http://www.w3.org/2001/XMLSchema"/>
<parameter qname="codeSiebel" type="tns:string" xmlns:tns=
"http://www.w3.org/2001/XMLSchema"/>
</operation>
<parameter name="allowedMethods" value="situationCompte"/>
<arrayMapping
xmlns:ns="http://soap.noyau.tc.noee.lds.com"
qname="ns:ArrayOf_tns1_Dispositif"
type=
"java:com.lds.noee.tc.noyau.soap.situationcompte.bean.Dispositif[]"
innerType="cmp-ns:Dispositif" xmlns:cmp-ns=
"http://bean.situationcompte.soap.noyau.tc.noee.lds.com"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
<typeMapping
xmlns:ns="http://bean.situationcompte.soap.noyau.tc.noee.lds.com"
qname="ns:SituationCompteRetour"
type=
"java:com.lds.noee.tc.noyau.soap.situationcompte.bean.SituationCompteRetour"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer=
"org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
<arrayMapping
xmlns:ns="http://soap.noyau.tc.noee.lds.com"
qname="ns:ArrayOf_tns1_Entreprise"
type=
"java:com.lds.noee.tc.noyau.soap.situationcompte.bean.Entreprise[]"
innerType="cmp-ns:Entreprise" xmlns:cmp-ns=
"http://bean.situationcompte.soap.noyau.tc.noee.lds.com"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
<typeMapping
xmlns:ns="http://bean.situationcompte.soap.noyau.tc.noee.lds.com"
qname="ns:Entreprise"
type=
"java:com.lds.noee.tc.noyau.soap.situationcompte.bean.Entreprise"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer=
"org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
<arrayMapping
xmlns:ns="http://soap.noyau.tc.noee.lds.com"
qname="ns:ArrayOf_tns1_Support"
type=
"java:com.lds.noee.tc.noyau.soap.situationcompte.bean.Support[]"
innerType="cmp-ns:Support" xmlns:cmp-ns=
"http://bean.situationcompte.soap.noyau.tc.noee.lds.com"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
<typeMapping
xmlns:ns="http://bean.situationcompte.soap.noyau.tc.noee.lds.com"
qname="ns:Dispositif"
type=
"java:com.lds.noee.tc.noyau.soap.situationcompte.bean.Dispositif"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer=
"org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
<typeMapping
xmlns:ns="http://bean.soap.noyau.infra.noee.lds.com"
qname="ns:SoapBean"
type="java:com.lds.noee.infra.noyau.soap.bean.SoapBean"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer=
"org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
<typeMapping
xmlns:ns="http://bean.situationcompte.soap.noyau.tc.noee.lds.com"
qname="ns:Support"
type=
"java:com.lds.noee.tc.noyau.soap.situationcompte.bean.Support"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer=
"org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
</service>
RE: returning complex object with Axis2
Posted by Raghu Upadhyayula <ru...@responsys.com>.
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:ramin@berbee.com]
Sent: Thursday, August 09, 2007 1:58 PM
To: axis-user@ws.apache.org
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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org