1 Reply Latest reply on Jul 24, 2006 6:11 AM by Alessio Soldano

    @WebParam annotation and SOAP message attachments

    Tim Thomas Newbie

      I am currently trying to create a webservice that can take an arbitrary file as an input. I've looked at the documentation for creating multi-part SOAP attachments, but it seems a bit light, especially as related to autodiscovery of parameters.
      When I try to create a webservice like this:

      @WebMethod(operationName = "TestAttachment")
      public String testAttachment(@WebParam(name="Attachment") MimeMultipart attachment);

      I get the following exception:

      java.lang.NullPointerException
      at org.jboss.ws.tools.schema.SchemaTypeCreator.introspectJavaProperties(SchemaTypeCreator.java:575)
      at org.jboss.ws.tools.schema.SchemaTypeCreator.generateNewType(SchemaTypeCreator.java:334)
      at org.jboss.ws.tools.schema.SchemaTypeCreator.getType(SchemaTypeCreator.java:272)
      at org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:133)
      at org.jboss.ws.tools.JavaToXSD.generateForSingleType(JavaToXSD.java:109)
      at org.jboss.ws.tools.helpers.JavaToWSDLHelper.generateType(JavaToWSDLHelper.java:555)
      at org.jboss.ws.tools.helpers.JavaToWSDLHelper.generateTypesForXSD(JavaToWSDLHelper.java:141)
      at org.jboss.ws.tools.JavaToWSDL11.handleJavaToWSDLGeneration(JavaToWSDL11.java:236)
      at org.jboss.ws.tools.JavaToWSDL11.generate(JavaToWSDL11.java:168)
      at org.jboss.ws.tools.JavaToWSDL.generate(JavaToWSDL.java:318)
      at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.processOrGenerateWSDL(AnnotationsMetaDataBuilder.java:225)
      at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.setupEndpointFromAnnotations(AnnotationsMetaDataBuilder.java:174)
      at org.jboss.ws.metadata.AnnotationsMetaDataBuilderJSE.buildMetaData(AnnotationsMetaDataBuilderJSE.java:82)
      at org.jboss.ws.server.WebServiceDeployerJSE.createWebServicesMetaData(WebServiceDeployerJSE.java:196)
      at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:103)
      at org.jboss.ws.server.WebServiceDeployerJSE.create(WebServiceDeployerJSE.java:66)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
      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 $Proxy40.create(Unknown Source)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
      at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      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 $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      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 $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      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 $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      at org.jboss.Main.boot(Main.java:200)
      at org.jboss.Main$1.run(Main.java:464)
      at java.lang.Thread.run(Unknown Source)

      Should this work? Or am I going about this the wrong way?

        • 1. Re: @WebParam annotation and SOAP message attachments
          Alessio Soldano Newbie

          We are trying to create a webservice returning an arbitrary attachment. We took a look at the JBossWS 1.0.1 User Guide and decided to use JSR109, however we got the same error you reported. Considering this, we tried building the jbossws examples, in particular the "swa" one. Build process succeded, but if you take a look at common/imported-build.xml you can see that server artifacts (including the wsdl file) instead of beeing generated by wstools (that is not even called) are copied by the override directory. Forcing wstools to run does not solve the problem, since the supplied wstools-config.xml doesn't comply with jbossws-tool_1_0.xsd.
          Looking at the jbossws roadmap, at the jira (http://jira.jboss.org/jira/browse/JBWS-269) and reading some messages here on the forum, seems to me that jbossws tools' support for ws-attachment is not ready yet and that the only way to go is to manually create server artifacts (or may be using wscompile?).
          So I would like to know whether the JBoss Team can supply us some hints to create and deploy webservice with attachment using JBossWS, for example like what they did for WS4EE (http://wiki.jboss.org/wiki/Wiki.jsp?page=WS4EEAttachStepByStep)
          Thank you in advance
          Alessio Soldano