Hi,

I am migrating our webapps from apache-cxf-2.0.5-incubator to
apache-cxf-2.1.3. Everything seems OK except for a problem, when I ask
for a WSDL, it crashes with this message: "javax.wsdl.WSDLException:
WSDLException: faultCode=OTHER_ERROR: Can't find prefix for
'http://www.cdmv.com'. Namespace prefixes must be set on the Definition
object using the addNamespace(...) method."
 
My question is: how do I set a prefix to this namespace?

I have this spring configuration that defines my web service:

    <bean id="Pythia"
class="org.apache.cxf.jaxws.JaxWsServerFactoryBean"
init-method="create">
        <property name="serviceClass" value="com.cdmv.pythia.PythiaImpl"
/>
        <property name="serviceBean"><bean
class="com.cdmv.pythia.PythiaImpl"/></property>
        <property name="address" value="/Pythia"/>
        <property name="bus" ref="cxf"/>
        <property name="dataBinding">
            <bean class="org.apache.cxf.jaxb.JAXBDataBinding">
                <property name="namespaceMap">
                    <map>
                        <entry key="http://www.cdmv.com"; value="cdmv" />
                    </map>
                </property>
            </bean>
        </property>
        <property name="inInterceptors">
            <list>
                <bean id="iStoreJaasInterceptor"
class="com.cdmv.cxf.IStoreJaasInterceptor"
depends-on="jaasConfiguration">
                    <property name="loginContextName" value="Pythia" />
                    <property name="IStoreUrl">
                        <bean
class="org.springframework.jndi.JndiObjectFactoryBean">
                            <property name="jndiName"
value="java:comp/env/iStore/url" />
                        </bean>                    
                    </property>
                </bean>
            </list>
        </property>
        <property name="properties">
            <map>
                <entry key="jaxb.additionalContextClasses">
                    <bean class="com.cdmv.jaxb.ClassArrayFactoryBean">
                        <property name="classNames">
                            <list>
 
<value>com.cdmv.jaas.BasePrincipal</value>
 
<value>com.cdmv.jaas.istore.IStorePrincipal</value>
 
<value>com.cdmv.jaas.istore.IStoreAuthenticatedPrincipal</value>
                            </list>
                        </property>
                    </bean>
                </entry>
            </map>
        </property>
    </bean>
 
Has you can see in this config, I tried to add the namespace prefix in
the dataBindig definition but it does not work. This webservice is a
Java first development using annotations. I tried to use the @XmlNs
annotation but it does not help either.

The http://www.cdmv.com namespace comes from the tree classes in the
jaxb.additionalContextClasses property.

I am sure it's just a matter of putting the right definition in the
right place but I don't know where.

Reply via email to