Thanks Anne.  Your blog article on the wrapped document style is a good read.


-Hui



On 2/8/06, Anne Thomas Manes < [EMAIL PROTECTED]> wrote:
Actually, there is a problem in the WSDL, although that isn't what's causing your problem. As Ajith says, you're trying to use a feature that isn't yet supported. But meanwhile, for completeness sake...

When using style="rpc", your message parts must reference types, not elements. You can fix the WSDL either by changing the style to "document" and removing the @namespace attributes from the <soap:body> definitions (the easy alternative), or by changing the message part definitions to:

  <message name="GetItemByIdResponse">
    <part name="Item" type="xsd:Item"/>
  </message>
  <message name="GetItemByIdRequest">
    <part name="Id" type="xs:string"/>
  </message>

And change the anonymous complexType definition in your Item element definition to a named type called "Item".

Anne


On 2/8/06, Ajith Ranabahu <[EMAIL PROTECTED]> wrote:
Hi Hui,
There's nothing wrong with your WSDL but it's an Axis2- ADB
limitation for the time. We do not handle simple type
restrictions/enumerations - the schema parser just ignores the
simpletype's restriction and picks up OMElement for that!
If you need to use enums I would say you need to move to XMLBeans

Ajith

On 2/8/06, Yu-Hui Jin < [EMAIL PROTECTED]> wrote:
> 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 < [EMAIL PROTECTED] > 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 <[EMAIL PROTECTED] > 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 < [EMAIL PROTECTED]> wrote:
>
>             You need to find out if the Eclipse WTP plugin even supports
> Axis 2 yet.
>
>             Jim
>
>
>             Yu-Hui Jin < [EMAIL PROTECTED]> 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
>
>
>
>
>
>
>


--
Ajith Ranabahu


Reply via email to