Groups | Blog | Home
all groups > dotnet component services > june 2006 >

dotnet component services : SerializationException while returning XmlElement type in Com+ Component


rh.krish NO[at]SPAM gmail.com
6/28/2006 8:59:31 PM
Hi,
I have a Com+ component in C# which has a method as follows:

public XmlElement CreateRequest ( string loanNumber );

This method creates a request using XmlDocument object and returns
XmlDocument.DocumentElement which is basically an XmlElement. Now after
registering in com+ using regsvcs & installing it in Gac, when I run my
client I'm getting the following exception:
===================================================================
Unhandled Exception:
System.Runtime.Serialization.SerializationException: The ty
pe System.Xml.XmlElement in Assembly System.Xml, Version=1.0.5000.0,
Culture=neu
tral, PublicKeyToken=b77a5c561934e089 is not marked as serializable.
at
System.EnterpriseServices.IRemoteDispatch.RemoteDispatchNotAutoDone(String
s)
at
System.EnterpriseServices.RemoteServicedComponentProxy.Invoke(IMessage
req
Msg)
at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgDa
ta, Int32 type)
at Hfw.HistoryPro.Bll.ServiceManager.CreateXmlRequest(String
loanNumber)
at Hfw.HistoryPro.WebService.HPWebService.Process(String loanNumber,
Boolean
requestSync) in
c:\applications\historypro\webservice\hpwebservice.asmx.cs:line
98
at TestClient.Client.CreateRequest(String loanNumber) in
c:\applications\hist
orypro\testclient\class1.cs:line 59
at TestClient.Client.Main(String[] args) in
c:\applications\historypro\testcl
ient\class1.cs:line 40
===================================================================

Anybody knows how to solve this issue?. Actually I'm puzzled to see
this because, in another part of my application (in the client from
which I'm making a com+ call) I''m making a call to a webservice which
has the signature as follows:
public int RequestAsynchronous ( XmlElement element );
and this call is succeeded if I create the xmlelement in the client
side itself. Help is appreceiated.

Thanks,
Hari.
Michael Nemtsev
7/9/2006 6:59:53 PM
Hello rh.krish@gmail.com,

Because XmlElement don't realize ISerializable interface that is requirede
to send data
Create custom class with [Serializable] attribute

[quoted text, click to view]
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

AddThis Social Bookmark Button