The string being returned from the SOAP method must itself be embedded within an XML document, so it is "escaped", e.g. '<' is turned into '<'. If the client that calls the SOAP method correctly "un-escapes" these sequences, the resulting string will look like the string of XML text you created.
An alternative is to have the SOAP method return a DOM Element using literal XML encoding, and instead of creating an XML string within the method, create the DOM representation of the phone book entry. This works great for Apache SOAP, e.g. in the GetAllListings addressbook sample. However, it does not interoperate with other SOAP implementations. Scott Nichol ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, August 20, 2002 2:47 PM Subject: XML response in SOAP message ??? Hello everyone.. I have successfully used SOAP to make a telephone directory Web service. Right now I am returning "String" as return type from my Web service method back to the client and my client displays the string in HTML based browser. I was wondering if there is a way by which I can return the "XML" response (or XML return type) from SOAP web service method to client code which will parse the XML to produce Stylesheet-based tabular output. Here's the section of code from my SOAP method, I was trying to play with: /*** variable declaration***/ String mainStr; ..... ..... /*** assigning initial value to mainStr****/ mainStr = "<?xml version=\"1.0\"?> "; ....... ...... .. /*** creation of recordset based on some SQL query *******/ while (rs.next()) { firstn = rs.getString(1); lastn = rs.getString(2); phone = rs.getString(3); pager = rs.getString(5); home = rs.getString(6); count = count+1; /**** trying to create a XML string here which can then be returned *****/ mainStr = mainStr + " <Employee_Info> <Firstname> "+ firstn +" </Firstname><Lastname> "+lastn + " </Lastname> "+" <Extension> "+ phone +" </Extension> "+" <Pager> "+pager+" </Pager> "+ " <Home> "+ home +" </Home></Employee_Info>" + "\n"; } ....... ...... /**** returning XML string *****/ return mainSTr; Now when I am trying to return a string in the form of XML it is not showing any XML tags at web browser side. I was wondering why my the string my client application recieves doesnot see XML tags and displays simple string showing firstname, lastname, phone,..etc Thanks a lot in advance. Nishant Awasthi 330-328-0243 (cell) [EMAIL PROTECTED] -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>