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 Ajay Kumar Gour <aj...@s7solutions.com> on 2007/04/23 06:24:36 UTC

Confused...

Hi Amila,

Few days back, Sathija asked the question about polymorphism support in  
Axis2 for POJO. You guys have replied that POJO service does'nt support  
the polymorphism but ADB client does give full support to polymorphism,  
however, in this "http://ws.apache.org/axis2/1_0/adb/adb-howto.html#deep"  
document it is clearly mentioned that

"ADB is meant to be a 'Simple' databinding framework and was not meant to  
compile all types of
schemas. The following limitations are the most highlighted.

1. Complex Extensions and Restrictions, Simple Extensions and Restrictions  
are not supported.
2. xsi:type based deserialization is not supported. Hence extension based  
structures that use
xsi:type attribute may fail."

Iam was trying with some code also. But iam not successful yet.

So, should i consider that ADB does'nt support polymorphism at all?

I have communicated with Dennis on this issue and he suggested me to ask  
you. Awaiting for your response.

Thanks,
-Ajay

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


Re: Re: Confused...

Posted by Davanum Srinivas <da...@gmail.com>.
did you try the "-g" option in WSDL2Java?

On 5/30/07, dkraus@microstrategy.com <dk...@microstrategy.com> wrote:
> 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 dkraus@microstrategy.com at openSubscriber.com
> http://www.opensubscriber.com/message/axis-user@ws.apache.org/6553779.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Davanum Srinivas :: http://davanum.wordpress.com

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


RE: Re: Confused...

Posted by "Kraus, David" <dk...@MicroStrategy.com>.
Martin,

I am not exactly sure what you are asking, and whether this is a general
WSDL question, or a question pertaining to the implementation of
polymorphism.

You use the term "entity". Are you talking about attributes of the
element WSDL tag? We typically see the attributes minoccurs and
maxoccurs also included in the element tag.

I have included the WSDL to my test service which I have used to
demonstrate polymorphism. The service has one webmethod:

BaseRetObject MorphThis(BaseParmObject inPoly);

I have conducted experiments which have a client create a SubParmObject
(extends BaseParmObject) and pass it in to the MorphThis method. The
service takes the data and stuffs it in a SubRetObject (extends
BaseRetObject) before returning it to the client.

Thanks, Dave

=====wsdl below========

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://tempuri.org/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://tempuri.org/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified"
targetNamespace="http://tempuri.org/">
      <s:element name="MorphThis">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="inPoly"
type="tns:BaseParmObject" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="BaseParmObject">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="baseParmStr"
type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="baseParmInt"
type="s:int" />
        </s:sequence>
      </s:complexType>
      <s:element name="MorphThisResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1"
name="MorphThisResult" type="tns:BaseRetObject" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <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="SubParmObject">
        <s:complexContent mixed="false">
          <s:extension base="tns:BaseParmObject">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="subParmStr"
type="s:string" />
            </s:sequence>
          </s:extension>
        </s:complexContent>
      </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>
      <s:complexType name="SubParm2Object">
        <s:complexContent mixed="false">
          <s:extension base="tns:BaseParmObject">
            <s:sequence>
              <s:element minOccurs="1" maxOccurs="1" name="subParmInt"
type="s:int" />
            </s:sequence>
          </s:extension>
        </s:complexContent>
      </s:complexType>
      <s:complexType name="SubRet2Object">
        <s:complexContent mixed="false">
          <s:extension base="tns:BaseRetObject">
            <s:sequence>
              <s:element minOccurs="1" maxOccurs="1" name="subRetInt"
type="s:int" />
            </s:sequence>
          </s:extension>
        </s:complexContent>
      </s:complexType>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="MorphThisSoapIn">
    <wsdl:part name="parameters" element="tns:MorphThis" />
  </wsdl:message>
  <wsdl:message name="MorphThisSoapOut">
    <wsdl:part name="parameters" element="tns:MorphThisResponse" />
  </wsdl:message>
  <wsdl:portType name="PolyServiceSoap">
    <wsdl:operation name="MorphThis">
      <wsdl:input message="tns:MorphThisSoapIn" />
      <wsdl:output message="tns:MorphThisSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="PolyServiceSoap" type="tns:PolyServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="MorphThis">
      <soap:operation soapAction="http://tempuri.org/MorphThis"
style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="PolyService">
    <wsdl:port name="PolyServiceSoap" binding="tns:PolyServiceSoap">
      <soap:address
location="http://localhost:8080/PolyTest/services/PolyService" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
======end wsdl=========

-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Wednesday, May 30, 2007 7:09 PM
To: Kraus, David
Cc: axis-user@ws.apache.org
Subject: Re: Re: Confused...

Good Evening Dave

looking quickly at the WSDL A defined service has 1+ Binding/Port 
combination for each location
e.g.
<wsdl:service name="StockQuoteService">
<wsdl:port name="StockQuoteServiceSOAP11port" 
binding="axis2:StockQuoteServiceSOAP11Binding">
<soap:address 
location="http://localhost:8080/axis2/services/StockQuoteService" />
</wsdl:port>

so looking at the example of binding of StockService which has 
binding="axis2:StockQuoteServiceSOAP11Binding"
(as we have been shown binding StockQuoteServiceSOAP11Binding has 1
PortType 
called 'StockQuoteServiceSOAP11port')

PortType has input and output messages
<wsdl:portType name="StockQuoteServicePortType">
<wsdl:operation name="getPrice">

<wsdl:input message="axis2:getPriceMessage" />
<wsdl:output message="axis2:getPriceResponseMessage" />

</wsdl:operation>

The inputMessage getPriceMessage has a definition which contains one or
more 
part names
<wsdl:message name="getPriceMessage">
<wsdl:part name="part1" element="ns:getPrice" />
</wsdl:message>

the localpart element getPrice has the message getPrice which is a 
complexType defined of even more elements
<xs:element name="getPrice">
<xs:complexType>
<xs:sequence>
<xs:element name="symbol" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>

Any other entities which getPrice does not need (other than symbol) is 
extraneous to the run characteristics of the operation and are not 
identified or carried by the message
Are you envisioning a need to carry any other entity?..if so how should
the 
message identify these characteristics ?

Thanks,
Martin--
This email message and any files transmitted with it contain
confidential
information intended only for the person(s) to whom this email message
is
addressed.  If you have received this email message in error, please
notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: <dk...@microstrategy.com>
To: <ax...@ws.apache.org>
Sent: Wednesday, May 30, 2007 2:02 PM
Subject: Re: Re: Confused...


>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 dkraus@microstrategy.com at 
> openSubscriber.com
>
http://www.opensubscriber.com/message/axis-user@ws.apache.org/6553779.ht
ml
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
> 

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


Re: Re: Confused...

Posted by Martin Gainty <mg...@hotmail.com>.
Good Evening Dave

looking quickly at the WSDL A defined service has 1+ Binding/Port 
combination for each location
e.g.
<wsdl:service name="StockQuoteService">
<wsdl:port name="StockQuoteServiceSOAP11port" 
binding="axis2:StockQuoteServiceSOAP11Binding">
<soap:address 
location="http://localhost:8080/axis2/services/StockQuoteService" />
</wsdl:port>

so looking at the example of binding of StockService which has 
binding="axis2:StockQuoteServiceSOAP11Binding"
(as we have been shown binding StockQuoteServiceSOAP11Binding has 1 PortType 
called 'StockQuoteServiceSOAP11port')

PortType has input and output messages
<wsdl:portType name="StockQuoteServicePortType">
<wsdl:operation name="getPrice">

<wsdl:input message="axis2:getPriceMessage" />
<wsdl:output message="axis2:getPriceResponseMessage" />

</wsdl:operation>

The inputMessage getPriceMessage has a definition which contains one or more 
part names
<wsdl:message name="getPriceMessage">
<wsdl:part name="part1" element="ns:getPrice" />
</wsdl:message>

the localpart element getPrice has the message getPrice which is a 
complexType defined of even more elements
<xs:element name="getPrice">
<xs:complexType>
<xs:sequence>
<xs:element name="symbol" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>

Any other entities which getPrice does not need (other than symbol) is 
extraneous to the run characteristics of the operation and are not 
identified or carried by the message
Are you envisioning a need to carry any other entity?..if so how should the 
message identify these characteristics ?

Thanks,
Martin--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: <dk...@microstrategy.com>
To: <ax...@ws.apache.org>
Sent: Wednesday, May 30, 2007 2:02 PM
Subject: Re: Re: Confused...


>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 dkraus@microstrategy.com at 
> openSubscriber.com
> http://www.opensubscriber.com/message/axis-user@ws.apache.org/6553779.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
> 


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


Re: Re: Confused...

Posted by dk...@microstrategy.com.
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 dkraus@microstrategy.com at openSubscriber.com
http://www.opensubscriber.com/message/axis-user@ws.apache.org/6553779.html

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


Re: Confused...

Posted by Davanum Srinivas <da...@gmail.com>.
Ajay,

Please use latest Axis2 1.2 Release Candidates / Nightly. 1.0 is very
old and definitely does not support polymorphism. If you run into
problems, please log a JIRA.

thanks,
dims

On 4/23/07, Ajay Kumar Gour <aj...@s7solutions.com> wrote:
> Hi Amila,
>
> Few days back, Sathija asked the question about polymorphism support in
> Axis2 for POJO. You guys have replied that POJO service does'nt support
> the polymorphism but ADB client does give full support to polymorphism,
> however, in this "http://ws.apache.org/axis2/1_0/adb/adb-howto.html#deep"
> document it is clearly mentioned that
>
> "ADB is meant to be a 'Simple' databinding framework and was not meant to
> compile all types of
> schemas. The following limitations are the most highlighted.
>
> 1. Complex Extensions and Restrictions, Simple Extensions and Restrictions
> are not supported.
> 2. xsi:type based deserialization is not supported. Hence extension based
> structures that use
> xsi:type attribute may fail."
>
> Iam was trying with some code also. But iam not successful yet.
>
> So, should i consider that ADB does'nt support polymorphism at all?
>
> I have communicated with Dennis on this issue and he suggested me to ask
> you. Awaiting for your response.
>
> Thanks,
> -Ajay
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers

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