473,322 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to serialize and object to use as a parameter in a URL?


Hi,

I need to serialize an object in such a way that it can be passed as
parameter in a URL

http://www.domain.com?object=%d793btng....

I did some reading and I came to the conclusion that I need to create a
custom formatter and implements the IFormatter interface

the problem is that I don't quit know how to implements the
IFormatter.Serialize function

1.How do I get the attribute of each property?

2.How can i get all properties,i guess I need to use reflection?

2.How do I track the object which already Serialized(assuming the object
contains other objects)

Note that I cannot use binary formatter or other,since the code which do the
deserialization is a client side java script

thanks in advance.


Nov 16 '05 #1
5 3678
Hi Julia:

Reflection would allow you to step through the public properties of
any object. The PropertyInfo class in the System.Reflection namespace
is pretty useful for getting the values of all properties:

PropertyInfo[] info = Type.GetType("System.Type").GetProperties();

Then use GetValue on each PropertyInfo to return the value of each
property as an object..

HTH,

--
Scott
http://www.OdeToCode.com
On Sun, 26 Sep 2004 09:58:04 +0200, "Julia" <co********@012.net.il>
wrote:

Hi,

I need to serialize an object in such a way that it can be passed as
parameter in a URL

http://www.domain.com?object=%d793btng....

I did some reading and I came to the conclusion that I need to create a
custom formatter and implements the IFormatter interface

the problem is that I don't quit know how to implements the
IFormatter.Serialize function

1.How do I get the attribute of each property?

2.How can i get all properties,i guess I need to use reflection?

2.How do I track the object which already Serialized(assuming the object
contains other objects)

Note that I cannot use binary formatter or other,since the code which do the
deserialization is a client side java script

thanks in advance.


Nov 16 '05 #2
Additionally, you would have to encode the output to account for
characters that are not allowed.

Personally, I would choose to use the SOAP formatter and then use a POST
to post the contents to the server. The output of any object being
serialized is quite lengthy, and not suited for placement in a URL.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:m1********************************@4ax.com...
Hi Julia:

Reflection would allow you to step through the public properties of
any object. The PropertyInfo class in the System.Reflection namespace
is pretty useful for getting the values of all properties:

PropertyInfo[] info = Type.GetType("System.Type").GetProperties();

Then use GetValue on each PropertyInfo to return the value of each
property as an object..

HTH,

--
Scott
http://www.OdeToCode.com
On Sun, 26 Sep 2004 09:58:04 +0200, "Julia" <co********@012.net.il>
wrote:

Hi,

I need to serialize an object in such a way that it can be passed as
parameter in a URL

http://www.domain.com?object=%d793btng....

I did some reading and I came to the conclusion that I need to create a
custom formatter and implements the IFormatter interface

the problem is that I don't quit know how to implements the
IFormatter.Serialize function

1.How do I get the attribute of each property?

2.How can i get all properties,i guess I need to use reflection?

2.How do I track the object which already Serialized(assuming the object
contains other objects)

Note that I cannot use binary formatter or other,since the code which do
the
deserialization is a client side java script

thanks in advance.

Nov 16 '05 #3
Thanks,i must use the URL since i am passing it using email
I am using Base64 to encode the output.
Thanks.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:el**************@TK2MSFTNGP10.phx.gbl...
Additionally, you would have to encode the output to account for
characters that are not allowed.

Personally, I would choose to use the SOAP formatter and then use a POST to post the contents to the server. The output of any object being
serialized is quite lengthy, and not suited for placement in a URL.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:m1********************************@4ax.com...
Hi Julia:

Reflection would allow you to step through the public properties of
any object. The PropertyInfo class in the System.Reflection namespace
is pretty useful for getting the values of all properties:

PropertyInfo[] info = Type.GetType("System.Type").GetProperties();

Then use GetValue on each PropertyInfo to return the value of each
property as an object..

HTH,

--
Scott
http://www.OdeToCode.com
On Sun, 26 Sep 2004 09:58:04 +0200, "Julia" <co********@012.net.il>
wrote:

Hi,

I need to serialize an object in such a way that it can be passed as
parameter in a URL

http://www.domain.com?object=%d793btng....

I did some reading and I came to the conclusion that I need to create a
custom formatter and implements the IFormatter interface

the problem is that I don't quit know how to implements the
IFormatter.Serialize function

1.How do I get the attribute of each property?

2.How can i get all properties,i guess I need to use reflection?

2.How do I track the object which already Serialized(assuming the object
contains other objects)

Note that I cannot use binary formatter or other,since the code which do
the
deserialization is a client side java script

thanks in advance.


Nov 16 '05 #4
Keep the QueryString under 255 characters...

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Julia" <co********@012.net.il> wrote in message
news:OR*************@TK2MSFTNGP14.phx.gbl...
Thanks,i must use the URL since i am passing it using email
I am using Base64 to encode the output.
Thanks.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:el**************@TK2MSFTNGP10.phx.gbl...
Additionally, you would have to encode the output to account for
characters that are not allowed.

Personally, I would choose to use the SOAP formatter and then use a

POST
to post the contents to the server. The output of any object being
serialized is quite lengthy, and not suited for placement in a URL.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:m1********************************@4ax.com...
Hi Julia:

Reflection would allow you to step through the public properties of
any object. The PropertyInfo class in the System.Reflection namespace
is pretty useful for getting the values of all properties:

PropertyInfo[] info = Type.GetType("System.Type").GetProperties();

Then use GetValue on each PropertyInfo to return the value of each
property as an object..

HTH,

--
Scott
http://www.OdeToCode.com
On Sun, 26 Sep 2004 09:58:04 +0200, "Julia" <co********@012.net.il>
wrote:

>
>Hi,
>
>I need to serialize an object in such a way that it can be passed as
>parameter in a URL
>
>http://www.domain.com?object=%d793btng....
>
>I did some reading and I came to the conclusion that I need to create a>custom formatter and implements the IFormatter interface
>
>the problem is that I don't quit know how to implements the
>IFormatter.Serialize function
>
>1.How do I get the attribute of each property?
>
>2.How can i get all properties,i guess I need to use reflection?
>
>2.How do I track the object which already Serialized(assuming the object>contains other objects)
>
>Note that I cannot use binary formatter or other,since the code which do>the
>deserialization is a client side java script
>
>thanks in advance.
>
>
>



Nov 16 '05 #5
Why?!?!

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ur**************@TK2MSFTNGP15.phx.gbl...
Keep the QueryString under 255 characters...

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Julia" <co********@012.net.il> wrote in message
news:OR*************@TK2MSFTNGP14.phx.gbl...
Thanks,i must use the URL since i am passing it using email
I am using Base64 to encode the output.
Thanks.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:el**************@TK2MSFTNGP10.phx.gbl...
Additionally, you would have to encode the output to account for
characters that are not allowed.

Personally, I would choose to use the SOAP formatter and then use a
POST
to post the contents to the server. The output of any object being
serialized is quite lengthy, and not suited for placement in a URL.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:m1********************************@4ax.com...
> Hi Julia:
>
> Reflection would allow you to step through the public properties of
> any object. The PropertyInfo class in the System.Reflection
namespace > is pretty useful for getting the values of all properties:
>
> PropertyInfo[] info = Type.GetType("System.Type").GetProperties();
>
> Then use GetValue on each PropertyInfo to return the value of each
> property as an object..
>
> HTH,
>
> --
> Scott
> http://www.OdeToCode.com
>
>
> On Sun, 26 Sep 2004 09:58:04 +0200, "Julia" <co********@012.net.il>
> wrote:
>
>>
>>Hi,
>>
>>I need to serialize an object in such a way that it can be passed as
>>parameter in a URL
>>
>>http://www.domain.com?object=%d793btng....
>>
>>I did some reading and I came to the conclusion that I need to

create a >>custom formatter and implements the IFormatter interface
>>
>>the problem is that I don't quit know how to implements the
>>IFormatter.Serialize function
>>
>>1.How do I get the attribute of each property?
>>
>>2.How can i get all properties,i guess I need to use reflection?
>>
>>2.How do I track the object which already Serialized(assuming the object >>contains other objects)
>>
>>Note that I cannot use binary formatter or other,since the code
which
do >>the
>>deserialization is a client side java script
>>
>>thanks in advance.
>>
>>
>>
>



Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James Sleeman | last post by:
Hi all, i just spent an hour rifling through code to find the cause of a problem only to find it's an oddity with serialization and recursive objects, so figured I'd post for the next person who...
5
by: Michel | last post by:
Hi there, What is the best way to serialize unknown data? I have a class that contains a list of parameter objects. The parameter has a value which can be a simple value of a complex class,...
5
by: David Sworder | last post by:
Hi, I've created a UserControl-derived class called MyUserControl that is able to persist and subsequently reload its state. It exposes two methods as follows: public void Serialize(Stream...
5
by: andrewcw | last post by:
I have an object to serialize. TextWriter writer = new StreamWriter("test.xml"); serializer.Serialize(writer,obj); writer.Close(); but below does not, why ?? I have a file that I will have...
1
by: Roberto Carriquiry | last post by:
I am writeing a webService that needs to recieve a CDO.Person object as a parameter. but when I run it I have a runtime error. Cannot serialize member CDO.PersonClass.DataSource of type...
5
by: Julia | last post by:
Hi, I need to serialize an object in such a way that it can be passed as parameter in a URL http://www.domain.com?object=%d793btng.... I did some reading and I came to the conclusion that I...
5
by: Brad | last post by:
I would like to serialize an arraylist of objects to xml so I can store the xml in a database column. How would I code the serializing and deserializing? Below is a (overly) simple, incomplete...
4
by: Hone | last post by:
I'm trying to serialize/deserialize the XML for an RSS 1.0 Feed (i.e. RDF) and the root element, as required by the standard, looks like this: <rdf:RDF ...> </rdf:RDF> However, I've tried...
3
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I am using dotnet remoting with a binarry formatter. I have a property that returns a memorystream that has had a file loaded into it. When I try to access this property though I get an...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.