Naresh has answered only one half of the question (the server side). From the server's perspective, the return is an XML element, but if I understand Hengel's question, his client wants the XML element translated into a Java class. Which is fine.
Naresh is correct that you want to use a document-style Web service, and from the server's perspective, you want to use an Axis message service. But for the client side, you want to map the XML element to a JavaBean. You need to define the XML element using XML Schema in the wsdl:types section. Then you should be able to take the WSDL file and run WSDL2Java to generate everything you need on the client side. It should generate a JavaBean that represents the XML element for you, and you'll need to include that JavaBean in your client application. Anne ----- Original Message ----- From: "Naresh Bhatia" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, July 26, 2003 7:40 AM Subject: RE: How to return an XML as a complex type (xsdl) > Hi Hengel, > > If all you are trying to do is to return an XML document in the SOAP > body, use a document-style Web service, specifically Axis's "message > service-style". This is documented in the Axis user's guide. You can see > an example of such usage in the Simple Messaging Framework at > smfw.sourceforge.net. You can look at the processMessage() method in the > following class which takes in an XML document, processes it and returns > an XML document. > > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/smfw/smfw/modules/smfw/sr > c/org/sape/smfw/soapengine/MessageService.java?rev=1.1&content-type=text > /vnd.viewcvs-markup > > Your WSDL will essentially describe the schema of the documents being > passed back and forth. > > Hope this helps. > > Naresh > > -----Original Message----- > From: Hengel Zambrano [mailto:[EMAIL PROTECTED] > Sent: Friday, July 25, 2003 5:22 PM > To: [EMAIL PROTECTED] > Subject: How to return an XML as a complex type (xsdl) > > > Hi, > > > I'm writting a webservice which returns a complex type. This complex > type is a XML document in the service side since my web service is a > wrapper to the server which build XML files. > > I can't return the XML as a org.w3c.dom.Element because the client who > is going to consume the service doesn't know anything about > that class. I need to add a reference to a type using xsd in the wsdl > (which i already did) > > What should I do to return the XML document as a custom type specified > in the wsdl ? > > What is a better solution: SOAP-RPC, SOAP-MSG ? > > I'm using AXIS. > > > > Thanks a lot for the help. > > -- > >
