Connecting Tech Pros Worldwide Forums | Help | Site Map

Returning strings in web services

Randy
Guest
 
Posts: n/a
#1: Nov 16 '05
Hello,
I have a web service in which I'm doing a query to an Access database and
returning the resulting XML data when I do the return from the service...
public string AOS_Data(string sql)
{
CDFDBSoapService.DBWebService dbws = new CDFDBSoapService.DBWebService();
Do the connection stuff here...
return dbws.queryDatabase(sql);
}

This all works fine. I was thinking about doing the query and returning the
results into a string and then returning that string like...
public string AOS_Data(string sql)
{
CDFDBSoapService.DBWebService dbws = new CDFDBSoapService.DBWebService();
Do the connection stuff here...
string buffer = dbws.queryDatabase(sql);
return buffer;
}

I'm not sure what the length of buffer (above) would be so I'm not sure if
all the data would get returned. When you do a...
string buffer = dbws.queryDatabase(sql);
Does this make buffer as long as it needs to be to handle the returning data
in the query, or is there a finite length?
Thanks all...

Cheers :)



Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
#2: Nov 16 '05

re: Returning strings in web services


Randy,

If you return a string, you can be assured that the complete string will
be returned.

Also, if you want to return a DataSet (since you seem to be going
against a database), you can do that, and the web service will wire it up
correctly for you.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"Randy" <temp@temp.com> wrote in message
news:uuIFAljTEHA.1412@TK2MSFTNGP11.phx.gbl...[color=blue]
> Hello,
> I have a web service in which I'm doing a query to an Access database and
> returning the resulting XML data when I do the return from the service...
> public string AOS_Data(string sql)
> {
> CDFDBSoapService.DBWebService dbws = new[/color]
CDFDBSoapService.DBWebService();[color=blue]
> Do the connection stuff here...
> return dbws.queryDatabase(sql);
> }
>
> This all works fine. I was thinking about doing the query and returning[/color]
the[color=blue]
> results into a string and then returning that string like...
> public string AOS_Data(string sql)
> {
> CDFDBSoapService.DBWebService dbws = new[/color]
CDFDBSoapService.DBWebService();[color=blue]
> Do the connection stuff here...
> string buffer = dbws.queryDatabase(sql);
> return buffer;
> }
>
> I'm not sure what the length of buffer (above) would be so I'm not sure if
> all the data would get returned. When you do a...
> string buffer = dbws.queryDatabase(sql);
> Does this make buffer as long as it needs to be to handle the returning[/color]
data[color=blue]
> in the query, or is there a finite length?
> Thanks all...
>
> Cheers :)
>
>[/color]


Closed Thread