4 Replies Latest reply on Feb 7, 2008 11:57 AM by cbax007

    SOAPElement as input param

      In JBoss-4.0.4, I was able to set up a webservice that had an operation that took SOAPElement as it's only param. In upgrading to 4.2.2, this no longer seems to work. Is there a way to get this to work in 4.2.2 with the new JBossWS?

        • 1. Re: SOAPElement as input param
          oskar.carlstedt

          Hi!

          Just use a javax.xml.ws.Provider< SOAPElement > provider. You create a class that implements the Provider interface. You'll get something like:

          @Local
          @Stateless
          @WebServiceProvider(
           serviceName = "...",
           portName = "...",
           targetNamespace = "...",
           wsdlLocation = "META-INF/wsdl/...")
          @ServiceMode(value = Service.Mode.PAYLOAD)
          public class MyServiceBean implements Provider<SOAPElement> {
          
           public SOAPElement invoke(SOAPElement requestSOAPElement) {
          
           ...
          
           }
          
          }
          



          You can read more about this in the JBossWS documentation. Pay attention to the ServiceMode.PAYLOAD. If you change this to ServiceMode.MESSAGE you can retrieve the whole soap message.

          You can only implement the javax.xml.ws.Provider with the types SOAPElement, SOAPMessage and Source (e.g. StreamSource, DOMSource, ...).

          Cheers
          /Oskar




          • 2. Re: SOAPElement as input param
            heiko.braun

            So, you figured it out yourself. Would you mind add some notes to the WIKI?

            http://jbws.dyndns.org/mediawiki/index.php

            • 3. Re: SOAPElement as input param

              Thanks for the help. I guess the one thing I'm fumbling with here is what the wsdl would look like for this service. In reading the docs, you need to include it explicitly with the deployed service as oppose to allowing it to be generated at deploy time. I tried to use wsprovide to generate it but that doesn't work. Could you provide a wsdl sample for the provider sample you included? Thanks.

              • 4. Re: SOAPElement as input param

                Nevermind. I figured it out. Thanks again for the help though.