You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "benson margulies (JIRA)" <ji...@apache.org> on 2007/07/12 03:47:04 UTC
[jira] Commented: (CXF-781) Duplicate type error from Aegis on code
that worked fine with XFire 1.2.5
[ https://issues.apache.org/jira/browse/CXF-781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12511925 ]
benson margulies commented on CXF-781:
--------------------------------------
You might also be interested in the code that launches all this.
AegisDatabinding binder = new AegisDatabinding();
JaxWsServerFactoryBean serviceFactory = new
JaxWsServerFactoryBean();
serviceFactory.getServiceFactory().setDataBinding(binder);
// here we disuade XFire from its rather annoying tendency to
assume that, just because
// anything in Java can be null, that we want to
advertise all that nullity all over.
DefaultTypeMappingRegistry tmr = (DefaultTypeMappingRegistry)
binder.getTypeMappingRegistry();
Configuration configuration = tmr.getConfiguration();
configuration.setDefaultMinOccurs(1);
configuration.setDefaultNillable(false);
// Create a properties hashmap
HashMap<String, Object> props = new HashMap<String,
Object>();
// Enable the writing of xsi:type attributes
props.put(AegisDatabinding.WRITE_XSI_TYPE_KEY,
Boolean.TRUE);
// Supply a list of class names which need to be included
in the wsdl.
ArrayList<String> l = new ArrayList<String>();
// add class names here for extra types if we need them.
l.add(com.basistech.rnm.index.NameIndexException.class.getName());
props.put(AegisDatabinding.OVERRIDE_TYPES_KEY, l);
serviceFactory.setAddress("http://localhost:" + port +
"/NameIndexService");
serviceFactory.setServiceBean(new
NameIndexServiceImpl(configPath));
serviceFactory.setServiceClass(NameIndexService.class);
serviceFactory.setProperties(props);
server = serviceFactory.create();
> Duplicate type error from Aegis on code that worked fine with XFire 1.2.5
> -------------------------------------------------------------------------
>
> Key: CXF-781
> URL: https://issues.apache.org/jira/browse/CXF-781
> Project: CXF
> Issue Type: Bug
> Affects Versions: 2.0
> Reporter: benson margulies
>
> I'd pick 'aegis' as a component if it appeared on the list.
> The only place in my universe where 'ArrayOfNameIndexLookupResult' can arise is in the service interface itself ...
> @WebMethod()
> public abstract NameIndexLookupResult[] lookup(String indexid,
> @WebParam(targetNamespace="urn:com.basistech.rnm.index")NameIndexQuery query) throws NameIndexException;
> I'm wondering if I have a namespace inconsistency between the interface and the impl.
> The interface is marked up with ..
> @WebService(name="NameIndexService", targetNamespace="urn:com.basistech.rnm.index.ws")
> while the impl class looks like ...
> @WebService(serviceName = "NameIndexService", endpointInterface = "com.basistech.rnm.index.ws.NameIndexService")
> I tried adding the targetNamespace to the implementation class, but that had no effect.
> Jul 11, 2007 9:28:39 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
> INFO: Creating Service {http://impl.ws.index.rnm.basistech.com/}NameIndexService from class com.basistech.rnm.index.ws.impl.NameIndexServiceImpl
> Exception in thread "main" java.lang.RuntimeException: Schema for namespace 'urn:com.basistech.rnm.index' already contains type 'ArrayOfNameIndexLookupResult
> at org.apache.ws.commons.schema.XmlSchema.addType(XmlSchema.java:229)
> at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
> at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:315)
> at org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas(AegisDatabinding.java:291)
> at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:162)
> at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:220)
> at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:248)
> at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:136)
> at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:83)
> at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:89)
> at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:142)
> at com.basistech.rnm.index.ws.impl.StandaloneServiceStarter.start(StandaloneServiceStarter.java:76)
> at com.basistech.rnm.index.ws.impl.StandaloneServiceStarter.main(StandaloneServiceStarter.java:116)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.