3 Replies Latest reply on Sep 1, 2008 3:55 AM by jimpo

    Getting handle of the original XML message in JAX-WS

    jimpo

      I am using JAX-WS to implement my web services. I start with a WSDL and then create the stubs and data objects using jbossws 2.0's wscompile tool. I have bunch of service operations A,B, and C that work like this, 'normally'.

      Now I would like to have a different kind of operation D which takes two parameter's D1 and D2. I want to have D1 mapped into a Java object like wsconsume -generated classes do. But, D2 should map into a String containing the xml representation of the parameter.

      How can I do this with JAX-WS and jbossws?

        • 1. Re: Getting handle of the original XML message in JAX-WS
          jimpo

          As an example, web service request that contains

          <vac:archiveDecision>
           <vac:employeeNumber>123</vac:employeeNumber>
           <vac:decision>
           <foo>
           dsadsa
           </foo>
           <bar>
           <baz>asdasd</baz>
           <baz2>asdasd</baz2>
           </bar>
           </vac:decision>
          </vac:archiveDecision>


          Should be mapped into Java object

          class Some {
          int employeeNumber;
          String decision
          }


          with values
          employeeNumber = 123,
          decision = "<vac:decision><foo>dsadsa</foo><bar><baz>asdasd</baz><baz2>asdasd</baz2></bar></vac:decision>"


          • 2. Re: Getting handle of the original XML message in JAX-WS
            jimpo

            guess I should give wscompile a JAXB binding xml that defines this kind of mapping.

            I can't figure out how to construct this binding.xml. How do I define a mapping which maps ComplexType 'archiveDecisionType's element 'decision' into a String containing the element's xml? Any examples?

            • 3. Re: Getting handle of the original XML message in JAX-WS
              jimpo

              Also, binding to a String is not a necessity. I could bind to a Document or an Element as well. As long as I can extract the xml easily, ie. not binding into a group of java objects.