On Thursday 27 May 2010 5:06:56 am chengy wrote: > below is generated by CXF: > <wsdl:types> > <xsd:schema attributeFormDefault="unqualified" > elementFormDefault="qualified" targetNamespace="http://server.hw.demo/" > xmlns:tns="http://server.hw.demo/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > <xsd:element name="sayHi" type="tns:sayHi" /> > <xsd:complexType name="sayHi"> > <xsd:sequence> > <xsd:element minOccurs="0" name="arg0" type="xsd:string" /> > </xsd:sequence> > </xsd:complexType> > </xsd:schema> > </wsdl:types> > > see <xsd:element name="sayHi",<xsd:complexType name="sayHi">,the same name > "sayHi" makes things error!How to avoid this??
Umm... that's not an error at all. An element declaration and a type declaration are separate things and can (and often do) have identical names. What's the problem with that? There are some ways to configure it out by configuring the factory beans: JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean(); // set address, service class etc... serverFactory.getServiceFactory().setAnonymousWrapperTypes(true); serverFactory.create(); and such, but in general, it's a completely valid and common construct. -- Daniel Kulp [email protected] http://dankulp.com/blog
