0 Replies Latest reply on Nov 25, 2013 1:46 AM by Meriam Jab

    JBoss WS Tools wsconsume support for xjc and fluent api

    Meriam Jab Newbie

      I was working with Metro, and my client was generated using wsimport by passing different arguments

       

      <wsimport keep="true" sourcedestdir="${sourceDir}" destdir="${binDir}" extension="true" wsdl="${wsdlUrl}" binding="${basedir}/jaxbCalendarBinding.xml">
        <xjcarg value="-cp" />
        <xjcarg path="${metroLib}/plugins/jaxb-commons-lang-plugin-2.2.jar:${metroLib}/plugins/jaxb-fluent-api-2.2.jar:
        ${metroLib}/plugins/collection-setter-injector.jar" />
        <xjcarg value="-Xcommons-lang" />
        <xjcarg value="-Xcommons-lang:ToStringStyle=SHORT_PREFIX_STYLE" />
        <xjcarg value="-Xfluent-api" />
        <xjcarg value="-Xcollection-setter-injector" />
        </wsimport>
      
      

       

      Once migrated to JBoss EAP6, I was wndering to generate also my WSDLs and client using JBoss Tolols, so I have modified my ant file like this:

      <wsconsume
        fork="false"
        keep="true"
        destdir="${binDir}"
        sourcedestdir="${sourceDir}"
        wsdl="${wsdlUrl}"
        binding="${basedir}/jaxbCalendarBinding.xml"/>
      
      

      But how to add the fluent API.

      Otherwhise, should I keep the use of metro tool to generate my Ws or it may cause problems later.

      I have seen in this discussion https://community.jboss.org/thread/214200 a solution for cxf. I have tried this but it is not working:

      <java classname="org.jboss.ws.tools.ant.WSConsumeTask" fork="false" failonerror="true">
        <arg value="-ant" /> 
        <arg value="-client" /> 
        <arg value="-d" /> 
        <arg value="${sourceDir}" /> 
        <arg value="-b" /> 
        <arg value="${basedir}/jaxbCalendarBinding.xml" /> 
        <arg value="-xjc-Xcommons-lang"/> 
        <arg value="-xjc-Xcommons-lang:ToStringStyle=SHORT_PREFIX_STYLE" /> 
        <arg value="-xjc-Xfluent-api" /> 
        <arg value="-xjc-Xcollection-setter-injector"/> 
        <arg value="${wsdlUrl}" /> 
        <classpath> 
         <fileset dir="${jbossModuleDir}"> 
          <include name="**/*.jar" /> 
         </fileset> 
        <fileset dir="${fluentDir}"> 
          <include name="**/*.jar" /> 
        </fileset> 
        </classpath> 
        </java>