Link to home
Start Free TrialLog in
Avatar of prgeorge3383
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\Service.cs      78      21      d:\WebSite3\

This is the error I am getting

Avatar of GENTP
GENTP

have you tried making your struct into a class?
Avatar of prgeorge3383

ASKER

yes I did

<GenericObjectDataSource DisplayName="Order" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
   <TypeInfo>WindowsApplication1.localhost.Order, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

Warning      1      The 'urn:schemas-microsoft-com:xml-msdatasource:GenericObjectDataSource' element is not declared.      C:\Documents and Settings\xxxxT\My Documents\Visual Studio 2005\Projects\WindowsApplication2\WindowsApplication2\Web References\localhost\Order.datasource      8      2      WindowsApplication2


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
Avatar of mrichmon
mrichmon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial