By default, JAX-WS (and thus CXF) produces unqualified schemas and messages.
Thus, only the root element is namespace qualified and the sub elements would
not be. If you add the namespace attribute to the @WebParam, that would
change it for that parameter.
Alternatively, add a package-info.java with something like:
@javax.xml.bind.annotation.XmlSchema(
namespace = "http://apache.org/hello_world_soap12_http/types",
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
to force the elements into qualified form.
Dan
On Tuesday, May 03, 2011 10:07:54 AM Clint Dovholuk wrote:
> Hi All,
>
>
>
> Preface: If this has been addressed in the past I'm sorry...
>
> I really did scour the internet but my search foo was apparently
> insufficient.
>
>
>
> I am having a problem where the namespace of the service and all types in
> the service are getting translated from the expected namespace to
> xmlns="". I created a silly contrived example (which I could provide
> schema, mvn pom usage etc if need be) but basically I have:
>
> Class/Method:
>
> @WebService(targetNamespace = "http://testing-cxf-and-jaxws")
>
> public class FoodSoapService
>
> {
>
> public AbstractFood testing(@WebParam(name = "input") AbstractFood
> input)
>
> {
>
> return input;
>
> }
>
> }
>
>
>
> Produces:
>
> <soap:Body>
>
> <testing xmlns="http://test/">
>
> <input xmlns:q1="http://testing-cxf-and-jaxws" xsi:type="q1:Meat"
> xmlns="">
>
> <animal />
>
> </input>
>
> </testing>
>
> </soap:Body>
>
>
>
> See how the testing tag has the 'proper' namespace but the input tag has
> switched over to xmlns=""?
>
>
>
> I am sure this is a totally simple issue but boy - I just cannot figure out
> what I've done wrong. Any pointers or thoughts would be much appreciated.
>
>
>
> -Clint
>
>
>
> More Details:
>
> We start with a schema, generate domain artifacts via JAXB, the JAXB
> artifacts are in the 'proper' namespace ala: @XmlType(name =
> "AbstractFood", namespace = "http://testing-cxf-and-jaxws")
--
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com