[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.remoting

How do I remote an array of objects?

=?Utf-8?B?cm9kY2hhcg==?=

7/15/2004 1:18:00 PM

I need to send a collection\array of values from my
client to my remote server (hosted by IIS). I have tried
an array of Objects and an ArrayList. Neither will
remote. What type can I use to send an array of 'other
types' (string, datetime, decimal)?
8 Answers

Sunny

7/15/2004 2:33:00 PM

0

Hi Greg,

array of object should work. Make sure that the objects you have in the
array are all [Serializable], otherwise the serialization will fail.

Btw, what you mean by "neither will remote"? Please, post the error you
receive.

Sunny


In article <2d98901c46a6e$358e1fb0$a501280a@phx.gbl>,
anonymous@discussions.microsoft.com says...
> I need to send a collection\array of values from my
> client to my remote server (hosted by IIS). I have tried
> an array of Objects and an ArrayList. Neither will
> remote. What type can I use to send an array of ''other
> types'' (string, datetime, decimal)?
>

Greg

7/15/2004 2:59:00 PM

0

The types in the collection, or array, are
System.String

System.DateTime

System.Decimal

System.Byte[]

"Greg" <anonymous@discussions.microsoft.com> wrote in message
news:2d98901c46a6e$358e1fb0$a501280a@phx.gbl...
> I need to send a collection\array of values from my
> client to my remote server (hosted by IIS). I have tried
> an array of Objects and an ArrayList. Neither will
> remote. What type can I use to send an array of ''other
> types'' (string, datetime, decimal)?


Greg

7/15/2004 3:48:00 PM

0

My object array contains the following types:

System.String

System.DateTime

System.Decimal

System.Byte[]

The exception is a general remoting exception.

"Sunny" <sunny@newsgroups.nospam> wrote in message
news:OXgeZinaEHA.1656@TK2MSFTNGP09.phx.gbl...
> Hi Greg,
>
> array of object should work. Make sure that the objects you have in the
> array are all [Serializable], otherwise the serialization will fail.
>
> Btw, what you mean by "neither will remote"? Please, post the error you
> receive.
>
> Sunny
>
>
> In article <2d98901c46a6e$358e1fb0$a501280a@phx.gbl>,
> anonymous@discussions.microsoft.com says...
> > I need to send a collection\array of values from my
> > client to my remote server (hosted by IIS). I have tried
> > an array of Objects and an ArrayList. Neither will
> > remote. What type can I use to send an array of ''other
> > types'' (string, datetime, decimal)?
> >


Sunny

7/15/2004 3:54:00 PM

0

Still I do not see your error message.

In article <#K9jUxnaEHA.1000@TK2MSFTNGP12.phx.gbl>, greg@cds-am.net
says...
> The types in the collection, or array, are
> System.String
>
> System.DateTime
>
> System.Decimal
>
> System.Byte[]
>
> "Greg" <anonymous@discussions.microsoft.com> wrote in message
> news:2d98901c46a6e$358e1fb0$a501280a@phx.gbl...
> > I need to send a collection\array of values from my
> > client to my remote server (hosted by IIS). I have tried
> > an array of Objects and an ArrayList. Neither will
> > remote. What type can I use to send an array of ''other
> > types'' (string, datetime, decimal)?
>
>
>

Greg

7/15/2004 4:01:00 PM

0

System.Runtime.Remoting.RemotingException

Message: Server encountered an internal error. For more information, turn on
customErrors in the server''s .config file.

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)

Here is the signature for the remoted method:

Public Overloads Function UpdateDataset(ByVal dsChanges As DataSet, _

ByVal transaction As SqlTransaction, _

ByVal spName As String, _

ByVal buildParamValues As Boolean, _

ByVal tableName As String) _

As DataSet

The 6th param used to be an array of objects. I have removed for testing.
I still get the same remoting exception though.



"Sunny" <sunny@newsgroups.nospam> wrote in message
news:uQFHoPoaEHA.2016@TK2MSFTNGP09.phx.gbl...
> Still I do not see your error message.
>
> In article <#K9jUxnaEHA.1000@TK2MSFTNGP12.phx.gbl>, greg@cds-am.net
> says...
> > The types in the collection, or array, are
> > System.String
> >
> > System.DateTime
> >
> > System.Decimal
> >
> > System.Byte[]
> >
> > "Greg" <anonymous@discussions.microsoft.com> wrote in message
> > news:2d98901c46a6e$358e1fb0$a501280a@phx.gbl...
> > > I need to send a collection\array of values from my
> > > client to my remote server (hosted by IIS). I have tried
> > > an array of Objects and an ArrayList. Neither will
> > > remote. What type can I use to send an array of ''other
> > > types'' (string, datetime, decimal)?
> >
> >
> >


Greg

7/15/2004 4:42:00 PM

0

well, I removed the SqlTransaction param on the remote server and it worked.

So, it seems you cannot send a SqlTransaction to a Remote Server? Why not?


"Greg Robinson" <greg@cds-am.net> wrote in message
news:e$qy$ToaEHA.644@tk2msftngp13.phx.gbl...
> System.Runtime.Remoting.RemotingException
>
> Message: Server encountered an internal error. For more information, turn
on
> customErrors in the server''s .config file.
>
> 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)
>
> Here is the signature for the remoted method:
>
> Public Overloads Function UpdateDataset(ByVal dsChanges As DataSet, _
>
> ByVal transaction As SqlTransaction, _
>
> ByVal spName As String, _
>
> ByVal buildParamValues As Boolean, _
>
> ByVal tableName As String) _
>
> As DataSet
>
> The 6th param used to be an array of objects. I have removed for testing.
> I still get the same remoting exception though.
>
>
>
> "Sunny" <sunny@newsgroups.nospam> wrote in message
> news:uQFHoPoaEHA.2016@TK2MSFTNGP09.phx.gbl...
> > Still I do not see your error message.
> >
> > In article <#K9jUxnaEHA.1000@TK2MSFTNGP12.phx.gbl>, greg@cds-am.net
> > says...
> > > The types in the collection, or array, are
> > > System.String
> > >
> > > System.DateTime
> > >
> > > System.Decimal
> > >
> > > System.Byte[]
> > >
> > > "Greg" <anonymous@discussions.microsoft.com> wrote in message
> > > news:2d98901c46a6e$358e1fb0$a501280a@phx.gbl...
> > > > I need to send a collection\array of values from my
> > > > client to my remote server (hosted by IIS). I have tried
> > > > an array of Objects and an ArrayList. Neither will
> > > > remote. What type can I use to send an array of ''other
> > > > types'' (string, datetime, decimal)?
> > >
> > >
> > >
>
>


Sunny

7/15/2004 4:48:00 PM

0

Hi Greg,

please, turn on customErrors at the server, so you receive the full
exception.

Also, there are some problems with datasets via remoting. But there is
easy workaround, which works for me. DataSets are always serialized to
XML, both with binary and SOAP formatters. So what you can do is to use
DataSet''s write to xml capability, and pass that xml string over
remoting. On the other side, just reconstruct the DataSet from the
string.

Sunny

In article <e$qy$ToaEHA.644@tk2msftngp13.phx.gbl>, greg@cds-am.net
says...
> System.Runtime.Remoting.RemotingException
>
> Message: Server encountered an internal error. For more information, turn on
> customErrors in the server''s .config file.
>
> 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)
>
> Here is the signature for the remoted method:
>
> Public Overloads Function UpdateDataset(ByVal dsChanges As DataSet, _
>
> ByVal transaction As SqlTransaction, _
>
> ByVal spName As String, _
>
> ByVal buildParamValues As Boolean, _
>
> ByVal tableName As String) _
>
> As DataSet
>
> The 6th param used to be an array of objects. I have removed for testing.
> I still get the same remoting exception though.
>
>
>
> "Sunny" <sunny@newsgroups.nospam> wrote in message
> news:uQFHoPoaEHA.2016@TK2MSFTNGP09.phx.gbl...
> > Still I do not see your error message.
> >
> > In article <#K9jUxnaEHA.1000@TK2MSFTNGP12.phx.gbl>, greg@cds-am.net
> > says...
> > > The types in the collection, or array, are
> > > System.String
> > >
> > > System.DateTime
> > >
> > > System.Decimal
> > >
> > > System.Byte[]
> > >
> > > "Greg" <anonymous@discussions.microsoft.com> wrote in message
> > > news:2d98901c46a6e$358e1fb0$a501280a@phx.gbl...
> > > > I need to send a collection\array of values from my
> > > > client to my remote server (hosted by IIS). I have tried
> > > > an array of Objects and an ArrayList. Neither will
> > > > remote. What type can I use to send an array of ''other
> > > > types'' (string, datetime, decimal)?
> > >
> > >
> > >
>
>
>

Sunny

7/15/2004 6:43:00 PM

0


In article <uuNXZqoaEHA.2260@TK2MSFTNGP10.phx.gbl>, greg@cds-am.net
says...
> well, I removed the SqlTransaction param on the remote server and it worked.
>
> So, it seems you cannot send a SqlTransaction to a Remote Server? Why not?
>
>

You can.

The problem is somewere else.

If you can be so kind to answer to my other post, and to provide the
full error, noone can help. Also, how do you register the channels at
server and at the client?

Sunny