axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yu-Hui Jin <yuhui....@gmail.com>
Subject Re: method missing for WSDL containing simpleType use. A BIT URGENT!
Date Wed, 08 Feb 2006 05:23:24 GMT
Yeah, I had hoped so. So I changed the names of form "Property" to
"ItemProperty". It still doesn't work, same exception complaining: The
method convertToPropertyType(String) is undefined for the type ConverterUtil
in the Property.java.

Can you guys take a brief look at it and see whether I've messed up
anything, Thanks!

Here's the Types.xsd:
==================

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://internal.aaa.com/fims/Types"
    xmlns:tns="http://internal.aaa.com/fims/Types">

    <xs:element name="Id" type="xs:string"/>

    <xs:simpleType name="ItemPropertyType">
      <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>

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

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

</xs:schema>


And the WSDL:
===========

<?xml version="1.0" encoding="UTF-8"?>
<definitions   name="fimsService"
  targetNamespace="http://internal.aaa.com/fims"
  xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:tns="http://internal.aaa.com/fims"
  xmlns:xsd="http://internal.aaa.com/fims/Types">

  <import namespace="http://internal.aaa.com/fims/Types" location="Types.xsd
"/>

  <message name="GetItemByIdResponse">
    <part name="GetItemByIdReturn" element="xsd:Item"/>
  </message>
  <message name="GetItemByIdRequest">
    <part name="GetItemByIdParam" element="xsd:Id"/>
  </message>

  <portType name="fimsServicePortType">
    <operation name="GetItemById">
      <input message="tns:GetItemByIdRequest"/>
      <output message="tns:GetItemByIdResponse"/>
    </operation>
  </portType>

  <binding name="fimsServiceBinding" type="tns:fimsServicePortType">
    <soap:binding style="document" transport="
http://schemas.xmlsoap.org/soap/http"/>
    <operation name="GetItemById">
      <soap:operation soapAction="GetItemById" style="rpc"/>
      <input>
        <soap:body namespace="http://internal.aaa.com/fims" use="literal"/>
      </input>
      <output>
        <soap:body namespace="http://internal.aaa.com/fims" use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="fimsService">
    <port name="fimsServicePort" binding="tns:fimsServiceBinding">
      <soap:address location="
http://yjin-2.desktop.aaa.com:8080/axis2/services/fims"/>
    </port>
  </service>
</definitions>









On 2/7/06, Jim Azeltine <jazeltine@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 <yuhui.jin@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 <jazeltine@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="Id" 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

Mime
View raw message