[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Re: Frustrating COM+/Remoting Service Issue

Sam Santiago

7/19/2004 4:51:00 AM

Since the stack track seems to say your exception is related to resolving
the datatype that is being past:

> at System.UnitySerializationHolder.GetRealObject(StreamingContext
context)
> at
System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHold
er holder)

I would suggest to verify your remote object is derived MarshalByRefObject
and to ensure your client has access to the metadata of your remote object
correctly for your situation. Read step#5 carefully:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconbasicremotingta...

Good luck.
--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com

"Mark" <Mark@discussions.microsoft.com> wrote in message
news:9297AD3B-2E77-4740-808A-8118F0E3C381@microsoft.com...
> I continue to get the following error:
> Insufficient state to deserialize the object. More information is needed.
>
> I have a Windows Service hosting a .NET Remoting object. The component
implements an interface (IService) and the client calls via the interface.
I am using SAO SingleCall and TCP binary formatter. When I test using a
simple .NET exe everything works fine. I get the error when hosting a
client object via COM Interop in a COM+ application. The interface and COM
Interop dlls are in the GAC. Through logging I can determine that the SAO
completes successfully with a result of about 4k, so it is definitely on the
client side that the error occurs. I started by returning a byte[], then
tried boxing that to an object, then tried using a serializable custom
object containing a byte[], all result in the error. The .NET test exe is a
simple console application that calls the remoting SAO and gets a result
using the same method as the COM Interop component, the only difference is
the COM Interop and all that goes with a COM+ app.
>
> COM+ application settings (setting: various options tried if applicable);
> Activation: Server
> Security: Access checks disabled
> Authentication Level for Calls: None, Connect, Packet
> Impersonation Level: Impersonate, Delegate
> Identity: local administrator account, 'Local System'
> Activation: Server
> Transactions: disabled
> Activation Context: Don't force..., Must be activated in the default
context
> Concurrency: Required when Activation Context = Don't force..
>
> Server Config;
> <system.runtime.remoting>
> <application name="srv">
> <service>
> <wellknown mode="SingleCall" type="MyObject, MyAssembly"
objectUri="MyObject"/>
> </service>
> <channels>
> <channel name="MyObject TCP port 49512" ref="tcp" port="49512"
bindTo="127.0.0.1">
> <serverProviders>
> <formatter ref="binary" typeFilterLevel="Full"/>
> </serverProviders>
> </channel>
> </channels>
> </application>
> </system.runtime.remoting>
>
> Interface Definition: (pseudocode)
> enum e1{..}
> enum e2{..}
> [Serializable]
> public ResultObject{public byte[] Results;}
>
> public interface IServer{
> (Various options tried)...
> byte[] Method(e1 type, string def, e2 format);
> void Method(e1 type, string def, e2 format, out byte[] results);
> ResultObject Method(e1 type, string def, e2 format);
> object Method(e1 type, string def, e2 format);
>
>
>
> COM Interop Code:
> IService s = (IService)Activator.GetObject(typeof(IService),
IReportServiceURI);
> //byte[] version
> byte[] results = s.Method(e1var, strDef, e2var);
> //byte[] out version
> byte[] results = null;
> s.Method(e1var, strDef, e2var, results);
> //object version
> byte[] results = (byte[])s.method(e1var, strDef, e2var);
> //ResultObject version
> ResultObject results = s.Method(e1var, strDef, e2var);
>
> Stack Trace:
> Server stack trace:
> at System.UnitySerializationHolder.GetRealObject(StreamingContext
context)
> at
System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHold
er holder)
> at System.Runtime.Serialization.ObjectManager.DoFixups()
> at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(Head
erHandler handler, __BinaryParser serParser, Boolean fCheck,
IMethodCallMessage methodCallMessage)
> at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(S
tream serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
> at
System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryResponseMessag
e(Stream inputStream, IMethodCallMessage reqMsg, Boolean bStrictBinding)
> at
System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessag
e(IMessage msg)
>
> Exception rethrown at [0]:
> at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
> at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
> at Reports.NET.Engine.Interfaces.IService.Method(DefinitionType
DefType, String def, Format format, Hashtable parameters)
> at RemotingComponent.Method(String sXML, String DesiredFormat, Object
Parameters)
>
>