-----Original Message-----
Dont know if this is a "best practice", but it works for me, Send it back
via another class. but make sure the secondary class is not the first one
within the namespace, VS.net doesn't like that, it'll say, "The Class
Service1 can be designed, but it is not the first class in the file", so
make sure its something like this:
public class Service1 : System.Web.Services.WebService
{
public Service1()
{
InitializeComponent();
}
[WebMethod]
public URLstr ReturnMyURL()
{
URLstr ustring = new URLstr();
ustring.somestring = "ewws.example.com";
return ustring;
}
public class URLstr
{
public string somestring;
}
Output I got:
<?xml version="1.0" encoding="utf-8" ?>
- <URLstr xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns="
http://tempuri.org/">
<somestring>ewws.example.com</somestring>
</URLstr>
Hope this helps.
Kunal
Christopher Ambler said:
When I create a web service, and create a web method
that returns a
string,
the output is always framed within a tag that looks like:
<string xmlns="
http://ewws.example.com/"> </string>
What I'd really like to do is eliminate this string and form my own XML to
send back.
Is this possible?
Christopher
.