It has the @XmlType annotation set, though maybe it's wrong somehow? It's what 
I got working before with 2.2.10 and I haven't ever changed it with the upgrade 
to 2.3.3.

@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "MyRequest")
@XmlType(name = "", propOrder = {} )
public class MyRequest
{
...
}

-----Original Message-----
From: Daniel Kulp [mailto:[email protected]] 
Sent: Wednesday, May 18, 2011 1:17 PM
To: [email protected]
Cc: Kessel, Christopher
Subject: Re: 2.3.3 WSDL generation creates duplicates (2.2.10 didn't)


Not really sure.   What annotations do you have on your "MyRequest" and 
"MyResponse" objects?    It LOOKS like you don't have an @XmlType annotation 
on them and likely only an XmlRootElement annotation.   My suggestion would be 
to have both.

Basically, the newer versions of JAXB are bit more strict about having proper 
annotations.   If a field or similar is a type that is only "allowed" to be a 
root, then it tends to copy the whole thing into the schema.   I'm not sure 
why.   However, making it be a XmlType as well would allow it to reference it 
directly.

Dan


On Tuesday, May 17, 2011 3:08:13 PM Kessel, Christopher wrote:
> I'm using 2.3.3 with a project and the wsdl creation contains duplication
> of the web service request/response objects. elements. I'm generating the
> WSDL from the annotated Java code. I have an older project using 2.2.10
> and it only generates the 1st element definitions and references them
> where 2.3.3 is duplicating.
> 
> Any ideas why? Here's the wsdl snippets:
> 
> <wsdl:definitions name="test_v1" targetNamespace="http://mycompany.com";
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns:tns="http://mycompany.com";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";> <wsdl:types>
>         <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
> xmlns:tns="http:// mycompany.com" elementFormDefault="unqualified"
> targetNamespace="http:// mycompany.com" version="1.0"> <xs:element
> name="MyRequest">
>                 <xs:complexType>
>                        ...complicated generated type stuff here...
>                 </xs:complexType>
>             </xs:element>
>             <xs:element name="MyResponse">
>                 <xs:complexType>
>                        ...complicated generated type stuff here...
>                 </xs:complexType>
>             </xs:element>
>             <xs:element name="doSomethingExciting"
> type="tns:doSomethingExciting "/> <xs:element name="
> doSomethingExcitingResponse" type="tns:doSomethingExcitingResponse"/>
> <xs:complexType name="doSomethingExciting">
>                 <xs:sequence>
>                     <xs:element minOccurs="0" name="MyRequest">
>                         <xs:complexType>
>                              ...same complicated generated stuff that we
> had above... </xs:complexType>
>                     </xs:element>
>                 </xs:sequence>
>             </xs:complexType>
>             <xs:complexType name=" doSomethingExcitingResponse">
>                 <xs:sequence>
>                     <xs:element minOccurs="0" name="MyResponse">
>                         <xs:complexType>
>                              ...same complicated generated stuff that we
> had above... </xs:complexType>
>                     </xs:element>
>                 </xs:sequence>
>             </xs:complexType>
>         </xs:schema>
>     </wsdl:types>
>    ... wsdl type/binding/service stuff...
> </wsdl:definitions>

-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com

Reply via email to