0 Replies Latest reply on Jun 6, 2008 4:28 PM by Narayanan Raghavan

    Method Overloading and SOAP Annotations

    Narayanan Raghavan Newbie

      I have myHelloWorld EJB3 service with 3 overloaded methods and corresponding SOAP Annotations. per the WSDL Spec, the combination of method name and in/out parameter name is unique i.e.,
      [SomeMethod, somedaylong, somedaylong, somemonth]
      [SomeMethod, somedayint, somedayint, somemonth]
      [SomeMethod, somedaylong, somedayint, somemonth]

      When I deploy this service in my JBoss 4.2.1 GA container i get the following error message:

      2008-06-06 14:23:26,714 WARN [org.jboss.ws.metadata.wsdl.WSDLBinding] Multiple binding operations reference: {http://Some.services.xyz.com/}SomeMethod
      2008-06-06 14:23:26,715 WARN [org.jboss.ws.metadata.wsdl.WSDLBinding] Multiple binding operations reference: {http://Some.services.xyz.com/}SomeMethod
      2008-06-06 14:23:26,715 WARN [org.jboss.ws.metadata.wsdl.WSDLBinding] Multiple binding operations reference: {http://Some.services.xyz.com/}SomeMethod
      2008-06-06 14:23:26,742 ERROR [org.jboss.deployment.MainDeployer] Could not start deployment: file:/var/lib/jbossas/server/production/tmp/deploy/tmp34936Some-service-ear-1.0-SNAPSHOT.ear-contents/Some-service-ejb-1.0-SNAPSHOT.jar
      java.lang.IllegalArgumentException: Duplicate operation with name=SomeMethod, found in binding '{http://Some.services.xyz.com/}SomeServiceBinding'.
       at com.ibm.wsdl.BindingImpl.getBindingOperation(BindingImpl.java:244)
       at org.jboss.ws.tools.wsdl.WSDL11Reader.getBindingOperation(WSDL11Reader.java:940)
       at org.jboss.ws.tools.wsdl.WSDL11Reader.getOperationStyle(WSDL11Reader.java:949)
       at org.jboss.ws.tools.wsdl.WSDL11Reader.processPortTypeOperations(WSDL11Reader.java:655)
       at org.jboss.ws.tools.wsdl.WSDL11Reader.processPortType(WSDL11Reader.java:642)
       at org.jboss.ws.tools.wsdl.WSDL11Reader.processBinding(WSDL11Reader.java:1035)
       at org.jboss.ws.tools.wsdl.WSDL11Reader.processPort(WSDL11Reader.java:1560)
       at org.jboss.ws.tools.wsdl.WSDL11Reader.processPorts(WSDL11Reader.java:1545)
       at org.jboss.ws.tools.wsdl.WSDL11Reader.processServices(WSDL11Reader.java:1515)
       at org.jboss.ws.tools.wsdl.WSDL11Reader.processDefinition(WSDL11Reader.java:174)
       at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:128)
       at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)
       at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:166)
       at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:50)
       at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3.buildMetaData(JAXWSMetaDataBuilderEJB3.java:78)
       at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.create(UnifiedMetaDataDeploymentAspect.java:71)
       at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(Unknown Source)
       at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:97)
       at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:90)
       at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy34.start(Unknown Source)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      


      Hello World Impl Code:
      public class SomeServiceBean implements SomeService {
      
       @WebMethod
       @WebResult(name="someData")
       public string SomeMethod ( @WebParam(name="somedaylong") long X,
       @WebParam(name="somedaylong") long Y,
       @WebParam(name="somemonth") string Z) {
      ....
      }
      
       @WebMethod
       @WebResult(name="someData")
       public string SomeMethod ( @WebParam(name="somedayint") int X,
       @WebParam(name="someweekint") int Y,
       @WebParam(name="somemonth") string Z) {
      ....
      }
      
      
       @WebMethod
       @WebResult(name="someData")
       public string SomeMethod ( @WebParam(name="somedaylong") long X,
       @WebParam(name="someweekint") int Y,
       @WebParam(name="somemonth") string Z) {
      ....
      }
      }