need urgent help.. serialization issue!

I am getting the following error while running my application

Message:
Exception of type System.Web.HttpUnhandledException was thrown.
Stack Trace:
System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. > System.Runtime.Serialization.SerializationException: Invalid method signature 'xsd:int a2Big SmileocumentType'.

Server stack trace:
at System.Runtime.Serialization.Formatters.Soap.SoapHandler.ProcessType(ParseRecord pr, ParseRecord objectPr)
at System.Runtime.Serialization.Formatters.Soap.SoapHandler.ProcessAttributes(ParseRecord pr, ParseRecord objectPr)
at System.Runtime.Serialization.Formatters.Soap.SoapHandler.EndElement(String prefix, String name, String urn)
at System.Runtime.Serialization.Formatters.Soap.SoapParser.ParseXml()
at System.Runtime.Serialization.Formatters.Soap.SoapParser.Run()
at System.Runtime.Serialization.Formatters.Soap.ObjectReader.Deserialize(HeaderHandler handler, ISerParser serParser)
at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream serializationStream, HeaderHandler handler)
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeSoapRequestMessage(Stream inputStream, Header[] h, Boolean bStrictBinding, TypeFilterLevel securityLevel)
at System.Runtime.Remoting.Channels.SoapServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

can anyone help me out with this one!

[2126 byte] By [SonalGupta] at [2008-1-10]
# 1

Hi Sonal,

Can you post the method signature and any custom types you are using?

Thank you

AlbertoArias-MSFT at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 2
I am implementing remoting.. making a remotable object in a facade class to access the getDocumentByID method of the document engine class. the metoh definition goes like :

public Document GetDocumentByID(int documentID, DocumentType documentType) and

public Document GetDocumentByID(int documentID)


(overloaded methods)

SonalGupta at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 3

Have you marked DocumentType with the [Serializable] attribute?

Thank you

AlbertoArias-MSFT at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 4
yes.. i have marked document type class as serializable.. can this error come if certain types defined in document type class are unserializable?
SonalGupta at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 5

Yes, all types have to be serializable.

AlbertoArias-MSFT at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 6
ok.. can u please let me know what all types(or objects) are non-serializable in .net. and if we mark an object as non serializable.. why do we do that? thanks for all the help
SonalGupta at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 7

Any class without the class attribute [Serializable] is not serializable.

I.e. any of your classes should include this attribute.

Is DocumentType defined in a separate assembly? Are you hosting in IIS? If so, can you check that the web.config has a reference to the assembly containing DocumentType?

Thank you

AlbertoArias-MSFT at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 8

I have marked document type and all its base classes as serializable. yes, document type is in a separate asembly called global and i am hosting in IIS.. how do i create a reference to this global assembly in web.config>

thanks!

SonalGupta at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 9

Do you have a copy in the bin directory?

AlbertoArias-MSFT at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified