You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by kasturi1010 <ka...@gmail.com> on 2008/09/19 20:32:32 UTC
Re: New Howto: Defining Contract first webservices with wsdl
generation from java
I would like to know 2 things:
1. I would like to know if you can control the namespace in the
generated-wsdl to what you want ? Right now the target namespace reflects
the package name (in an inverted manner) of the class exposed with
@WebService.
I would like to control the target namespace myself for the purpose of
"Versioning" rather than being generated automatically. As you may know,
versioning of webservices is commonly achieved via having dated namespaces
(like targetNamespace = "http://apache.org/2005/05/version1" or
targetNamespace="http://apache.org/2006/05/version2")
2. I dont like to clutter my wsdl <types> element with the schema
definitions in there itself. Rather I like them having in a separate file
and have a simple import inside the <types> element. See e.g. below
<types>
<xsd:schema>
<xsd:import namespace="http://apache.org/2005/05/version1"
schemaLocation="schema1.xsd"/>
</xsd:schema>
</types>
How do I achieve the above?
--
View this message in context: http://www.nabble.com/New-Howto%3A-Defining-Contract-first-webservices-with-wsdl-generation-from-java-tp19056049p19577448.html
Sent from the cxf-dev mailing list archive at Nabble.com.
Re: New Howto: Defining Contract first webservices with wsdl generation from java
Posted by Daniel Kulp <dk...@apache.org>.
On Friday 19 September 2008 2:32:32 pm kasturi1010 wrote:
> I would like to know 2 things:
>
> 1. I would like to know if you can control the namespace in the
> generated-wsdl to what you want ? Right now the target namespace reflects
> the package name (in an inverted manner) of the class exposed with
> @WebService.
> I would like to control the target namespace myself for the purpose of
> "Versioning" rather than being generated automatically. As you may know,
> versioning of webservices is commonly achieved via having dated namespaces
> (like targetNamespace = "http://apache.org/2005/05/version1" or
> targetNamespace="http://apache.org/2006/05/version2")
The @WebService annotation has a namespace attribute on it to allow you to
control it.
> 2. I dont like to clutter my wsdl <types> element with the schema
> definitions in there itself. Rather I like them having in a separate file
> and have a simple import inside the <types> element. See e.g. below
>
> <types>
> <xsd:schema>
> <xsd:import namespace="http://apache.org/2005/05/version1"
> schemaLocation="schema1.xsd"/>
> </xsd:schema>
> </types>
>
> How do I achieve the above?
The java2ws command line tool has a -createxsdimports flag that will make it
generate separate files for each schema.
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog