users@jaxb.java.net

I: Jaxb binding problem

From: Dott. Ing. Francesca Merighi <merighi_at_webengineers.it>
Date: Fri, 15 Apr 2005 10:10:23 +0200

 

Hi, i'm trying to build a WebService Client.
I created a XML schema from WSDL Document that envelops Web Method
specifications.
Then i used jaxb tool (xjc) to bind Web Service objects.
I have this problem: when I marshal a Web Method call object , I obtain a
XML message with an empty namespace tag where namespace is not specified in
XML Schema, as this:

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body><SayHelloWord xmlns="hw_namespace">
<input xmlns="">
<name>Francesca</name><surname>Merighi</surname>
</input></SayHelloWord>
</SOAP-ENV:Body></SOAP-ENV:Envelope>

from XML Schema :

<s:schema targetNamespace="hw_namespace"
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tns="hw_namespace" >
<s:element name="SayHelloWord">
<s:complexType>
<s:sequence>
<s:element name="input" type="tns:InputStruct"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="InputStruct">
<s:sequence>
<s:element name="name" type="s:string" minOccurs="0"/>
<s:element name="surname" type="s:string" minOccurs="0"/>
</s:sequence>
</s:complexType>
<s:element name="SayHelloWordResponse">
<s:complexType>
<s:sequence>
<s:element name="SayHelloWordResult" type="s:string" minOccurs="0"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>

Obviously unmarshall method requires xmlns="" tag too.

I'd like that jaxb gives me an object class without xmlns="" during
marshalling/unmarshalling.

Can you help me?

Thanks

 

Francesca Merighi