14 Replies Latest reply on Jan 14, 2013 7:59 AM by mitvivek

    how to create mappings.xml for webservices

    mitvivek

      Hi All,

       

      I am looking some pointers to create mappings.xml for webservices.

       

      I have gone through various links available on the net which mentions using wstools, but I am not able to use them as there are errors

      pertaining to the class not found, no class definition found.

       

      Could some one please provide me a simple example of how I can achieve this?

       

      I have with me the wsdl file so I assume I have to create a config.xml for this as well.

       

      Thanks in advance for the support.

       

      Vivek

        • 1. Re: how to create mappings.xml for webservices
          nickarls

          How are you using wstools and what are the errors you're seeing?

          • 2. Re: how to create mappings.xml for webservices
            mitvivek

            Hi Nicklas,

             

            I was trying to use wsconsume but that didn't provide any results so I now am trying with jboss-5.0.0.CR2-jdk6

             

            I have create the config.xml

             

            <?xml version="1.0" encoding="UTF-8"?>
            <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">

            <global>
            <package-namespace package="ws.tms.webservices.Testactions" namespace="http://Testactions.webservices.tms.ws"/>
            </global>

            <wsdl-java file="TestActions.wsdl">
            <mapping file="TestActions-mapping.xml" />
            </wsdl-java>
            </configuration>

             

            this I have placed in the bin directory where I have the wstools.bat file.

             

            Also I have kept my wsdl file in this directory.

             

            Initially I got the NoClassDef error when I executed wstools.bat command.

             

            But I then downloaded the jar "jbossws-client.jar" explicitly in the client folder and then

             

            and I am firing the following command:

             

            wstools.bat -classpath E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\client\*.jar -config config.xml -dest E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\sourceForWeb\

             

            Please let me know if I am doing something wrong here.

             

            There are no messages being flashed on the command line, only following stack is flased:

             

            E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin>wstools.bat -classpath E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\client\*.jar -config config.xml -dest E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\sourceForWeb\
            ========================================================================="
            .
              WSTools Environment
            .
              JBOSS_HOME: E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\..
            .
              JAVA: C:\Program Files\Java\jdk1.6.0_31\bin\java
            .
              JAVA_OPTS:
            .
              CLASSPATH: ;C:\Program Files\Java\jdk1.6.0_31/lib/tools.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/activation.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/getopt.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/wstx.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/wsdl4j.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/jbossall-client.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/log4j.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/mail.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/concurrent.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/jbossws-spi.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/javassist.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/jboss-xml-binding.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/jb
            ossws-client.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/jboss-jaxws.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/jboss-jaxrpc.jar;E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin\\../client/jboss-saaj.jar
            ========================================================================="
            .
            Usage: wstools (-classpath|-cp) <classpath> -config <config> [-dest <destination path>]
            E:\installable\jboss-5.0.0.CR2-jdk6\jboss-5.0.0.CR2\bin>

             

            Thanks

            Vivek

            • 3. Re: how to create mappings.xml for webservices
              nickarls

              Which AS are you targetting? 5 or 7?

              • 4. Re: how to create mappings.xml for webservices
                mitvivek

                I am targetting AS7.

                 

                But since the wstools file is not there in AS7 so I am trying to work with AS5.

                 

                Although I am facing the issues with both the versions.

                 

                Thanks

                Vivek

                • 5. Re: how to create mappings.xml for webservices
                  nickarls

                  You have no wsconsume in the AS bin dir?

                  • 6. Re: how to create mappings.xml for webservices
                    sfcoy

                    Ultimately you will find life easier if you can get wsconsume working.

                     

                    Have a look at JBoss Web Services Quick Start and try and get that going with your WSDL.

                    • 7. Re: how to create mappings.xml for webservices
                      mitvivek

                      I have wsconsume but when I run the following:

                       

                      C:\Users\invmittal\Downloads\jboss-as-7.2.0.Alpha1-SNAPSHOT\bin>wsconsume.bat -k -o C:\Users\invmittal\Downloads\jboss-as-7.2.0.Alpha1-SNAPSHOT\webservice -s C:\Users\invmittal\Downloads\jboss-as-7.2.0.Alpha1-SNAPSHOT\webservice -e -a C:\Users\invmittal\Downloads\jboss-as-7.2.0.Alpha1-SNAPSHOT\webservice\TestActions.wsdl
                      Could not find log4j.xml configuration, logging to console.

                      TODO! Cheek SOAP 1.2 extension
                      Loading FrontEnd jaxws ...
                      Loading DataBinding jaxb ...
                      wsdl2java -compile -exsh true -d C:\Users\invmittal\Downloads\jboss-as-7.2.0.Alpha1-SNAPSHOT\webservice -verbose -classdir C:\Users\invmittal\Downloads\jboss-as-7.2.0.Alpha1-SNAPSHOT\webservice -allowElementReferences file:/C:/Users/invmittal/Downloads/jboss-as-7.2.0.Alpha1-SNAPSHOT/webservice/TestActions.wsdl
                      wsdl2java - Apache CXF 2.6.4

                       

                      This generates the source classes but there is no mapping file generated.

                       

                      I am not sure is there simething missing in this?

                       

                      Vivek

                       

                       

                      • 8. Re: how to create mappings.xml for webservices
                        sfcoy

                        You don't need a mapping file when using JAX-WS.

                        • 9. Re: how to create mappings.xml for webservices
                          aris_302

                          I also have problems with regards to that matter. I tried to search in for google but most of them provided me with no answers regarding mappings.xml.

                           

                          ___________________________________________________________

                           

                           

                          Woodworking Plans Information

                          Table Woodworking Plans

                          • 10. Re: how to create mappings.xml for webservices
                            mitvivek

                            Hi Stephen,

                             

                            Actually I am trying to migrate a project from IBM WAS to Jboss and in this as per the original implementation there are references for

                            <

                            jaxrpc-mapping-file

                            >

                             

                            I need a way to create these files.

                            Hope I am not going in a wromng direction.

                            Could you please provide me some help.

                            Thanks

                            Vivek

                            • 11. Re: how to create mappings.xml for webservices
                              sfcoy

                              Vivek Mittal wrote:

                               

                              Hi Stephen,

                               

                              Actually I am trying to migrate a project from IBM WAS to Jboss and in this as per the original implementation there are references for

                               

                              <

                               

                               

                              jaxrpc-mapping-file

                              >

                               

                               

                              I need a way to create these files.

                              ...

                               

                              Why do you think that you still need those files?

                              • 12. Re: how to create mappings.xml for webservices
                                mitvivek

                                I have the dependency for jaxrpc-mapping file in my webservices.xml.

                                 

                                In short I don't want to change much of the project structure.

                                 

                                Also could you please guide me as to how can I use the existing webservices without these files if possible with a minimal change.

                                 

                                Vivek

                                • 13. Re: how to create mappings.xml for webservices
                                  sfcoy

                                  I suggest that you pose a new question on the forum entitled "How do I build and deploy existing JAX-RPC web services on AS7".

                                   

                                  Hopefully one of the web services developers will see it and respond. The spec requires that JAX-RPC be supported in JEE6 (although its days are numbered).

                                   

                                  Explain that you're trying to migrate from IBM WAS.

                                  • 14. Re: how to create mappings.xml for webservices
                                    mitvivek

                                    Certainly Stephen, will pose a new question.

                                     

                                    Thanks for your time.

                                     

                                    Cheers

                                    Vivek