4 Replies Latest reply on Apr 14, 2005 11:33 AM by Per Arneng

    Problem generating mapping file

    Per Arneng Newbie

      What i want to do:

      Generate wsdl file and a jaxrpc-mapping.xml file


      In ant i have the following code:

       <exec executable="C:\PF\jwsdp-1.5\jaxrpc\bin\wscompile.bat">
       <arg value="-cp" />
       <arg value="bin" />
       <arg value="-gen:server" />
       <arg value="-f:rpcliteral" />
       <arg value="-mapping c:\jaxrpc-mapping.xml" />
       <arg value="conf/jaxrpc-config.xml"/>
       </exec>
      


      I get the following error:

       [exec] error: -mapping c:\jaxrpc-mapping.xml is an invalid option or argument
       [exec] Usage: wscompile [options] configuration_file
      


      I have tested with wscompile from jwsdp 1.5 and J2EE 1.4
      with both the command line and the ant task..

      config file:

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration
       xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
      
      
      
       <service name="TestService"
       targetNamespace="http://abcdexyz.com/wsdl"
       typeNamespace="http://abcdexyz.com/types"
       packageName="test">
      
       <interface name="test.TestEndpoint"
       servantName="test.TestBean"/>
       </service>
      
      </configuration>


      So my question is.. how do i use the mapping option ?

      /Per

        • 1. Re: Problem generating mapping file
          Per Arneng Newbie

          Problem solved but would like to use ant task instead:

          <arg value="-mapping c:\jaxrpc-mapping.xml" />
          


          shoud be:

          <arg value="-mapping" />
          <arg value="c:\jaxrpc-mapping.xml" />
          


          Cant get the ant task wscompile to work but i can call
          the bat file ...

          Any ideas of how to turn this:
           <exec executable="${env.J2EE_HOME}\bin\wscompile.bat">
           <arg value="-cp" />
           <arg value="bin" />
           <arg value="-nd" />
           <arg value="bin" />
           <arg value="-define" />
           <arg value="-mapping" />
           <arg value="bin\jaxrpc-mapping.xml" />
           <arg value="conf/jaxrpc-config.xml"/>
           </exec>
          


          into the wscompile ant task .. i get problems with
          the mapping attribute

          • 2. Re: Problem generating mapping file
            Georg Hallingstrom Newbie

            Hello,

            I had the same problem. I solved it by including a simple java ant task take a look here:

            http://www.jboss.org/index.html?module=bb&op=viewtopic&t=59009


            Hopes this helps,

            Georg

            • 3. Re: Problem generating mapping file
              Noel Rocher Apprentice

              I'm using the wscompile "fork" option to true and add all java_home/lib jars in the classpath :

               <wscompile
               verbose="true"
               xPrintStackTrace="true"
               keep="true"
               fork="true"
               base="classes/server"
               server="true"
               sourcebase="generated/sources/server"
               nonclassdir="generated/wsdl"
               features="documentliteral,wsi,strict"
               mapping="generated/jaxrpc-mapping.xml"
               config="conf/config-server.xml">
              
               <classpath>
               <pathelement location="classes/server"/>
               <path refid="my.classpath"/>
               </classpath>
               </wscompile>
              
              


              • 4. Re: Problem generating mapping file
                Per Arneng Newbie

                It works fine with ANT now .. thanks for the replies...

                Here is a test build file that works...

                <project name='test' default="compile">
                
                 <property environment="env" />
                
                 <path id="wscompile.classpath">
                 <fileset dir="${env.JWSDP_HOME}">
                 <include name="jaxp/lib/endorsed/dom.jar" />
                 <include name="jaxp/lib/endorsed/sax.jar" />
                 <include name="jaxp/lib/endorsed/xalan.jar" />
                 <include name="jaxp/lib/endorsed/xercesImpl.jar" />
                 <include name="jaxp/lib/jaxp-api.jar" />
                 <include name="jaxrpc/lib/jaxrpc-api.jar" />
                 <include name="jaxrpc/lib/jaxrpc-impl.jar" />
                 <include name="jaxrpc/lib/jaxrpc-spi.jar" />
                 <include name="jwsdp-shared/lib/activation.jar" />
                 <include name="jwsdp-shared/lib/jax-qname.jar" />
                 <include name="jwsdp-shared/lib/mail.jar" />
                 <include name="jwsdp-shared/lib/namespace.jar" />
                 <include name="jwsdp-shared/lib/relaxngDatatype.jar" />
                 <include name="jwsdp-shared/lib/xsdlib.jar" />
                 <include name="saaj/lib/saaj-api.jar" />
                 <include name="saaj/lib/saaj-impl.jar" />
                 </fileset>
                 </path>
                
                 <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">
                 <classpath refid="wscompile.classpath"></classpath>
                 </taskdef>
                
                 <target name="compile">
                
                 <javac srcdir="src" destdir="bin" >
                 <include name="**/*.java"/>
                 </javac>
                
                 <wscompile
                 verbose="false"
                 xPrintStackTrace="false"
                 keep="true"
                 fork="true"
                 define="true"
                 nonclassdir="bin"
                 mapping="bin/jaxrpc-mapping2.xml"
                 config="conf/jaxrpc-config.xml">
                 <classpath>
                 <pathelement location="bin" />
                 <path refid="wscompile.classpath" />
                 </classpath>
                 </wscompile>
                
                 <jar destfile="bin\test.jar">
                 <zipfileset dir="bin" prefix="META-INF/wsdl">
                 <include name="TestService.wsdl" />
                 </zipfileset>
                 <zipfileset dir="bin" prefix="META-INF">
                 <include name="jaxrpc-mapping.xml" />
                 </zipfileset>
                 <zipfileset dir="conf" prefix="META-INF">
                 <include name="webservices.xml" />
                 <include name="ejb-jar.xml" />
                 </zipfileset>
                 <fileset dir="bin">
                 <include name="**/*.class" />
                 </fileset>
                
                 </jar>
                
                
                
                 </target>
                
                </project>