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 Jim Bender <ji...@gmail.com> on 2006/06/27 00:30:02 UTC

The duplicate type is happening here for the WSDL file

I don't know the precise step, but by the time that we leave the
generateOM() method in the Java2OMBuilder, there are two complex type
definitions in the WSDL.

    public OMElement generateOM() throws Exception {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        wsdl = fac.createOMNamespace(WSDL_NAMESPACE,
                DEFAULT_WSDL_NAMESPACE_PREFIX);
        OMElement ele = fac.createOMElement("definitions", wsdl);

        ele.addAttribute("targetNamespace", targetNamespace, null);
        generateNamespaces(fac, ele);
        generateTypes(fac, ele);
        generateMessages(fac, ele);
        generatePortType(fac, ele);
        generateBinding(fac, ele);
        generateService(fac, ele);
        return ele;
    }

The element's printString shows the story:

<wsdl:types xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns="http://testexamples/xsd"
targetNamespace="http://testexamples/xsd"
elementFormDefault="unqualified" attributeFormDefault="unqualified">
<xs:element type="ns:FoodDescription" name="FoodDescription" />
<xs:complexType name="FoodDescription">
<xs:sequence>
<xs:element type="xs:int" name="calories" />
<xs:element type="xs:int" name="fatGrams" />
<xs:element type="xs:int" name="fiberGrams" />
<xs:element type="xs:int" name="points" />
</xs:sequence>
</xs:complexType>
<xs:element name="calculatePoints">
<xs:complexType>
<xs:sequence>
<xs:element type="ns:FoodDescription" name="param0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="calculatePointsResponse">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:int" name="return" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="FoodDescription">
<xs:sequence>
<xs:element type="xs:int" name="calories" />
<xs:element type="xs:int" name="fatGrams" />
<xs:element type="xs:int" name="fiberGrams" />
<xs:element type="xs:int" name="points" />
</xs:sequence>
</xs:complexType>
</xs:schema></wsdl:types>

Regards,

Jim

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: The duplicate type is happening here for the WSDL file

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Jim;
can you please provide a way to recreate the issue , I mean any
possibility of sending java class that you use :)

Jim Bender wrote:

> I don't know the precise step, but by the time that we leave the
> generateOM() method in the Java2OMBuilder, there are two complex type
> definitions in the WSDL.
>
>    public OMElement generateOM() throws Exception {
>        OMFactory fac = OMAbstractFactory.getOMFactory();
>        wsdl = fac.createOMNamespace(WSDL_NAMESPACE,
>                DEFAULT_WSDL_NAMESPACE_PREFIX);
>        OMElement ele = fac.createOMElement("definitions", wsdl);
>
>        ele.addAttribute("targetNamespace", targetNamespace, null);
>        generateNamespaces(fac, ele);
>        generateTypes(fac, ele);
>        generateMessages(fac, ele);
>        generatePortType(fac, ele);
>        generateBinding(fac, ele);
>        generateService(fac, ele);
>        return ele;
>    }
>
> The element's printString shows the story:
>
> <wsdl:types xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><xs:schema
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:ns="http://testexamples/xsd"
> targetNamespace="http://testexamples/xsd"
> elementFormDefault="unqualified" attributeFormDefault="unqualified">
> <xs:element type="ns:FoodDescription" name="FoodDescription" />
> <xs:complexType name="FoodDescription">
> <xs:sequence>
> <xs:element type="xs:int" name="calories" />
> <xs:element type="xs:int" name="fatGrams" />
> <xs:element type="xs:int" name="fiberGrams" />
> <xs:element type="xs:int" name="points" />
> </xs:sequence>
> </xs:complexType>
> <xs:element name="calculatePoints">
> <xs:complexType>
> <xs:sequence>
> <xs:element type="ns:FoodDescription" name="param0" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="calculatePointsResponse">
> <xs:complexType>
> <xs:sequence>
> <xs:element type="xs:int" name="return" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:complexType name="FoodDescription">
> <xs:sequence>
> <xs:element type="xs:int" name="calories" />
> <xs:element type="xs:int" name="fatGrams" />
> <xs:element type="xs:int" name="fiberGrams" />
> <xs:element type="xs:int" name="points" />
> </xs:sequence>
> </xs:complexType>
> </xs:schema></wsdl:types>
>
> Regards,
>
> Jim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>

-- 
Thanks,
Deepal
................................................................
~Future is Open~ 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org