axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vivekananda Moosani" <vivekananda_moos...@persistent.co.in>
Subject RE: Does Axis 2 allow passing of sub class objects ??
Date Wed, 21 Nov 2007 05:18:20 GMT
Hi Petr, 

The schema looks fine. You have an attribute "generateAllClasses" for the
ant task. 
You can refer http://ws.apache.org/axis2/tools/1_3/CodegenToolReference.html
here for more options (both for command line execution and for the ant task)

Regards,
Vivek
________________________________________
From: Petr V. [mailto:greatman787@yahoo.com] 
Sent: Wednesday, November 21, 2007 3:42 AM
To: axis-user@ws.apache.org
Subject: RE: Does Axis 2 allow passing of sub class objects ??

Thanks Moosani, I believe I am facing similar issue. Could you please help
me with following

I am seeing the snippet where I egenrate java classes from wsdl but not sure
how could I specify -g ?

 <wsdl2java
wsdlFilename="http://localhost:8080/services/InventoryService?wsdl"
                  output="${build.dir}/client"
                  packageName="com.hp.cp.stubs.inv" databindingName="adb"
                         
namespaceToPackages="http://quickstart.samples/xsd=com.hp.cp.stubs.inv.xsd"
                 language="java" 
                 synconly="true" 

/>


and in wsdl, I added manually following snippet. Filter is an interface and
LocationFilter is a class implementing it

<xs:element name="LocationFilter" type="ns:LocationFilter" />
            <xs:complexType name="LocationFilter">
                <xs:complexContent>
                    <xs:extension base="ns:Filter">
                        <xs:sequence>
                            <xs:element name="locationId" nillable="true"
type="xs:int"/>
                        </xs:sequence>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>

Thanks in advance

Petr V.


Vivekananda Moosani <vivekananda_moosani@persistent.co.in> wrote:
Hello, 
 
We had a similar case. We were generating both sever side and client classes
from WSDL. We had a DataNode type which gets passed in the WebService
methods. But the client can also send a subtype like StructuredDataNode or
UnstructuredDataNode. We had the subtypes even defined in the schema in the
WSDL. 
 
If you have a similar situation then while generating classes also give –g
option to WSDL2Java. This generates classes for types which are not directly
used in Web service operations like the sub type in this case. You can pass
a subtype in the calls to Web Service methods. 
 
Hope this helps!
 
-
Vivek
 
________________________________________
From: Petr V. [mailto:greatman787@yahoo.com] 
Sent: Tuesday, November 20, 2007 6:31 AM
To: axis-user@ws.apache.org
Subject: Does Axis 2 allow passing of sub class objects ??
 
Let's assume that I have a web service that has an operation

void fun(MyInterface if) 

can I call it like 

fun(mo); where mo is of type MyObject that implements MyInterface.

Does Axis 2 and web services in general support this i-e passing object of
sub class or implementing class for interface.

Thanks,
  
________________________________________
Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.
DISCLAIMER ========== This e-mail may contain privileged and confidential
information which is the property of Persistent Systems Ltd. It is intended
only for the use of the individual or entity to which it is addressed. If
you are not the intended recipient, you are not authorized to read, retain,
copy, print, distribute or use this message. If you have received this
communication in error, please notify the sender and delete all copies of
this message. Persistent Systems Ltd. does not accept any liability for
virus infected mails.

  
________________________________________
Never miss a thing. Make Yahoo your homepage. 


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent
Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed.
If you are not the intended recipient, you are not authorized to read, retain, copy, print,
distribute or use this message. If you have received this communication in error, please notify
the sender and delete all copies of this message. Persistent Systems Ltd. does not accept
any liability for virus infected mails.

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


Mime
View raw message