2012/2/8 Aki Yoshida <[email protected]>: > 2012/2/7 fachhoch <[email protected]>: >> I saw this example from samples >> >> >> >> I need more help here, >> I need to understand how can I retrieve parameters from the request >> DomSource >> once I get the parameters I create my Object which could be person or >> employee or something else >> this object I want to to add to the response . >> Please advice me . >> > > A typical choice would be to work with XML directly or use generated > JAXB classes. > For a simple structure, you can work with XML directly. For a complex > structure, this becomes impractical. > If the input structure can be defined in one XML structure schema, you > can use its schema to generate a JAXB class that can be used to parse > the XML source. > > For the response direction, you can similarly generate JAXB classes > from the person and employee schemas in advance. Depending on the > input data, you can use one of the classes to build a response object > and convert it into Source at your service. For more information about > JAXB, you can google after JAXB tutorials/samples. > > And here is a totally different approach that you might be interested > in. If your employee and person structures are almost identical, you > may simply use one of them as the standard response type and have the > service implementation for this interface. In order to accommodate the > minor differences between the two structures, you can use the CXF's > transform feature. The transform feature is a very light-weight inline > transformer that can be configured as an interceptor to modify the > input or output XML data. You can find more information on the > transform feature in > http://cxf.apache.org/docs/transformationfeature.html
On the second thought, we can't use the transform feature for this particular case, as we haven't added the conditional transformation in the current release. If your input message type had two different types and they had to be unified into a single structure, the transform feature could have been used. > > regards, aki > >> >> -- >> View this message in context: >> http://cxf.547215.n5.nabble.com/webservice-with-changing-response-tp5456293p5464473.html >> Sent from the cxf-user mailing list archive at Nabble.com.
