Hi,
Right now xfire doesn't autogenerate schemas for your jaxb pojos (it
only works with the schema/wsdl first). You would to generate a schema
via the JAXB ant task and then tell xfire to include that in the wsdl.
However the good news is that I added this functionality to SVN today
and that we're doing a release this week. So stay tuned.
- Dan
Nicolasj wrote:
Hello,
I have a problem with the wsdl generation. I'm using xFire (sync on the SVN
trunc) from servicemix and I'm using the typeBinding "jaxb2". I would like
to use the annotation to change the field/Methods name.
I wrote this simple POJO class with annotation:
@XmlAccessorType(AccessType.FIELD)
@XmlType(name = "testA", propOrder = {
"data", "creationDateTo"}, namespace="http://agentws.se.tag.temenos.com")
public class TestA {
@XmlElement(name="DAATA",
namespace="http://agentws.se.tag.temenos.com")
protected Integer data = 1;
@XmlElement(namespace = "http://agentws.se.tag.temenos.com")
protected XMLGregorianCalendar creationDateTo;
public Integer getData() {
return data;
}
}
And the WS is using it as parameter:
@WebService
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use =
SOAPBinding.Use.ENCODED, parameterStyle = SOAPBinding.ParameterStyle.BARE)
public class ReceiverService {
@WebMethod
@WebResult(name = "TestResult")
public int test(@WebParam(name = "test")
TestA test) {
return 1;
}
}
In the generated wsdl the namespace is empty:
<xsd:schema targetNamespace="http://agentws.se.tag.temenos.com"
elementFormDefault="qualified" attributeFormDefault="qualified" />
If I remove the "@XmlType(name = "testA", propOrder = { ...." from the POJO
Then I have the following:
<xsd:schema targetNamespace="http://agentws.se.tag.temenos.com"
elementFormDefault="qualified" attributeFormDefault="qualified">
<xsd:complexType name="TestA">
<xsd:sequence>
<xsd:element name="data" type="xsd:int" minOccurs="0"
nillable="true" />
<xsd:any minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:anyAttribute />
</xsd:complexType>
</xsd:schema>
How could I setup xFire to use the annotations ?
Thanks in advance,
Nicolas
--
View this message in context:
http://www.nabble.com/jaxb2-binding-annotations-t1583178.html#a4296440
Sent from the XFire - Dev forum at Nabble.com.
--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com
http://netzooid.com/blog