Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

axis and complex types

843833Sep 4 2009 — edited Sep 4 2009
I have a web-service, (axis 1.4):
 public class PhoneService {

    private Set<Phone> phones = new TreeSet<Phone>();

    public Set<Phone> getPhones() {
        phones.clear();
        for (int i=0; i<10; i++) {
         phones.add(
                 new Phone("1234"+i, "2"+i, 3+i )
         );
      }
      return phones;
    }

    public void setPhones(Set<Phone> phones) {
        this.phones = phones;
    }
}
WSDD for it is the following (but I tried to change 'style' and 'use' also):
  <service name="PhoneService" provider="java:RPC" style="document" use="literal">
        <parameter name="className" value="com.mycompany.tests.axis.services.PhoneService"/>
        <parameter name="allowedMethods" value="*"/>
        <parameter name="scope" value="Application"/>
        <namespace>http://services.axis.tests.mycompany.com</namespace>
    </service>
When I try to generate WSDL from the service (java to wsdl from IDEA) I got something like this:
 
<complexType name="ArrayOf_xsd_anyType">
    <sequence>
     <element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:anyType"/>
    </sequence>
   </complexType>
   <element name="getPhonesReturn" type="impl:ArrayOf_xsd_anyType"/>
   <element name="phones" type="impl:ArrayOf_xsd_anyType"/>
  </schema> 
I.e. there is not mapping for my class Phone (java-bean with getters and setters).. that why here is xsd:anyType

The question is: what i should to do to get this mapping - to get the Phone as complex type from the java code (I suppose it is not good idea to do it by hand).

Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 2 2009
Added on Sep 4 2009
7 comments
961 views