You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by zem_user <ma...@yahoo.com> on 2009/09/12 03:47:57 UTC

Bad namespace in WSDL when adding custom classes

I am trying to add custom classes using the "jaxb.additionalContextClasses"
property on JaxWsServerFactoryBean. The resulting WSDL file lists the added
classes under the schema section but doesn't reflect the appropriate
namespace. 

This is my service interface and its implementation.
http://www.nabble.com/file/p25410793/TestWebservice.java TestWebservice.java 
http://www.nabble.com/file/p25410793/TestWebserviceImpl.java
TestWebserviceImpl.java 

This is the service factory which configures the JaxWsServerFactoryBean.
http://www.nabble.com/file/p25410793/TestWebserviceFactory.java
TestWebserviceFactory.java 

These are the sample classes that i make available using the
"jaxb.additionalContextClasses" property.
http://www.nabble.com/file/p25410793/SampleA.java SampleA.java 
http://www.nabble.com/file/p25410793/SampleB.java SampleB.java 

This is the Spring configuration file.
http://www.nabble.com/file/p25410793/beans.xml beans.xml 

And this is the web.xml.
http://www.nabble.com/file/p25410793/web.xml web.xml 

I am using CXF 2.2.3 on JBoss 4.2.3. This is the resulting WSDL i see.
http://www.nabble.com/file/p25410793/test.wsdl test.wsdl 

Notice that the type definition for SampleA and SampleB is under the
namespace "http://test.com/" as opposed to "http://domain.test.com/". Is
there a way to ensure that the schema definition for the custom classes have
their own namespace?

Thanking you in advance,
Zem_User
-- 
View this message in context: http://www.nabble.com/Bad-namespace-in-WSDL-when-adding-custom-classes-tp25410793p25410793.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Bad namespace in WSDL when adding custom classes

Posted by Daniel Kulp <dk...@apache.org>.
The easiest way is to add a package-info.java to the package the beans are in 
that has something like:
@javax.xml.bind.annotation.XmlSchema(namespace = "http://domain.test.com/")
package com.test.domain;

That should take care of it.   If not, you'll need to add @XmlRootElement and 
@XmlType annotations to the SampleA/SampleB beans to definte the 
targetNamespaces for those beans.

Dan



On Fri September 11 2009 9:47:57 pm zem_user wrote:
> I am trying to add custom classes using the "jaxb.additionalContextClasses"
> property on JaxWsServerFactoryBean. The resulting WSDL file lists the added
> classes under the schema section but doesn't reflect the appropriate
> namespace.
> 
> This is my service interface and its implementation.
> http://www.nabble.com/file/p25410793/TestWebservice.java
>  TestWebservice.java
>  http://www.nabble.com/file/p25410793/TestWebserviceImpl.java
> TestWebserviceImpl.java
> 
> This is the service factory which configures the JaxWsServerFactoryBean.
> http://www.nabble.com/file/p25410793/TestWebserviceFactory.java
> TestWebserviceFactory.java
> 
> These are the sample classes that i make available using the
> "jaxb.additionalContextClasses" property.
> http://www.nabble.com/file/p25410793/SampleA.java SampleA.java
> http://www.nabble.com/file/p25410793/SampleB.java SampleB.java
> 
> This is the Spring configuration file.
> http://www.nabble.com/file/p25410793/beans.xml beans.xml
> 
> And this is the web.xml.
> http://www.nabble.com/file/p25410793/web.xml web.xml
> 
> I am using CXF 2.2.3 on JBoss 4.2.3. This is the resulting WSDL i see.
> http://www.nabble.com/file/p25410793/test.wsdl test.wsdl
> 
> Notice that the type definition for SampleA and SampleB is under the
> namespace "http://test.com/" as opposed to "http://domain.test.com/". Is
> there a way to ensure that the schema definition for the custom classes
>  have their own namespace?
> 
> Thanking you in advance,
> Zem_User
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Bad namespace in WSDL when adding custom classes

Posted by zem_user <ma...@yahoo.com>.
Any Suggestions....this is driving me to my wits end?
-- 
View this message in context: http://www.nabble.com/Bad-namespace-in-WSDL-when-adding-custom-classes-tp25410793p25439577.html
Sent from the cxf-user mailing list archive at Nabble.com.