I've run into a similar problem when I was setting up my web services. I dont
think xfire can generate a schema from JiBX mappings. Even JiBX distribution
itself admits that the schema generator it comes with has a number of
limitations. So what I did to get around this was very simple: I compiled my
schema manually (using JiBX schema compiler) and then copy/pasted them into the
WSDL and published that WSDL in XFire. It works without any problems.
Andrey
Javier Diaz <[EMAIL PROTECTED]> wrote:
Hi guys
We are new to Xfire. We have are trying to use Xfire-Jibx with a very simple
application but we are having problems generating the WSDL. Basically we have
two simple classes, with just two fields each:
public class AvailabilityRequest {
public String DEP;
public String DES;
//
. Getter and Setters here
..
}
public class AvailabilityResponse {
public String result;
public int numFares;
//
Getters and Setters here
}
This is our code to run the XFire server
.
XFire xfire = XFireFactory.newInstance().getXFire();
ServiceFactory factory = new JibxServiceFactory(xfire.getTransportManager());
Service availabilityService = factory.create(Availability.class,
"Availability", "http://localhost:8080/Availability", null);
xfire.getServiceRegistry().register(availabilityService);
availabilityService.setProperty(ObjectInvoker.SERVICE_IMPL_CLASS,
AvailabilityImpl.class);
logger.debug("Starting Server");
// Start the HTTP server
server = new XFireHttpServer();
server.setPort(8080);
server.start();
Our binding.xml
-------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<binding forwards="false" value-style="attribute">
<mapping name="AvailReq"
class="com.lastminute.sconnector.api.availability.AvailabilityRequest">
<value style="element" name="dep" field="DEP" usage="optional"/>
<value style="element" name="des" field="DES" usage="optional"/>
</mapping>
<mapping name="AvailResp"
class="com.lastminute.sconnector.api.availability.AvailabilityResponse">
<value style="element" name="result" field="result" usage="optional"/>
<value style="element" name="num-fares" field="numFares"/>
</mapping>
</binding>
Everything is compiling correct and we manage to get the server running,
however if we try to get the WSDL, only the root elements are being generated,
we are missing the rest of the fields in our classes, see below:
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://localhost:8080/Availability"
xmlns:tns="http://localhost:8080/Availability"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"
xmlns:ns1="http://com.lastminute.sconnector.api.availability.AvailabilityRequest"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding"
xmlns:ns2="http://com.lastminute.sconnector.api.availability.AvailabilityResponse"
xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://localhost:8080/Availability">
- <xsd:element name="getAvailability">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="ns1:AvailReq" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
- <xsd:element name="getAvailabilityResponse">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="ns2:AvailResp" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
We believe we are really missing something, but we dont really dont know.
Any help will be really appreciated.
Thx
Javier
---------------------------------
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.