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 Yu-Hui Jin <yu...@gmail.com> on 2006/02/08 01:19:26 UTC

method missing for WSDL containing simpleType use.

Hi, there,

I defined the following type in my WSDL.

    <xs:simpleType name="PropertyType">
      <xs:restriction base="xs:string">
        <xs:enumeration value="String"/>
        <xs:enumeration value="Integer"/>
        <xs:enumeration value="Long"/>
        <xs:enumeration value="Decimal"/>
      </xs:restriction>
    </xs:simpleType>

The used in in an element:

    <xs:element name="Item">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="ASIN" type="xs:string"/>
          <xs:element name="Property" type="tns:Property" minOccurs="0"
maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:complexType>
    </xs:element>

The code generates without any problem. But Eclipse reports compilation
error: The method convertToPropertyType(String) is undefined for the type
ConverterUtil in the Property.java.

I displayed the line which uses the method in bold here:

                    if ("Type".equals(reader.getLocalName())) {
                        String content = reader.getElementText();
                        object.setType(
org.apache.axis2.databinding.utils.ConverterUtil.convertToPropertyType(
                                content));
                        count++;
                    }

Is this a bug or am I missing anything?


regards,

-Hui

Re: method missing for WSDL containing simpleType use.

Posted by Yu-Hui Jin <yu...@gmail.com>.
Thanks, Ann. I copied the wrong part in my email. So I used the PropertyType
in another type called Property. (Then I used Property to define the element
Item.)


    <xs:complexType name="Property">
      <xs:sequence>
        <xs:element name="Name" type="xs:string"/>
        <xs:element name="Value" type="xs:string"/>
        <xs:element name="Type" type="tns:PropertyType" minOccurs="0"/>
        <xs:element name="Unit" type="xs:string" minOccurs="0"/>
       </xs:sequence>
    </xs:complexType>

Any thoughts?


thanks,

-hui





On 2/7/06, Anne Thomas Manes <at...@gmail.com> wrote:
>
> Is this a typo in your email or in your WSDL:
>
> <xs:element name="Property" type="tns:Property"
>       should be
> <xs:element name="Property" type="tns:PropertyType"
>
> Anne
>
> On 2/7/06, Yu-Hui Jin <yu...@gmail.com> wrote:
> >
> >
> > Hi, there,
> >
> > I defined the following type in my WSDL.
> >
> >     <xs:simpleType name="PropertyType">
> >       <xs:restriction base="xs:string">
> >         <xs:enumeration value="String"/>
> >         <xs:enumeration value="Integer"/>
> >         <xs:enumeration value="Long"/>
> >         <xs:enumeration value="Decimal"/>
> >       </xs:restriction>
> >     </xs:simpleType>
> >
> > The used in in an element:
> >
> >     <xs:element name="Item">
> >       <xs:complexType>
> >         <xs:sequence>
> >           <xs:element name="ASIN" type="xs:string"/>
> >           <xs:element name="Property" type="tns:Property" minOccurs="0"
> > maxOccurs="unbounded"/>
> >         </xs:sequence>
> >       </xs:complexType>
> >     </xs:element>
> >
> > The code generates without any problem. But Eclipse reports compilation
> > error: The method convertToPropertyType(String) is undefined for the type
> > ConverterUtil in the Property.java.
> >
> > I displayed the line which uses the method in bold here:
> >
> >                     if ("Type".equals(reader.getLocalName())) {
> >                         String content = reader.getElementText();
> >                         object.setType (
> > org.apache.axis2.databinding.utils.ConverterUtil.convertToPropertyType(
> >                                 content));
> >                         count++;
> >                     }
> >
> > Is this a bug or am I missing anything?
> >
> >
> > regards,
> >
> > -Hui
> >
>
>

Re: method missing for WSDL containing simpleType use.

Posted by Anne Thomas Manes <at...@gmail.com>.
Is this a typo in your email or in your WSDL:

<xs:element name="Property" type="tns:Property"
      should be
<xs:element name="Property" type="tns:PropertyType"

Anne

On 2/7/06, Yu-Hui Jin <yu...@gmail.com> wrote:
>
>
> Hi, there,
>
> I defined the following type in my WSDL.
>
>     <xs:simpleType name="PropertyType">
>       <xs:restriction base="xs:string">
>         <xs:enumeration value="String"/>
>         <xs:enumeration value="Integer"/>
>         <xs:enumeration value="Long"/>
>         <xs:enumeration value="Decimal"/>
>       </xs:restriction>
>     </xs:simpleType>
>
> The used in in an element:
>
>     <xs:element name="Item">
>       <xs:complexType>
>         <xs:sequence>
>           <xs:element name="ASIN" type="xs:string"/>
>           <xs:element name="Property" type="tns:Property" minOccurs="0"
> maxOccurs="unbounded"/>
>         </xs:sequence>
>       </xs:complexType>
>     </xs:element>
>
> The code generates without any problem. But Eclipse reports compilation
> error: The method convertToPropertyType(String) is undefined for the type
> ConverterUtil in the Property.java.
>
> I displayed the line which uses the method in bold here:
>
>                     if ("Type".equals(reader.getLocalName())) {
>                         String content = reader.getElementText();
>                         object.setType (
> org.apache.axis2.databinding.utils.ConverterUtil.convertToPropertyType(
>                                 content));
>                         count++;
>                     }
>
> Is this a bug or am I missing anything?
>
>
> regards,
>
> -Hui
>

Re: method missing for WSDL containing simpleType use.

Posted by Yu-Hui Jin <yu...@gmail.com>.
Sorry, a typo at the end of the first paragraph: I meant the exception is
for the ItemProperty.java, since I changed the element's name.


thanks,

-Hui

On 2/7/06, Jim Azeltine <ja...@sbcglobal.net> wrote:
>
> Because I figured that since you said that you were using Eclipse, and you
> were working with web services, that you were using the WTP plugin.
> I would guess that you are picking up the Property class from the wrong
> package in your classpath.
>
> Jim
>
> *Yu-Hui Jin <yu...@gmail.com>* wrote:
>
> Hi, Jim,
>
> Not sure how you figure out i'm using WTP. But I don't see how it has to
> do with this generation problem. Besides, I'm not using Axis plugin at all,
> I simply use the command-line WSDL2Java in Axis2 0.94.
>
>
> -Hui
>
>
> On 2/7/06, Jim Azeltine <ja...@sbcglobal.net> wrote:
> >
> > You need to find out if the Eclipse WTP plugin even supports Axis 2 yet.
> >
> > Jim
> >
> > *Yu-Hui Jin < yuhui.jin@gmail.com>* wrote:
> >
> >
> > Hi, there,
> >
> > I defined the following type in my WSDL.
> >
> >     <xs:simpleType name="PropertyType">
> >       <xs:restriction base="xs:string">
> >         <xs:enumeration value="String"/>
> >         <xs:enumeration value="Integer"/>
> >         <xs:enumeration value="Long"/>
> >         <xs:enumeration value="Decimal"/>
> >       </xs:restriction>
> >     </xs:simpleType>
> >
> > The used in in an element:
> >
> >     <xs:element name="Item">
> >       <xs:complexType>
> >         <xs:sequence>
> >           <xs:element name="ASIN" type="xs:string"/>
> >           <xs:element name="Property" type="tns:Property" minOccurs="0"
> > maxOccurs="unbounded"/>
> >         </xs:sequence>
> >       </xs:complexType>
> >     </xs:element>
> >
> > The code generates without any problem. But Eclipse reports compilation
> > error: The method convertToPropertyType(String) is undefined for the type
> > ConverterUtil in the Property.java.
> >
> > I displayed the line which uses the method in bold here:
> >
> >                     if ("Type".equals(reader.getLocalName())) {
> >                         String content = reader.getElementText();
> >                         object.setType (
> > org.apache.axis2.databinding.utils.ConverterUtil.convertToPropertyType (
> >                                 content));
> >                         count++;
> >                     }
> >
> > Is this a bug or am I missing anything?
> >
> >
> > regards,
> >
> > -Hui
> >
> >
> >
>
>

Re: method missing for WSDL containing simpleType use.

Posted by Jim Azeltine <ja...@sbcglobal.net>.
Because I figured that since you said that you were using Eclipse, and you were working with web services, that you were using the WTP plugin. 
  I would guess that you are picking up the Property class from the wrong package in your classpath.
   
  Jim

Yu-Hui Jin <yu...@gmail.com> wrote:
  Hi, Jim,

Not sure how you figure out i'm using WTP. But I don't see how it has to do with this generation problem. Besides, I'm not using Axis plugin at all, I simply use the command-line WSDL2Java in Axis2 0.94. 


-Hui


  On 2/7/06, Jim Azeltine <ja...@sbcglobal.net> wrote:    You need to find out if the Eclipse WTP plugin even supports Axis 2 yet.
   
  Jim  

Yu-Hui Jin < yuhui.jin@gmail.com> wrote:

    
Hi, there, 

I defined the following type in my WSDL. 

    <xs:simpleType name="PropertyType">
      <xs:restriction base="xs:string">
        <xs:enumeration value="String"/> 
        <xs:enumeration value="Integer"/>
        <xs:enumeration value="Long"/>
        <xs:enumeration value="Decimal"/>
      </xs:restriction>
    </xs:simpleType> 

The used in in an element: 

    <xs:element name="Item">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="ASIN" type="xs:string"/>    
          <xs:element name="Property" type="tns:Property" minOccurs="0" maxOccurs="unbounded"/> 
        </xs:sequence>
      </xs:complexType>  
    </xs:element> 

The code generates without any problem. But Eclipse reports compilation error: The method convertToPropertyType(String) is undefined for the type ConverterUtil in the Property.java. 

I displayed the line which uses the method in bold here: 

                    if ("Type".equals(reader.getLocalName())) {
                        String content = reader.getElementText();
                        object.setType (org.apache.axis2.databinding.utils.ConverterUtil.convertToPropertyType (
                                content));
                        count++;
                    }

Is this a bug or am I missing anything? 


regards,

-Hui
  




  


Re: method missing for WSDL containing simpleType use.

Posted by Yu-Hui Jin <yu...@gmail.com>.
Hi, Jim,

Not sure how you figure out i'm using WTP. But I don't see how it has to do
with this generation problem. Besides, I'm not using Axis plugin at all, I
simply use the command-line WSDL2Java in Axis2 0.94.


-Hui


On 2/7/06, Jim Azeltine <ja...@sbcglobal.net> wrote:
>
> You need to find out if the Eclipse WTP plugin even supports Axis 2 yet.
>
> Jim
>
> *Yu-Hui Jin <yu...@gmail.com>* wrote:
>
>
> Hi, there,
>
> I defined the following type in my WSDL.
>
>     <xs:simpleType name="PropertyType">
>       <xs:restriction base="xs:string">
>         <xs:enumeration value="String"/>
>         <xs:enumeration value="Integer"/>
>         <xs:enumeration value="Long"/>
>         <xs:enumeration value="Decimal"/>
>       </xs:restriction>
>     </xs:simpleType>
>
> The used in in an element:
>
>     <xs:element name="Item">
>       <xs:complexType>
>         <xs:sequence>
>           <xs:element name="ASIN" type="xs:string"/>
>           <xs:element name="Property" type="tns:Property" minOccurs="0"
> maxOccurs="unbounded"/>
>         </xs:sequence>
>       </xs:complexType>
>     </xs:element>
>
> The code generates without any problem. But Eclipse reports compilation
> error: The method convertToPropertyType(String) is undefined for the type
> ConverterUtil in the Property.java.
>
> I displayed the line which uses the method in bold here:
>
>                     if ("Type".equals(reader.getLocalName())) {
>                         String content = reader.getElementText();
>                         object.setType (
> org.apache.axis2.databinding.utils.ConverterUtil.convertToPropertyType(
>                                 content));
>                         count++;
>                     }
>
> Is this a bug or am I missing anything?
>
>
> regards,
>
> -Hui
>
>
>

Re: method missing for WSDL containing simpleType use.

Posted by Jim Azeltine <ja...@sbcglobal.net>.
You need to find out if the Eclipse WTP plugin even supports Axis 2 yet.
   
  Jim

Yu-Hui Jin <yu...@gmail.com> wrote:
  
Hi, there, 

I defined the following type in my WSDL. 

    <xs:simpleType name="PropertyType">
      <xs:restriction base="xs:string">
        <xs:enumeration value="String"/> 
        <xs:enumeration value="Integer"/>
        <xs:enumeration value="Long"/>
        <xs:enumeration value="Decimal"/>
      </xs:restriction>
    </xs:simpleType> 

The used in in an element: 

    <xs:element name="Item">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="ASIN" type="xs:string"/>    
          <xs:element name="Property" type="tns:Property" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:complexType>  
    </xs:element> 

The code generates without any problem. But Eclipse reports compilation error: The method convertToPropertyType(String) is undefined for the type ConverterUtil in the Property.java. 

I displayed the line which uses the method in bold here: 

                    if ("Type".equals(reader.getLocalName())) {
                        String content = reader.getElementText();
                        object.setType (org.apache.axis2.databinding.utils.ConverterUtil.convertToPropertyType(
                                content));
                        count++;
                    }

Is this a bug or am I missing anything? 


regards,

-Hui