1 2 Previous Next 17 Replies Latest reply on Mar 24, 2008 4:35 PM by Jérôme Pramondon

    wstools-config.xml

    Ramzi Maalej Newbie

      Hello,
      Can anyone give me an example of wstools-config.xml that encapsulate the configuration of two web services. I tried but i got error in parsing the file.
      I followed the xsd but the error persist.
      Thanks for help.

        • 1. Re: wstools-config.xml
          Celso Pinto Newbie

          Maybe I'm wrong but from my experiences I reckon that wstools only supports a single webservice per config.xml.

          It rewrites the files per iteration (ie. you have two config.xml files and when wstools parses the second, the output from the first is rewritten) therefore I have found the tool somewhat useless. Maybe because of the sheer lack of examples.

          One other issue you'll probably run into is that if in your webservice you have two methods, one returning an int and one returning a String, the wsdl will be incorrectly generated and the single result type will be of type int. So you'll get an error when you invoke the method that returns a String because a string can't be casted to an int.

          So far, these have been the issues I have found with wstools which makes me think that even if JBossWS is good it may have been rushed.

          • 2. Re: wstools-config.xml
            Ramzi Maalej Newbie

            If you look in the XSD schema file of config.xml, you will see that you can make more than element.
            It is possible to compile more than one web service, but how???

            • 4. Re: wstools-config.xml
              Jason Greene Master

               

              "cliffb53" wrote:
              Maybe I'm wrong but from my experiences I reckon that wstools only supports a single webservice per config.xml.


              That is correct, this is because the output directory is shared for a single tools run.

              It rewrites the files per iteration (ie. you have two config.xml files and when wstools parses the second, the output from the first is rewritten)


              You need to specify separate output directories for each run

              Maybe because of the sheer lack of examples.


              Have you looked at the samples and the user guide?


              One other issue you'll probably run into is that if in your webservice you have two methods, one returning an int and one returning a String, the wsdl will be incorrectly generated and the single result type will be of type int. So you'll get an error when you invoke the method that returns a String because a string can't be casted to an int.


              Can you provide a more specific example of this?

              -Jason

              • 5. Re: wstools-config.xml
                Celso Pinto Newbie

                 


                That is correct, this is because the output directory is shared for a single tools run.

                and
                You need to specify separate output directories for each run


                So, if I want to deploy a couple of webservices, I have to generate the files, each to a given output directory and then merge the files by hand. hmmm that indeed feels right ;-)

                Can you provide a more specific example of this?


                Sure, create a SLSB with two service-endpoint methods, one that returns an int and another one that returns a String. Run wstools on the bean, to generate a document/literal (as long as you don't use wrapped you'll see the problem I described) WSDL and check the file output: only one return type is defined of type int (or String, YMMV).

                Then create a new return type for String and apply that to the result of the operation that is intended to return a String, package the application and deploy that. Go to the URL JBoss assigns to the webservice (include the ?wsdl suffix) and you'll see that only one return type exists. If you now invoke the operation that is supposed to return a String you get the type cast error, which makes sense because only a return type of type int is declared.

                The question is, why does this happen?

                The only way I got around this was to use document/literal-wrapped.

                • 6. Re: wstools-config.xml
                  Ramzi Maalej Newbie

                  So, what is the utility of wstools with this limits ?

                  • 7. Re: wstools-config.xml
                    Thomas Diesler Master

                    You need to distinguish between

                    #1 multiple service endoint beans or endoint interfaces (SEI)

                    #2 operations operation per endpoint

                    wstools does not support #1 and no other tool that I know of can do that. #2 is of course supported - we have doc/lit tests with many operations

                    I reopen
                    http://jira.jboss.com/jira/browse/JBWS-949

                    and suggest you add a comment to the issue and show us your SEI and wstools config file in the issue

                    • 8. Re: wstools-config.xml
                      Ramzi Maalej Newbie

                      I have multiple web service to compile.
                      As I understand, I must compile each one separatly.
                      Here is an example, my structure of project seems like this :
                      src
                      |----Client
                      | |----Interface
                      | | |----ClientInterface.java
                      | |----Impl
                      | | |----ClientImpl.java
                      |----Provider
                      | |----Interface
                      | | |----ProviderInterface.java
                      | |----Impl
                      | | |----ProviderImpl.java
                      Configuration
                      |----wstools-config.xml

                      How should I process to compile this project.

                      • 9. Re: wstools-config.xml
                        steinarrune Newbie

                        OK, let's take this one step further. I have 2 EJB's which each configures one endpoint (SEI) each.

                        Using wstools and 2 different wstools-*-config.xml files I produce 2 different jaxrpc-mapping-*.xml files. All well so far.

                        My problem.

                        There is this file called webservices.xml that is generated un my META-INF dir, and I cannot see how I can produce different versions of this or to merge information from both my interfaces in it?

                        I run Ant as part of Maven (plugin) and the last interface to run wstools is the one that gets its information into webservices.xml.

                        • 10. Re: wstools-config.xml
                          Celso Pinto Newbie

                          I'm also interested in this. The only way I managed to do that is to maintain a hand-coded webservices.xml but if there's an automatic way it would be really nice to know.

                          • 11. Re: wstools-config.xml
                            Thomas Diesler Master

                            webservices.xml supports multiple service endpoints. You have to merge the wstools generated webservices.xml files manully.

                            BTW, wscompile does not generate webservices.xml at all.

                            Why not use JSR181 endpoints and get rid of all those offline tools generation issue all together?

                            • 12. Re: wstools-config.xml
                              Celso Pinto Newbie

                              Maybe when JBossAS is EJB3.0 ready I'll spend some time looking at that... for the time being, I want to stick with proven technologies even if it means having to do some manual steps.

                              • 13. Re: wstools-config.xml
                                Thomas Diesler Master

                                EJB3.0 is ready since summer last year. Also, I am not talking about EJB3 - I am talking about providing web service meta data through annotations (JSR181) that can be applied to pojos or ejbs

                                • 14. Re: wstools-config.xml
                                  Celso Pinto Newbie

                                  Do you guys provide paid support for that?

                                  1 2 Previous Next