M
Mark
I'm consuming a webservice that makes a simple object available. The object
class is marked in the web service as [serializable]. I have a web
application that consumes and uses this web service's class. When I receive
the object from the web service, I'm interested in storing that object in
ViewState in the web application, but I receive the error below. I'm not
shocked that the web application can't serialize the object as the
[seralizable] attribute isn't something that cann be passed through the web
via the WSDL. Moreover, overriding the method for serialization in the web
service's code will not pass through the WSDL either.
This suggests that the only way for me to store this information in
ViewState on my client web application is to create my own local
object/objects, "copy" the data from the web service's object to my own, and
then store that object in ViewState. Correct or incorrect? This didn't
strike me was very elegant, but I don't see any alternatives.
Thanks in advance.
Mark
The type 'FlexiWebTestHarness.FlexiWS.Parameters' must be marked as
Serializable or have a TypeConverter other than ReferenceConverter to be put
in viewstate.
[Serializable]
public class MyClass
{
public MyClass()
{
MyString = "Wow";
}
public string MyString;
public void SaveToDatabase()
{
//Consider yourself saved.
}
}
class is marked in the web service as [serializable]. I have a web
application that consumes and uses this web service's class. When I receive
the object from the web service, I'm interested in storing that object in
ViewState in the web application, but I receive the error below. I'm not
shocked that the web application can't serialize the object as the
[seralizable] attribute isn't something that cann be passed through the web
via the WSDL. Moreover, overriding the method for serialization in the web
service's code will not pass through the WSDL either.
This suggests that the only way for me to store this information in
ViewState on my client web application is to create my own local
object/objects, "copy" the data from the web service's object to my own, and
then store that object in ViewState. Correct or incorrect? This didn't
strike me was very elegant, but I don't see any alternatives.
Thanks in advance.
Mark
The type 'FlexiWebTestHarness.FlexiWS.Parameters' must be marked as
Serializable or have a TypeConverter other than ReferenceConverter to be put
in viewstate.
[Serializable]
public class MyClass
{
public MyClass()
{
MyString = "Wow";
}
public string MyString;
public void SaveToDatabase()
{
//Consider yourself saved.
}
}