So I defined @XmlType(name = "PrizeType", namespace = "http://common.business.mm.services.com") public interface PrizeType {...} in package com.services.mm.business.common
and two of my webservice as @WebService(serviceName = "CoreServices", targetNamespace = "http://services.mm.business.com") public interface CoreServices {... some methods referencing PrizeType ... } @WebService(serviceName = "CoreServices2", targetNamespace = "http://services.mm.business.com") public interface CoreServices2 {... some methods referencing PrizeType ... } but i got as well two stub of prizeType in com.business.mm.services.stub.package1 and com.business.mm.services.stub.package2 I want only one PrizeType defined in com.business.mm.service.stub.common ---------- Initial Header ----------- >From : "Daniel Kulp" [email protected] To : [email protected] Cc : [email protected] Date : Thu, 19 Feb 2009 11:34:23 -0500 Subject : Re: duplicated complex type > > Could options: > > 1) On the types, add a > @XmlType(name = "PrizeType", namespace = "http://blah.blah.blah") > > 2) Create a package-info.java file in the package that has: > @XmlSchema(namespace = "http://blah.blah.blah") > > The second is probably preferred as it will apply that namespace to all the > types in the package. > > Dan > > > > On Thu February 19 2009 11:08:26 am [email protected] wrote: > > could u describe me annotation to use it? > > > > ---------- Initial Header ----------- > > > > From : "Pieper, Aaron (SAIC)" [email protected] > > To : [email protected] > > Cc : > > Date : Thu, 19 Feb 2009 10:31:00 -0500 > > Subject : RE: duplicated complex type > > > > > What he's recommending, is for you to put the "PrizeType" object goes in > > > a specific namespace. For example, let's call it the "Common-Object > > > Namespace". All of the other web services, which reside in their own > > > specific namespaces, would import the schema objects from the > > > "Common-Object Namespace". > > > > > > When you generate stubs, you can specify a mapping from namespaces to > > > java packages. So if you follow this strategy, then only one PrizeType > > > object would be generated, in whichever java package you mapped the > > > "Common-Object Namespace" to. > > > > > > HTH > > > > > > - Aaron > > > > > > -----Original Message----- > > > From: [email protected] [mailto:[email protected]] > > > Sent: Thursday, February 19, 2009 10:24 AM > > > To: users > > > Subject: Re: duplicated complex type > > > > > > sorry if i stress yuo bu i desperatly need to now ho to avoid duplicated > > > context type and specifing a common namaspace for my common interface. > > > Could you help me? > > > Regards > > > Giovanni > > > ---------- Initial Header ----------- > > > > > > From : "Daniel Kulp" [email protected] > > > To : [email protected] > > > Cc : "gionnyDeep" [email protected] > > > Date : Wed, 18 Feb 2009 13:14:09 -0500 > > > Subject : Re: duplicated complex type > > > > > > > This is "normal". The best option is to put the PrizeType in a > > > > > > specific > > > > > > > namespace for all the services. Thus, when it's code generated, it > > > > > > would > > > > > > > always be generated into the same place thus they all "share" it. > > > > > > > > Dan > > > > > > > > On Wed February 18 2009 6:32:32 am gionnyDeep wrote: > > > > > Hi all > > > > > I'm newbie using cxf and webservices. > > > > > So I apologize if I use not right terms. > > > > > I defined my webservices using annotations. > > > > > I created also interfaces used by my webservice. > > > > > When I create my war and I see in my browser, all wsdls show me > > > > > > complextype > > > > > > > > as follow > > > > > ... > > > > > <xsd:complexType name="PrizeType"> > > > > > <xsd:sequence> > > > > > <xsd:element minOccurs="0" name="prizeTypeDesc" nillable="true" > > > > > type="xsd:string"/> > > > > > <xsd:element minOccurs="0" name="prizeTypeId" nillable="true" > > > > > type="xsd:int"/> > > > > > <xsd:element minOccurs="0" name="prizeTypeName" nillable="true" > > > > > type="xsd:string"/> > > > > > </xsd:sequence> > > > > > </xsd:complexType> > > > > > .... > > > > > The problem is that the complextype PrizeType appears in all wsdl of > > > > > > all > > > > > > > > webservices.So when i generate the stubs I have redundant stubs > > > > > > created! > > > > > > > > Any idea? > > > > > sorry for my english > > > > > Giovanni > > > > > > > > -- > > > > Daniel Kulp > > > > [email protected] > > > > http://www.dankulp.com/blog > > -- > Daniel Kulp > [email protected] > http://www.dankulp.com/blog >
