1 Reply Latest reply on Oct 14, 2004 9:03 PM by Chunke Yang

    xdoclet tag to generate parameter modes for web method?

    Chunke Yang Newbie

      Hello,

      I have a web method defined as follows,

       /**
       * @ejb.interface-method view-type = "local"
       *
       * @jboss-net.web-method returnQName="echo"
       *
       */
       public void echo(IntHolder holder) {
       System.out.println("holder.value = " + holder.value);
       holder.value = 1;
       }
      

      The web-service.xml generated by xdoclet1.2 with xdoclet-module-jboss-net.jar looks like
      ...
       <operation name="echo" returnQName="echo">
       <parameter name="holder"/>
       </operation>
      ...
      

      After the wsr has been deployed (JBOSS 3.2.3), I got the following error when I tried to access web service's wsdl,

      java.lang.IllegalArgumentException: Illegal argument passed to ParameterDesc.setJavaType. The java type javax.xml.rpc.holders.IntHolder does not match the mode in
      
      at org.apache.axis.description.ParameterDesc.setJavaType(ParameterDesc.java:263)
      at org.apache.axis.description.ServiceDesc.syncOperationToClass(ServiceDesc.java:677)
      at org.apache.axis.description.ServiceDesc.getSyncedOperationsForName(ServiceDesc.java:1013)
      at org.apache.axis.description.ServiceDesc.loadServiceDescByIntrospectionRecursive(ServiceDesc.java:887)
      at org.apache.axis.description.ServiceDesc.loadServiceDescByIntrospection(ServiceDesc.java:821)
      at org.apache.axis.providers.java.JavaProvider.initServiceDesc(JavaProvider.java:631)
      at org.jboss.net.axis.server.EJBProvider.initServiceDesc(EJBProvider.java:285)
      at org.apache.axis.handlers.soap.SOAPService.getInitializedServiceDesc(SOAPService.java:342)
      at org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java:507)
      at org.jboss.net.axis.Deployment.getDeployedServices(Deployment.java:233)
      at org.apache.axis.configuration.FileProvider.getDeployedServices(FileProvider.java:321)
      at org.apache.axis.transport.http.AxisServlet.reportAvailableServices(AxisServlet.java:681)
      at org.apache.axis.transport.http.AxisServlet.doGet(AxisServlet.java:262)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:339)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      ...
      

      And if I modified web-service.xml as the followings,

      <operation name="echo" returnQName="echo">
      <parameter name="holder" mode="INOUT"/>
      </operation>
      


      I could correctly retrieve WSDL.

      My question is, is there an xdoclet tag that can generate correct parameter mode for web methods, or do I have to manually modify web-service.xml for web methods that have holder classes as their parameters?

      Thanks in advance.

        • 1. Re: xdoclet tag to generate parameter modes for web method?
          Chunke Yang Newbie

          I borrowed the idea from

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

          and replaced "jboss-net_xml_method.xdt" in "xdoclet-module-jboss-net.jar" with

          <!-- Operation mapping results -->
          <XDtMethod:forAllMethods>
           <XDtMethod:ifHasMethodTag tagName="jboss-net.web-method" paramName='returnQName'>
           <operation name="<XDtMethod:methodName/>" <XDtMethod:ifHasMethodTag tagName='jboss-net.web-method' paramName='returnQName'> returnQName="<XDtMethod:methodTagValue tagName='jboss-net.web-method' paramName='returnQName'/>"</XDtMethod:ifHasMethodTag>>
           <XDtMethod:ifDoesntHaveMethodTag tagName="jboss-net.web-method-parameter">
           <XDtParameter:forAllMethodParams>
           <parameter name="<XDtParameter:methodParamName/>"/>
           </XDtParameter:forAllMethodParams>
           </XDtMethod:ifDoesntHaveMethodTag>
           <XDtMethod:ifHasMethodTag tagName="jboss-net.web-method-parameter">
           <XDtMethod:forAllMethodTags tagName="jboss-net:web-method-parameter">
           <parameter name="<XDtMethod:methodTagValue tagName='jboss-net.web-method-parameter' paramName='name'/>" mode="<XDtMethod:methodTagValue tagName='jboss-net.web-method-parameter' paramName='mode'/>"/>
           </XDtMethod:forAllMethodTags>
           </XDtMethod:ifHasMethodTag>
           </operation>
           </XDtMethod:ifHasMethodTag>
          </XDtMethod:forAllMethods>
          


          now, if i set my javadoc as

          ...
           /**
           * @ejb.interface-method view-type = "local"
           *
           * @jboss-net.web-method returnQName="echo"
           * @jboss-net.web-method-parameter name="holder" mode="INOUT"
           */
           public void echo(IntHolder holder) {
           System.out.println("holder.value = " + holder.value);
           holder.value = 1;
           }
          ...
          


          i will get

          ...
           <operation name="echo" returnQName="echo">
           <parameter name="holder" mode="INOUT"/>
           </operation>
          ...
          


          in the generated web-service.xml.