I have recently used Axis2 1.2 wsdl2java to process some Dotnet specific WSDL
to produce the necessary service classes to demonstrate polymorphism.
For example, in that WSDL, there is a base class (BaseRetObject), and a sub
class (SubRetObject) which extends BaseRetObject.
<s:complexType name="BaseRetObject">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="baseRetStr" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="baseRetInt" type="s:int" />
</s:sequence>
</s:complexType>
<s:complexType name="SubRetObject">
<s:complexContent mixed="false">
<s:extension base="tns:BaseRetObject">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="subRetStr" type="s:string"
/>
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>
There is a webmethod which simply returns the BaseRetObject. The (Java) service
code creates a SubRetObject and returns it as a BaseRetObject. The (DotNet)
client receives the BaseRetObject, checks to see its type (using C# "is"
operator) and successfully casts it. TcpTrace shows that the return object is
serialized as a SubRetObject so that all data is included.
The real problem that I am running into is that wsdl2java will not produce the
necessary objects for SubRetObject unless it is used in a webmethod interface.
Simply adding the SubRetObject definition to the WSDL does not influence
wsdl2java to produce the associated classes. I had to add a webmethod stub that
contained references to the subclass (SubRetObject) before wsdl2java was able
to produce the correct service objects. Is there someway to generate objects
for classes not included in a webmethod interface? I ran into the same problem
in DotNet.
thanks, Dave
--
This message was sent on behalf of [EMAIL PROTECTED] at openSubscriber.com
http://www.opensubscriber.com/message/[email protected]/6553779.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]