axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ales St" <sta...@seznam.cz>
Subject Re: Abstract classes and inheritance
Date Thu, 01 Dec 2005 09:24:12 GMT
Abstract classes and inheritanceHi,
do you solved your problem? Because I have got a similar problem, and I don't know how to
solve it. If you selve it, write me please.
Thank you
                Ales 
  ----- Original Message ----- 
  From: Knötzinger Markus 
  To: 'axis-user@ws.apache.org' 
  Sent: Wednesday, November 30, 2005 4:05 PM
  Subject: Abstract classes and inheritance


  Hello everyone, 

  I got stuck with a problem concerning abstract classes. 
  I've got an abstract class called 'Message' and a concrete one called 'DefaultMessage' which
does inherit 'Message'. 
  I've got a method getMessages() of return type Message[]. 
  On the server implementation the method returns an array of type 'Message', but each member
references to an instance of 'DefaultMessage'.

  On the client side I get an array with proper length but null values. If I do not declare
'Message' as abstract it works only if 'DefaultMessage' does not contain any bean members.

  The 'stubt version' of getMessages() returns instances of 'Message', not of 'DefaultMessage'
which should be the case. 
  If I add a bean member (like 'defaultValue') to 'DefaultMessage' I get an Exception from
the stub: 

  org.xml.sax.SAXException: Invalid element in test.messenger.service.Message - defaultValue


  org.apache.axis.AxisFault.makeFault(AxisFault.java:101) 
  org.apache.axis.client.Call.invoke(Call.java:2451) 
  org.apache.axis.client.Call.invoke(Call.java:2347) 
  org.apache.axis.client.Call.invoke(Call.java:1804) 
  test.messenger.service.MessengerUserSoapBindingStub.getActiveMessages(MessengerUserSoapBindingStub.java:362)

  test.messenger.gui.model.ServiceManager.getNewMessages(ServiceManager.java:57) 
  .... 

  The SOAP message looks ok. 
  It contains 'defaultValue' and defines the array elements as 'DefaultMessage'. 

  Any ideas? 

  Thanks a lot, 
  Markus 



  Here's my wsdd: 

    <service name="MessengerUser" provider="java:RPC" > 
       <!--  add SoapMonitor --> 
        <requestFlow> 
          <handler type="soapmonitor"/> 
        </requestFlow> 

        <responseFlow> 
          <handler type="soapmonitor"/> 
        </responseFlow>    




        <parameter name="className"           value="test.messenger.service.MessageUserService"/>

        <parameter name="wsdlPortType"        value="MessengerUser"/> 
        <parameter name="allowedMethods"      value="*"/> 
        <parameter name="scope"               value="Application"/> 
        <parameter name="wsdlTargetNamespace" value="http://service.messenger.test"/>




        <!-- Complex data structures: --> 
        <beanMapping qname="myNS:Message" 
                     xmlns:myNS="http://messenger.test" 
                     languageSpecificType="java:test.messenger.Message"/> 
        <beanMapping qname="myNS:Response" 
                     xmlns:myNS="http://messenger.test" 
                     languageSpecificType="java:test.messenger.Response"/> 
        <beanMapping qname="myNS:DefaultMessage" 
                     xmlns:myNS="http://messenger.test" 
                     languageSpecificType="javatest.messenger.DefaultMessage"/> 
        <beanMapping qname="myNS:DefaultResponse" 
                     xmlns:myNS="http://messenger.test" 
                     languageSpecificType="java:test.messenger.DefaultResponse"/> 



        <!-- Exceptions: --> 
        <beanMapping qname="myNS:MessengerException" 
                     xmlns:myNS="http://messenger.test" 
                     languageSpecificType="java:test.MessengerException"/> 
        <beanMapping qname="myNS:MessageNotExistsException" 
                     xmlns:myNS="http://messenger.test" 
                     languageSpecificType="java:test.messenger.MessageNotExistsException"/>


    </service> 

  </deployment> 




    

  ###########################################

  This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
  For more information, connect to http://www.F-Secure.com/ 

Mime
View raw message