prgeorge3383
asked on
returning a struct from a webservice
struct MyStruct
{
public int x;
public int y;
};
[WebMethod]
public MyStruct getStruct()
{
MyStruct ms;
ms.x = 10;
ms.y = 20;
return ms;
}
Error 1 Inconsistent accessibility: return type 'Service.MyStruct' is less accessible than method 'Service.getStruct()' d:\WebSite3\App_Code\Servi ce.cs 78 21 d:\WebSite3\
This is the error I am getting
{
public int x;
public int y;
};
[WebMethod]
public MyStruct getStruct()
{
MyStruct ms;
ms.x = 10;
ms.y = 20;
return ms;
}
Error 1 Inconsistent accessibility: return type 'Service.MyStruct' is less accessible than method 'Service.getStruct()' d:\WebSite3\App_Code\Servi
This is the error I am getting
have you tried making your struct into a class?
ASKER
yes I did
<GenericObjectDataSource DisplayName="Order" Version="1.0" xmlns="urn:schemas-microso ft-com:xml -msdatasou rce">
<TypeInfo>WindowsApplicati on1.localh ost.Order, Web References.localhost.Refer ence.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeI nfo>
</GenericObjectDataSource>
Warning 1 The 'urn:schemas-microsoft-com :xml-msdat asource:Ge nericObjec tDataSourc e' element is not declared. C:\Documents and Settings\xxxxT\My Documents\Visual Studio 2005\Projects\WindowsAppli cation2\Wi ndowsAppli cation2\We b References\localhost\Order .datasourc e 8 2 WindowsApplication2
This is the error I am getting with a class
<GenericObjectDataSource DisplayName="Order" Version="1.0" xmlns="urn:schemas-microso
<TypeInfo>WindowsApplicati
</GenericObjectDataSource>
Warning 1 The 'urn:schemas-microsoft-com
This is the error I am getting with a class
did you update your web reference in your windows application? Just a thought.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.