1. Created a WebService
2. Create a Class Library and add web reference (#1) per suggested here.
http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/ecb63966-eda7-4cfb-b417-2328b3a1abed
I did this in the Class Library
public class MyWebServiceWrapper
{
private MyWebService obj = new MyWebService();
public MyWebServiceWrapper()
{
obj.Url = ConfigurationManager.AppSettings["MyUrl"];
}
public void WebMethodA() //same name as in the web services
{
obj.WebMethodA();
}
}
I did this in the client (test client is winform). (by the way, system.web.services is deleted from reference)
MyWebServiceWrapper obj = new MyWebServiceWrapper();
datagridview.datasource = obj.WebMethodA(); - GETTTING THIS ERROR "cannot implicitly convert void to object
What to do?????????????????????????????????
Client ----> .NET class libray-----> Secured Web Services
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Nir Bar107 reputationPosted Sep 23, 2009, 11:01 AM EDT
The problem is that WebMethodA doesn't return a value (=void)
You should change it to return a value that's usable by a DataGridView.DataSource, such as DataTable, DataView, ...
Please mark this post as an answer if it helps you
Nir
name4 reputationPosted Sep 23, 2009, 11:21 AM EDT
class library code (added namespace using System.Data;)
public dataset MethodA()
{
return myWebServices.MethodA()
}
Now it's working.