X
xisco
hi,
I want to make my webmethod return my defined object and later it will be
consumed by a java client, so I did this very simple test.
In the webmethod I do:
[WebMethod]
public myClass GetMyClass()
{
myClass output = new myClass();
return output;
}
and this is my class:
public myClass : ISerializable
{
public myClass()
{
}
private int _item1 = -1;
public int Item1
{
get{return _item1;}
set{_item1 = value;}
}
private HashTable _list1 = new HastTable()
public HashTable List1
{
get{return _list1;}
set{_list1 = value;}
}
void ISerializable.GetObjectData( SerializationInfo info,
StreamingContex context)
{
info.SetType(typeof(myClass));
}
}
but this is not working. What I am missing here? is this the correct
approach?
Xis
I want to make my webmethod return my defined object and later it will be
consumed by a java client, so I did this very simple test.
In the webmethod I do:
[WebMethod]
public myClass GetMyClass()
{
myClass output = new myClass();
return output;
}
and this is my class:
public myClass : ISerializable
{
public myClass()
{
}
private int _item1 = -1;
public int Item1
{
get{return _item1;}
set{_item1 = value;}
}
private HashTable _list1 = new HastTable()
public HashTable List1
{
get{return _list1;}
set{_list1 = value;}
}
void ISerializable.GetObjectData( SerializationInfo info,
StreamingContex context)
{
info.SetType(typeof(myClass));
}
}
but this is not working. What I am missing here? is this the correct
approach?
Xis