C# - Ensure That The Serialization And Deserialization With WebServices Is Symmetric?

Nov 27, 2010

I have a couple of standard ASP.NET web methods that I'm calling from javascript with a parameter that is of a custom class in form

[DataContract]
[KnownType(typeof(MyOtherSubclass))]
public class MyClass

[code]...

View 1 Replies


Similar Messages:

C# - Use Symmetric Key To Encrypt Connection String

Mar 17, 2011

How To Use Symmetric Key To Encrypt Connection String in Web.config file And What the Code for doing that (with libraries)

View 3 Replies

Security :: Delete Encrypted Certificate Or Symmetric Key And Re Add?

Mar 24, 2010

i'm having a problem with symmetric key and certificate. the issue is, this database i'm using now is restored from a different source and ever since, i've been having problem regarding the symmetric key or certificate the error message i'd get from the aspx web pages would be "Please create a master key in the database or open the master key in the session before performing this operation" yes i did open the master key

[Code]....

View 1 Replies

Serialization In WCF Using JQuery?

Apr 26, 2010

is it possible to use WCF classes with attributes (like [DataMember....) then you wouldnt need to do seralization on the client side (jquery) ?

View 1 Replies

MVC :: Can DataAnnotations Persist Through Serialization

May 24, 2010

I am using business objects that are accessed via webservices. These objects can be loaded via the webservice and serialized to my mvc app. The mvc app can get a web reference to the objects and they can be utilized in the mvc app. However, the business objects are where the classes are defined, and where the annotations are applied.

The mvc validation seems to have no idea that there are System.ComponentModel.DataAnnotations attributes applied to this business object class.

1) Are DataAnnotations lost when objects are serialized / deserialized?

2) If in mvc I use a view model approach, and have nested objects (which themselves have public properties - decorated with DataAnnotations) can/will the mvc validation system traverse the entire object model, the model being used for my view? (so it can see DataAnnotations attributes of the nested object)?

View 1 Replies

AJAX :: .Net 3.5 JSON And WCF Serialization?

Feb 12, 2010

I'm trying some WCF ajax.net 3.5 out for the first time, and I'm having some difficulties. I have a WCF Service which I have connected to in my aspx page using <asp:ScriptManager>. I have a custom object which has been decorated as a [DataContract]. I'm calling the object from javascript successfully, I can see the JSON response in FireBug, but Sys.Serialization.JavaScriptSerializer.deserialize() chokes on it. I'm sure I'm making a noob mistake, but I used up all my patience getting the Web.Config values right for running the WCF service.

Here's a mockup of what I'm doing.

[Code]....

View 3 Replies

WCF And Json / Wrong Serialization

Feb 2, 2010

Why this WCF 3.5 method

[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Json
{
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json)]
public string Upper(string text)
{
return text.ToUpper();
}
}

returns {"d":"TEXT"} ?
It should returns {"TEXT"}
I'm calling using jQuery.
$("#upper").click(function() {
$.ajax({
type: "GET",
url: "/Json.svc/Upper?text="+$("#input1").val(),
success: function(data) {
$("#input1").val(data.d);
}
});
});

View 2 Replies

Ensure That A Sub Doesn't Be Used By Two Clients?

Feb 16, 2010

how can we ensure that a sub,it is not be used by two or more clients??

View 21 Replies

Ensure Javascript Is Loaded Once Only?

Jan 6, 2010

I've been working in asp.net webforms and I've been making a UserControl that depends on a small bit of javascript which is in an external file.

I want to be able to put a reference to the javascript inside the UserControl to ensure that it gets loaded on the page, but the problem is that the UserControl can appear multiple times on a page so I only want the script to be loaded with the first instance of the UserControl.

Is there an easy way to do this in ASP.NET Webforms?

View 3 Replies

VS 2005 What Is Data Compression Or Serialization

May 22, 2010

I had an interview Thursday and one questions that I was asked in the technical interview was a little confusing.

First, he asked me about Viewstate and I explained to him what all that entailed.

He then asked me what happens if the data you are putting into the Viewstate gets to big.

I told him you could then use Sessions or start storing things in the Database.

He said, what about Data Compression? I immediately responded by saying, yes you can use Serialization/Deserialization to store/retrieve the data (i'm using that in my open source project).

When he says "Data Compression", is he talking about "Serialization" or is this something different?

View 9 Replies

Serialization Newbie Options In A Web Config

Jan 19, 2011

Code:
public class GroupInfo
{
private List<Structure> _sectors = new List<Structure>();
[XmlElement("Sector")]
public List<Structure> Sectors
{ get; set; }
[XmlElement("Person")]
public List<Users> Person
{ get; set; }
[code]...

View 10 Replies

C# - Validate Xml Code File Though + Use XML Serialization?

Jan 21, 2010

I want users to be able to export data as an XML file. Of course I want them to be able to later on import that same XML file however they always could change it or it could be a different XML file. So I want to validate the XML file to check if it is in the format that I expect. So I guess I would need something like a schema to check just that it has to be through code. So if I expect

<Root>
<Something>
<SomethingElse> </SomethingElse>
</Something>
</Root>

I don't want some other format to be in the file other then the one I expect. Also how would I validate fields? Like say I require that there must be some text in between tags. If it is blank the file is not valid. So how could I do this?

I decided to use XML serialization so I know it will through an exception if it is the wrong format and ignore stuff that does not work. However I am not sure should I just go through it and C# to validate each of the records or should I try to make an xml schema to do it. If I would want to do it through an xml schema with xml serialization how would that work? Like Do I first do something like I seen in the responses then de serialize it? Or how would I do it?

View 5 Replies

What Is Meant Of Serialization Mode In LINQ To SQL

Apr 19, 2010

what is means of serialization mode in LINQ to SQL?

what architecture does LINQ to SQL uses internally (connected or disconnected architecture)?

View 1 Replies

C# - Bypass Non Serializable Properties When Going About Serialization

Nov 12, 2010

I follow the code snippet to calculate Session size. Profile Memory Usage of Session State ASP.Net My problem is some properties of objects aren't marked as Serializable so I cannot apply the solution. Can I just bypass non-serializable properties?

View 1 Replies

WCF / ASMX :: Encrypted Serialization As Good As SSL?

Feb 14, 2011

I am having a lot of trouble with WCF web service over SSL / HTTPS, so I was wondering if (as a quick fix) I could serialize the object, convert that to a byte array, encrypt the array, pass the encrypted array.

On the other side receive the encrypted array, decrypt the array, convert from the array and then deserialize the object.

View 1 Replies

C# - Exclude An Object During Serialization In XmlSerialize?

Mar 7, 2011

I'm attempting to serialize an object but I would like to exclude one of the objects inside it. I've tried [NonSerialized] and it is still attempting to serialize it when I call XmlSerialize on a Cart object.

[Serializable]
[XmlRoot("Cart")]
public class Cart : ICart
{
// Public Properties
[DefaultValue("")]
public string ID { set; get; }
[XmlIgnore()]
[NonSerialized]
public CartSerializer Serializer = new CartSerializer(this);
}

View 1 Replies

Rename The Property In Json Serialization?

Jul 16, 2010

in Json.net we can rename the property with [JsonPropertyAttribute("")] ,

public class Foo
{
// how can I rename the Foo1 property name to F1?!
public string Foo1 { set; get; }
public string Foo2 { set; get; }
}

and in the web service code behind :

[WebMethod]
public List<Foo> GetFoos()
{
List<Foo> post = new List<Foo>
{
new Foo(),
new Foo(),
new Foo()
};
return post;
}

View 1 Replies

Purpose Of The PropertySpecified Pattern Used By XML Serialization?

Mar 10, 2010

What is the purpose of the PropertySpecified pattern used by XML Serialization ?

View 1 Replies

C# - SOAP Generic Type Serialization?

Apr 4, 2011

We have created a class to wrap the payload of web service response with common information as follows.

public class ItemResponse<T> : Response
{
/// <summary>

[code]...

View 2 Replies

JSON Serialization Of C# Enum As String?

Mar 14, 2010

I have a class that contains an enum property, and upon serializing the object using JavaScriptSerializer, my json result contains the integer value of the enumeration rather than its string "name". Is there a way to get the enum as a string in my json without having to create a custom JavaScriptConverter? Perhaps there's an attribute that I could decorate the enum definition, or object property, with?As an example:

enum Gender { Male, Female }
class Person
{

[code]...

View 2 Replies

How To Ensure Only One Checkbox Is Ticked All The Time

Mar 23, 2010

I am doing a survey. so basically, i will send out an email with a unique link and the person clicks the link which directs them to my aspx page. that controls i use will be bound to a datatable.

first I will need to show their existing home and email address in a control.

then i will give them 4 checkbox's to tick a certain option. also, how can I ensure only one checkbox is ticked all the time?

I will need the checkboxes to be bound as well, to show the options they chose incase they load the page again after saving.

View 18 Replies

C# - Ensure No Implicit Culture Settings Are Used?

Mar 24, 2011

I have some classes which can't make assumptions about de used culture. These classes should always use CultureInfo.InvariantCulture. However, I can't set the thread's current culture to CultureInfo.InvariantCulture, because other classes rely on <globalization culture="auto".

Is there a way to ensure some classes always use explicit culture method calls (like: Convert.ToDecimal(value, CultureInfo.InvariantCulture)) instead of assumed culture (like: Convert.ToDecimal(value)).Maybe my question it's not 100% clear: I'd like to detect all methods which have an overload which uses CultureInfo, but also one without the CultureInfo which uses the CurrentCulture.This includes implicit casts of numbers to string:

decimal value = 1.0;
string displayThis = string.Format("Costs: {0}", value);

The goal is to make sure some classes/methods don't assume anything about CultureInfo.

View 2 Replies

State Management :: Make Serialization For Object

Feb 18, 2011

I have code :

[Code]....

Is it right?

View 4 Replies

C# SessionState Mode SQLServer Serialization With Protobuf-net?

Feb 12, 2011

I have been thinking of ways to optimize the out of state storage of sessions within SQL server and a few I ran across are:

Disable session state on pages that do not require the session. Also, use read-only on pages that are not writing to the session.

In ASP.NET 4.0 use gzip compression option.

Try to keep the amount of data stored in the session to a minimum.

Right now, I have a single object (a class called SessionObject) stored in the session. The good news is, is that it is completely serializable.

Optimizing using protobuf-net An additional way I thought might be a good way to optimize the storage of sessions would be to use protocol buffers (protobuf-net) serialization/deserialization instead of the standard BinaryFormatter. I understand I could have all of my objects inherit ISerializable, but I'd like to not create DTO's or clutter up my Domain layer with serialize/deserialize logic.

View 1 Replies

WCF / ASMX :: Serialization - Can't See Service Reference In Code

Jan 19, 2011

Thing is, when my service is providing result of type string my client .aspx page is working fine and it gives reference in my code. But now I changed my service to provide custom data type and I can't see service reference in my code, intellisense doesn't offer it at all. What am I missing here? WCFTestClient.exe is giving good results but I can't create my own in VS 2008

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved