Hi Andrey

 

Sorry to bother you again, but I'm still having problems.  As I
mentioned to you yesterday we managed to get the schema generator
working, when we changed back to jibx_1.1.  Now when we try to get the
wsdl we got the following error:

 

HTTP ERROR: 500

org/jaxen/BaseXPath

RequestURI=/Availability

 

Powered by Jetty://

 

 

I've been looking for a code sample about how to associate the xsd
schema and I couldn't find one, so I'm not sure if what I'm doing is
correct or not. See below: 

 

       ObjectServiceFactory factory = new ObjectServiceFactory(new
AegisBindingProvider(new JibxTypeRegistry()));

       //-- I ALSO TRY USING ---------------

       //     XFire xfire = XFireFactory.newInstance().getXFire();

       //     ObjectServiceFactory factory = new
JibxServiceFactory(xfire.getTransportManager());   

       //  AND I GOT SAME ERROR  ---------------------------

        

        ArrayList        schemas = new ArrayList();

        HashMap       properties = new HashMap();

        

        schemas.add("binding.xsd");

        properties.put(ObjectServiceFactory.SCHEMAS, schemas);

        factory.setWsdlBuilderFactory(new DefaultWSDLBuilderFactory());

        Service availabilityService = factory.create(Availability.class,
"Availability", "http://localhost:8080/Availability";, properties);

 

        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();

 

 This is the bindind.xsd which was generated:

 

<?xml version="1.0" encoding="UTF-8"?><schema
xmlns="http://www.w3.org/2001/XMLSchema";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">

 

  <!-- Created from mapping for class
com.sconnector.api.availability.AvailabilityRequest -->

  <element name="AvailReq">

    <complexType>

      <sequence>

        <element minOccurs="0" name="dep" type="xsd:string"/>

        <element minOccurs="0" name="des" type="xsd:string"/>

      </sequence>

    </complexType>

  </element>

 

  <!-- Created from mapping for class
com.sconnector.api.availability.AvailabilityResponse -->

  <element name="AvailResp">

    <complexType>

      <sequence>

        <element minOccurs="0" name="result" type="xsd:string"/>

        <element minOccurs="0" name="num-fares" type="xsd:int"/>

      </sequence>

    </complexType>

  </element>

</schema>

 

 

If you could tell me what is wrong or what is the right why to associate
the .xsd to Xfire I will really appreciated.

 

Thx a lot 

Javier

 

 

________________________________

From: Javier Diaz 
Sent: 26 March 2007 13:27
To: '[EMAIL PROTECTED]'; 'user@xfire.codehaus.org'
Subject: RE: [xfire-user] Xfire - Jibx

 

Hi Andrey

 

Thanks a lot for your answer. We are trying now to generate the xsd
schema using the schema generator from jibx, but we're getting some
errors. I already post an email to the jibx list, to see someone can
help us. Nevertheless below is the problem we are having; just in case
you could know what could be happening.

 

binding.xml

 

<?xml version="1.0" encoding="UTF-8"?>

<binding forwards="false" value-style="attribute">

  <mapping
class="com.lastminute.sconnector.api.availability.AvailabilityRequest"
name="AvailReq">

    <value style="element" name="dep" set-method="setDEP"
get-method="getDEP" usage="optional"/>

    <value style="element" name="des" set-method="setDES"
get-method="getDES" usage="optional"/>

  </mapping>

  <mapping
class="com.lastminute.sconnector.api.availability.AvailabilityResponse"
name="AvailResp">

    <value style="element" name="result" set-method="setResult"
get-method="getResult" usage="optional"/>

    <value style="element" name="num-fares" set-method="setNumFares"
get-method="getNumFares" usage="optional"/>

  </mapping>

</binding>

 

 

Error trying to generate the schema:

 

java -jar
/home/jdiaz/p4/project/cppLFE/main/SConnector/lib/jibx/jibx-genschema.ja
r binding.xml

 

Running schema generator version 0.2

Error: Non-abstract mapping must define an element name; on mapping
element at (line 3, col 99, in binding_xml)

Error: Class name is required; on mapping element at (line 3, col 99, in
binding_xml)

Error: Non-abstract mapping must define an element name; on mapping
element at (line 7, col 101, in binding_xml)

Error: Class name is required; on mapping element at (line 7, col 101,
in binding_xml)

 

It looks to us that we are clear defining a "name" for both mapping
elements, so we are not sure where the problem lies. 

 

Thx

Javier

 

 

________________________________

From: Andrey Utis [mailto:[EMAIL PROTECTED] 
Sent: 23 March 2007 18:28
To: user@xfire.codehaus.org
Subject: Re: [xfire-user] Xfire - Jibx

 

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.Availabilit
yRequest" 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.Availabilit
yResponse" 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 don't really
don't know. 

         

        Any help will be really appreciated.

         

        Thx

        Javier

         

         

 

  

________________________________

We won't tell. Get more on shows you hate to love
<http://us.rd.yahoo.com/evt=49980/*http:/tv.yahoo.com/collections/265%0d
%0a> 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
<http://us.rd.yahoo.com/evt=49980/*http:/tv.yahoo.com/collections/265%0d
%0a> 

Reply via email to