On Tuesday 11 December 2007, priya j wrote: > Hi all, > > I am using the CXF HTTP binding for my application. I have an issue > with the xml output, can anyone help me on this. Im new to web > services. > > Here is my query: - example from CXF samples > the output is: > > - <Customers xmlns="http://sphsearch.webservice.com"> > - <customer> > <id>123</id> > <name>Dan Diephouse</name> > </customer> > </Customers> > > Why is the xml tag missing? <?xml version="1.0" encoding="UTF-8" ?> > If i am wrong anywhere let me know?
The xml tag is optional, especially over HTTP. For the most part, the content type and charset are both encoded in the HTTP headers, so the xml tag is just wasted bandwith so we exclude it. You could easily create an interceptor that could add it. Configuration could then be used to add that interceptor. > One more query is, can we change the order of the sub elements.(ie) > the name first and then the id Well, the easy way is to just reorder the fields and methods in the Customer.java object. However, with JAXB, you can add an annotation to set the order. Something like: @XmlType(name = "Customer", propOrder = { "name", "id" }) -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727 C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog