Return-Path: Delivered-To: apmail-incubator-cxf-user-archive@locus.apache.org Received: (qmail 42267 invoked from network); 7 Jan 2008 10:08:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jan 2008 10:08:04 -0000 Received: (qmail 50761 invoked by uid 500); 7 Jan 2008 10:07:52 -0000 Delivered-To: apmail-incubator-cxf-user-archive@incubator.apache.org Received: (qmail 50724 invoked by uid 500); 7 Jan 2008 10:07:52 -0000 Mailing-List: contact cxf-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-user@incubator.apache.org Delivered-To: mailing list cxf-user@incubator.apache.org Received: (qmail 50715 invoked by uid 99); 7 Jan 2008 10:07:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jan 2008 02:07:52 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,TVD_FW_GRAPHIC_NAME_MID X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [217.69.20.190] (HELO cluster-d.mailcontrol.com) (217.69.20.190) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jan 2008 10:07:35 +0000 Received: from camdmail01.accelrys.net (no-reverse.redstone-isp.net [212.44.43.183] (may be forged)) by rly26d.srv.mailcontrol.com (MailControl) with ESMTP id m07A7RBI019841 for ; Mon, 7 Jan 2008 10:07:27 GMT In-Reply-To: <47818AC9.9020606@iona.com> References: <47818AC9.9020606@iona.com> Subject: Re: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy' To: cxf-user@incubator.apache.org X-Mailer: Lotus Notes Release 8.0 August 02, 2007 Message-ID: Date: Mon, 7 Jan 2008 10:02:13 +0000 From: "Monica Ferrero" X-MIMETrack: CD-MIME by Router on camdmail01/Server/Accelrys(Release 7.0.2|September 26, 2006) at 07/01/2008 10:07:27, CD-MIME complete at 07/01/2008 10:07:27, Itemize by Router on camdmail01/Server/Accelrys(Release 7.0.2|September 26, 2006) at 07/01/2008 10:07:27, Serialize by Router on camdmail01/Server/Accelrys(Release 7.0.2|September 26, 2006) at 07/01/2008 10:07:27 MIME-Version: 1.0 Content-type: multipart/related; Boundary="0__=0FBBF95ADFA5ED898f9e8a93df938690918c0FBBF95ADFA5ED89" X-Scanned-By: MailControl A-08-00-01 (www.mailcontrol.com) on 10.68.0.136 X-Virus-Checked: Checked by ClamAV on apache.org --0__=0FBBF95ADFA5ED898f9e8a93df938690918c0FBBF95ADFA5ED89 Content-type: multipart/alternative; Boundary="1__=0FBBF95ADFA5ED898f9e8a93df938690918c0FBBF95ADFA5ED89" --1__=0FBBF95ADFA5ED898f9e8a93df938690918c0FBBF95ADFA5ED89 Content-type: text/plain; charset=US-ASCII Hi Jim, Thank you for your reply. Item and OrderBy are generated by JAXB from a schema.xsd file. I have followed your advice to see if it behaves any different but I still get the same error. The Item and therefore OrderBy classes belong to a different JAXB context: com.aaa.bbb.zzz.jaxb, but not sure if/how to indicate this? Thanks for your help, Monica From: Jim Ma To: cxf-user@incubator.apache.org Date: 07/01/2008 02:22 Subject: Re: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy' Hi , From the error message , I think this is caused by the inner class OrderBy is not loaded into JAXB context . Can you modify this class as a outer class and try it again ? I will look it further to see if the JAXB can not load the inner static class . Thanks Jim Monica Ferrero wrote: > Hi! > > I'm getting this error: > > WSDLToJava Error : Thrown by JAXB : undefined element declaration > 'ns1:orderBy' > > when trying to generate java stubs from the wsdl. > > > This is my original service: > > @WebService(endpointInterface = "com.aaa.bbb.ccc.MyService") > public interface MyService { > > [...] > > @WebResult(name="MyList") > @WebMethod > MyList getItems( @WebParam(name="listId") int listId); > > [...] > } > > > the MyList class: > > @XmlAccessorType(XmlAccessType.FIELD) > @XmlType(name = "", propOrder = {"items"}) > @XmlRootElement(name = "myList") > public class MyList { > > @XmlElement(required = true) > private List items; > > public List getItems() { > if (items == null) { > items = new ArrayList(); > } > return items; > } > > public void setItems(List items) { > this.items = items; > } > } > > > The Item is a JAXB generated file from a schema: > > > @XmlAccessorType(XmlAccessType.FIELD) > @XmlType(name = "", propOrder = { > "attributesPD", > "orderBy" > }) > @XmlRootElement(name = "item") > public class Item { > > @XmlElement(name = "attributes", required = true) > protected AttributesPD attributesPD; > protected Item.OrderBy orderBy; > @XmlAttribute > @XmlJavaTypeAdapter(CollapsedStringAdapter.class) > @XmlSchemaType(name = "token") > protected String id; > @XmlAttribute > @XmlJavaTypeAdapter(CollapsedStringAdapter.class) > @XmlSchemaType(name = "token") > protected String createdBy; > @XmlAttribute > @XmlSchemaType(name = "date") > protected XMLGregorianCalendar creationDate; > > public AttributesPD getAttributesPD() { > return attributesPD; > } > > public void setAttributesPD(AttributesPD value) { > this.attributesPD = value; > } > > public Item.OrderBy getOrderBy() { > return orderBy; > } > > public void setOrderBy(Item.OrderBy value) { > this.orderBy = value; > } > > public String getId() { > return id; > } > > public void setId(String value) { > this.id = value; > } > > public String getCreatedBy() { > return createdBy; > } > > public void setCreatedBy(String value) { > this.createdBy = value; > } > > public XMLGregorianCalendar getCreationDate() { > return creationDate; > } > > public void setCreationDate(XMLGregorianCalendar value) { > this.creationDate = value; > } > > > @XmlAccessorType(XmlAccessType.FIELD) > @XmlType(name = "", propOrder = { > "orderedAttributeRef" > }) > public static class OrderBy { > > @XmlElement(required = true) > protected List orderedAttributeRef; > > public List getOrderedAttributeRef() { > if (orderedAttributeRef == null) { > orderedAttributeRef = new > ArrayList(); > } > return this.orderedAttributeRef; > } > } > } > > > > The wsdl generated by cxf: > > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:tns="http://myservice.bbb.aaa.com/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MyServiceImplService" > targetNamespace="http://myservice.bbb.aaa.com/"> > > xmlns:tns="http://www.aaa.com/AaaOtherService" > attributeFormDefault="unqualified" elementFormDefault="qualified" > targetNamespace="http://www.aaa.com/AaaOtherService"> > [...] > > > > > name="orderBy"> > > > maxOccurs="unbounded" name="orderedAttributeRef" > type="tns:orderedAttributeRefType"/> > > > > > > type="xs:token"/> > type="xs:date"/> > > > [...] > > xmlns="http://myservice.bbb.aaa.com/" > xmlns:ns1="http://www.aaa.com/AaaOtherService" > attributeFormDefault="unqualified" elementFormDefault="unqualified" > targetNamespace="http://myservice.bbb.aaa.com/"> > namespace="http://www.aaa.com/AaaOtherService"/> > > > > name="items"> > > > ref="ns1:attributes"/> > minOccurs="0" ref="ns1:orderBy"/> > > type="xs:token"/> > name="createdBy" type="xs:token"/> > name="creationDate" type="xs:date"/> > > > > > > [...] > type="getItemsResponse"/> > > > > > > [...] > > > [...] > > > > > I think it's a bit weird that it defines myList as a sequence of the > elements that form an Item, instead of a sequence of items. > Anyway I'm not sure why it does not work if it is mostly all generated > code. > Any ideas? > > Help or pointers very much appreciated! > > > Monica --1__=0FBBF95ADFA5ED898f9e8a93df938690918c0FBBF95ADFA5ED89 Content-type: text/html; charset=US-ASCII Content-Disposition: inline

Hi Jim,

Thank you for your reply.

Item and OrderBy are generated by JAXB from a schema.xsd file.
I have followed your advice to see if it behaves any different but I still get the same error.

The Item and therefore OrderBy classes belong to a different JAXB context: com.aaa.bbb.zzz.jaxb, but not sure if/how to indicate this?

Thanks for your help,

Monica

Inactive hide details for Jim Ma ---07/01/2008 02:22:26---Hi ,Jim Ma ---07/01/2008 02:22:26---Hi ,


From:

Jim Ma <ema@iona.com>

To:

cxf-user@incubator.apache.org

Date:

07/01/2008 02:22

Subject:

Re: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy'





Hi ,

From the error message , I think this is caused by the inner class
OrderBy is not loaded into
JAXB context . Can you modify this class as a outer class and try it
again ?
I will look it further to see if the JAXB can not load the inner static
class .

Thanks

Jim


Monica Ferrero wrote:
> Hi!
>
> I'm getting this error:
>
> WSDLToJava Error : Thrown by JAXB : undefined element declaration
> 'ns1:orderBy'
>
> when trying to generate java stubs from the wsdl.
>
>
> This is my original service:
>
> @WebService(endpointInterface = "com.aaa.bbb.ccc.MyService")
> public interface MyService {
>
>     [...]
>
>     @WebResult(name="MyList")
>     @WebMethod
>     MyList getItems( @WebParam(name="listId") int listId);
>
>     [...]
> }
>
>
> the MyList class:
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "", propOrder = {"items"})
> @XmlRootElement(name = "myList")
> public class MyList {
>
>     @XmlElement(required = true)
>     private List<Item> items;
>
>     public List<Item> getItems() {
>         if (items == null) {
>             items = new ArrayList<Item>();
>         }
>         return items;
>     }
>
>     public void setItems(List<Item> items) {
>         this.items = items;
>     }
> }
>
>
> The Item is a JAXB generated file from a schema:
>
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "", propOrder = {
>     "attributesPD",
>     "orderBy"
> })
> @XmlRootElement(name = "item")
> public class Item {
>
>     @XmlElement(name = "attributes", required = true)
>     protected AttributesPD attributesPD;
>     protected Item.OrderBy orderBy;
>     @XmlAttribute
>     @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
>     @XmlSchemaType(name = "token")
>     protected String id;
>     @XmlAttribute
>     @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
>     @XmlSchemaType(name = "token")
>     protected String createdBy;
>     @XmlAttribute
>     @XmlSchemaType(name = "date")
>     protected XMLGregorianCalendar creationDate;
>
>     public AttributesPD getAttributesPD() {
>         return attributesPD;
>     }
>
>     public void setAttributesPD(AttributesPD value) {
>         this.attributesPD = value;
>     }
>
>     public Item.OrderBy getOrderBy() {
>         return orderBy;
>     }
>
>     public void setOrderBy(Item.OrderBy value) {
>         this.orderBy = value;
>     }
>
>     public String getId() {
>         return id;
>     }
>
>     public void setId(String value) {
>         this.id = value;
>     }
>
>     public String getCreatedBy() {
>         return createdBy;
>     }
>
>     public void setCreatedBy(String value) {
>         this.createdBy = value;
>     }
>
>     public XMLGregorianCalendar getCreationDate() {
>         return creationDate;
>     }
>
>     public void setCreationDate(XMLGregorianCalendar value) {
>         this.creationDate = value;
>     }
>
>
>     @XmlAccessorType(XmlAccessType.FIELD)
>     @XmlType(name = "", propOrder = {
>         "orderedAttributeRef"
>     })
>     public static class OrderBy {
>
>         @XmlElement(required = true)
>         protected List<OrderedAttributeRefType> orderedAttributeRef;
>
>         public List<OrderedAttributeRefType> getOrderedAttributeRef() {
>             if (orderedAttributeRef == null) {
>                 orderedAttributeRef = new
> ArrayList<OrderedAttributeRefType>();
>             }
>             return this.orderedAttributeRef;
>         }
>     }
> }
>
>
>
> The wsdl generated by cxf:
>
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/"
> xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:tns="
http://myservice.bbb.aaa.com/"
> xmlns:xsd="
http://www.w3.org/2001/XMLSchema" name="MyServiceImplService"
> targetNamespace="
http://myservice.bbb.aaa.com/">
>       <wsdl:types>
>             <xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema"
> xmlns:tns="
http://www.aaa.com/AaaOtherService"
> attributeFormDefault="unqualified" elementFormDefault="qualified"
> targetNamespace="
http://www.aaa.com/AaaOtherService">
> [...]
>                   <xs:element name="item">
>                         <xs:complexType>
>                               <xs:sequence>
>                                     <xs:element ref="tns:attributes"/>
>                                     <xs:element minOccurs="0"
> name="orderBy">
>                                           <xs:complexType>
>                                                 <xs:sequence>
>                                                       <xs:element
> maxOccurs="unbounded" name="orderedAttributeRef"
> type="tns:orderedAttributeRefType"/>
>                                                 </xs:sequence>
>                                           </xs:complexType>
>                                     </xs:element>
>                               </xs:sequence>
>                               <xs:attribute name="id" type="xs:token"/>
>                               <xs:attribute name="createdBy"
> type="xs:token"/>
>                               <xs:attribute name="creationDate"
> type="xs:date"/>
>                         </xs:complexType>
>                   </xs:element>
> [...]
>             </xs:schema>
>             <xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema"
> xmlns="
http://myservice.bbb.aaa.com/"
> xmlns:ns1="
http://www.aaa.com/AaaOtherService"
> attributeFormDefault="unqualified" elementFormDefault="unqualified"
> targetNamespace="
http://myservice.bbb.aaa.com/">
>                   <xs:import
> namespace="
http://www.aaa.com/AaaOtherService"/>
>                   <xs:element name="myList">
>                         <xs:complexType>
>                               <xs:sequence>
>                                     <xs:element maxOccurs="unbounded"
> name="items">
>                                           <xs:complexType>
>                                                 <xs:sequence>
>                                                       <xs:element
> ref="ns1:attributes"/>
>                                                       <xs:element
> minOccurs="0" ref="ns1:orderBy"/>
>                                                 </xs:sequence>
>                                                 <xs:attribute name="id"
> type="xs:token"/>
>                                                 <xs:attribute
> name="createdBy" type="xs:token"/>
>                                                 <xs:attribute
> name="creationDate" type="xs:date"/>
>                                           </xs:complexType>
>                                     </xs:element>
>                               </xs:sequence>
>                         </xs:complexType>
>                   </xs:element>
> [...]
>                   <xs:element name="getItemsResponse"
> type="getItemsResponse"/>
>                   <xs:complexType name="getItemsResponse">
>                         <xs:sequence>
>                               <xs:element minOccurs="0" ref="myList"/>
>                         </xs:sequence>
>                   </xs:complexType>
> [...]
>             </xs:schema>
>       </wsdl:types>
> [...]
> </wsdl:definitions>
>
>
>
> I think it's a bit weird that it defines myList as a sequence of the
> elements that form an Item, instead of a sequence of items.
> Anyway I'm not sure why it does not work if it is mostly all generated
> code.
> Any ideas?
>
> Help or pointers very much appreciated!
>
>
> Monica

--1__=0FBBF95ADFA5ED898f9e8a93df938690918c0FBBF95ADFA5ED89-- --0__=0FBBF95ADFA5ED898f9e8a93df938690918c0FBBF95ADFA5ED89--