BizTalk Utilities CV ,   Jobs ,   Code library
 
Go to the front page to continue learning about XML or select below:

Contents

ReBlogger Contents

 
WSE
SOA
XML

 
 
Buzz index BUZZ INDEX : xmlserializer
 
Buzz index

XmlSerializer

What is .NET XmlSerializer?
Tags found in the posts on this page : Binary XML Search for Binary XML on Wikipedia.Search for Binary XML on Technorati | base64 Search for base64 on Wikipedia.Search for base64 on Technorati | XmlSerializer Search for XmlSerializer on Wikipedia.Search for XmlSerializer on Technorati
Page 1 of 4

2009 Mar 17

1 of 186 | Screencast: Processing message content with HttpClient - I recently published a new screencast video on Processing message content with HttpClient.  Check out this post for more background.   This screencast shows you how to process different types of messages that you might get back from RESTful services on the Web. It shows how to use XLinq, DataContractSerializer, and XmlSerializer, and it shows how to process XML, Atom, and JSON messages. Check out our growing collection of free .NET screencasts and videos.  You can subscribe to the Pluralsight feed to be notified when new screencasts are published.  In addition, check out our growing library of Pluralsight On-Demand! training courses....

2009 Mar 16

2 of 186 | WCF REST Starter Kit: Paste XML as Types - One of the things people often complain about when building REST clients is the lack of proxy generation support. Although to be fair, it's usually only heard from those coming from a SOAP/WSDL background (some would argue it's completely unnecessary). Achieving this typically requires support for a metadata language like WADL or WSDL 2.0, which are not yet widely supported nor considered standards. The WCF REST Starter Kit Preview 2 provides a nice solution to this dilemma for .NET developers.  They provide a new HttpClient API that provides generic support for the uniform HTTP interface (Get, Post, Put, Delete, Head, etc) that can be used to process a variety of common resour......

2009 Feb 20

3 of 186 | How to create a certificate request with CertEnroll (ASP) - Hi all, The other day I posted a Javascript sample which shows how to use CertEnroll COM component to create a certificate request and install the response from the CA (Certificate Authority): How to create a certificate request with CertEnroll (JavaScript). The installation part of that sample assumed that we got a Base64 text with the response from the CA. But what if we i.e. send the request to a server, the server gets a .p7b or .cer binary file with the response from the CA, and we want to install the response on the client who requested the cert on the first place? The following ASP sample shows how to install on the client the .p7b/.cer binary file that the server got with t......

4 of 186 | Internet Explorer 8 ?? - ? ?? Internet Explorer ?? ? ??? (??)? ?? ?????. ? ?? ??? ??? Internet Explorer ?? ? ??? (??)? ??? ??? ????, ??? ???? ??? ???? ?? ????. ? ?? ??? ??? ??? ?? ??? ??? ???. ?, ? ? ?? ???? Internet Explorer ?? ? ??? (??)? ??? ?? ? ? ? ????. ?? ??? Internet Explorer ?? ? ??? (??)? ??????. ?? : IE8 Performance (??) ???? ??: 2008 ? 8 ? 26 ?   ?????, Internet Explorer 8 ?? ??? ???? ?? Christian Stockwell ???. ??  ? ???? ??? ??? ???? ??? ???? ??? ???, ????? ? ?????? ?? ??? ???, ??? ????? ?? ?? ? ??????? ????. ??? ??? ?? ??  ?? ?? ?? ??? ?????, ???? ????? ??? ? ????. ? ?? Internet Explorer ? ?? ??? ?????? ?? ??? ???? ?? ???,  Internet Explorer 8 ? ? ??? ??? ???? ??......

2009 Feb 07

5 of 186 | Passing Objects via the Azure Message Queue - I have recently been taking a look at Windows Azure Storage, and the use of Blob’s, Queues and Tables. Queues are primarily used for passing small (approx 8kb) messages from the web role of a Azure application to the back end worker role that can then be used to fire off additional processing within the cloud. Using the current StorageClient library that is supplied with the CTP of Azure you can only pass strings as messages from a web role to a worker role by doing the following: 1: Message message = new Message("simple text"); 2: RoleManager.WriteToLog("Information", string.Format("Message '{0}' added to the queue", message.ContentAsSt......

2009 Feb 02

6 of 186 | Boost performance with Pre-generated XmlSerializers - Creating an XmlSerializer has a well-known performance cost since .net will generate a temporary helper assembly which requires a compiler call. Additionally, the assembly cannot be unloaded without unloading the hosting application domain causing high memory usage when several XmlSerializer objects are constructed. Sometimes this assembly-generating process happens in a more indirect manner like the instantiation of a web service proxy class. For example, calling new CrmService() will require an XmlSerializer for the type CrmService which forces .net to generate code, compile and load the assembly. Fortunately, there are alternatives to improve performance and minimize memory usage when c......

2009 Jan 30

7 of 186 | Funq: applying TDD to build a dependency injection container you can understand - I'm planning to record a series of screencasts which will serve as walk-throughs on how to apply TDD on a practical project consisting in building a full-featured and high-performance DI container which has two very explicit goal: minimalistic design and small footprint. Both goals come from the requirements of the project I'm building this for: the upcoming version of the patterns & practices Mobile Client Software Factory. As I've tweeted in the past, the Compact Framework and constrained execution environment of a mobile device, place some requirements on anything you do there, but specially for something which can have a broad impact in performance as a DI container, which typically......

2009 Jan 29

8 of 186 | ConfigSectionHandler for Hierarchical configs - Here is a quick way to create a ConfigSection Handler for reading Hierarchical configs. For e.g. suppose you need to read a config file which has the following structure: 1: <MainConfig> 2: <Company>MySpace</Company> 3: <SubConfig> 4: <ID>23</ID> 5: <Name>Rohit</Name> 6: <LastName>Gupta</LastName> 7: </SubConfig> 8: </MainConfig> For this you would create the 2 classes, one for the Parent Config and another for the child config like this: 1: [XmlRoot("MainConfig")] 2: ......

2009 Jan 19

9 of 186 | BitTorrent in the Browser - Opera does it. Others talk about it. Robert Accettura posts about how he thinks we should implement BitTorrent in the browser. He doesn't want a X-Torrent HTTP header as we can use Accept-Encoding for the same goal. How would it work? Assume my browser supports the BitTorrent protocol and I visit the following URL for a download: http://dl.robert.accettura.com/pub/myfile.tar.gz My request would look something like this: Get: /pub/myfile.tar.gz Host: dl.robert.accettura.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 Accept: */* Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate,torrent Accept-Charset: ISO-8859-1,utf-8;q=......

2008 Dec 12

10 of 186 | XmlSerializerFactory caching issues and leaks - You'd think that after the serious leaks people was hitting with the XmlSerializer, the "new" (in .NET 2.0!!! but which many seem to forget about, just like AVOID doing new XmlTextReader in a PDC *keynote*) XmlSerializerFactory would do away with those. Well, bad news: you need to be AS careful as you are with the XmlSerializer in order to avoid those leaks (which are BY DESIGN, BTW). Turns out that apparently the same designer made the same "by design" decisions with the XmlSerializerFactory. For those not using the factory yet: it was basically meant to be the cache of XmlSerializer types that you had to do manually in the past). If provides a factory method with all the same overloads t......

2008 Dec 11

11 of 186 | Accessing Azure storage with Raw REST API - Accessing Azure storage with Raw REST API Sergei Meleshchuk - blog  Contents Introduction. 1 Example. 2 Client code: read a message from a queue. 2 Missing parts. 3 QueueBase. 3 ServiceEndpoint. 3 BuildSignature. 3 BuildUri 4 BuildRequest. 4 ExecuteRequest. 4 DecodeMessages. 5 CurrentMessageList. 6 MessageBase. 6     Introduction Azure SDK defines [Raw] REST API, and supplies a client library which isolates a developer from REST API. The client library is a good thing. Sometimes, however, you may want much thinner layer (than the client library) on top of REST API. The reasons include: -          You want to ......

2008 Dec 10

12 of 186 | Fault Serialization with XmlSerializer - About 20 posts ago, back before PDC, this was the next topic in the queue to be posted. It has been somewhat delayed by all of the talk of product announcements and details about future releases. Since it was becoming lonely and forgotten I thought I'd get back onto talking about the product that you're actually using. I think I'm going to keep the style of not linking continuity between posts. No one complained when the forward references went away and it seems to make the posting schedule a bit more flexible to accommodate announcements and current events. I'm using XmlSerializer for my messages but when I send a fault by throwing a FaultException, the fault exception detail gets......

2008 Nov 21

13 of 186 | New additions in 3.5 Sp1 - In .NET 3.5 SP1 the following features are added to the DataContractSerializer. 1. Support for POCO types. Aaron has a nice writeup here. I have updated my post on Serialization Rules to include this. 2. Support for get-only collection properties. 3. Support for schema-verifiable multiple object reference (i.e using the same instance of an object in two places) Another new feature worth mentioning is the support of XmlSerializer for serialization of faults. I will write more about each of these features in the near future....

2008 Nov 14

14 of 186 | The $64 String... - With apologies to the game show... I was working on a cryptography project, and, without going into detail (it's SECRET, duh), I was having some issues. The other party sent me their test key in a text file, and it was Base64 encoded. Naturally, being the smart id10t that I am, I popped open my handy dandy, Base64 decoder site, decoded the string, and placed the string in the proper location for it to be used in the decoding process. Lo and behold the decryption process broke...because the key was too small! In my investigation, it turns out that decoding it by any means other than Convert.FromBase64String() resulted in a byte array with only 31 bytes. Since a 256-bit key requires a 32-......

15 of 186 | XmlSerializerFactory caching issues and leaks - You'd think that after the serious leaks people was hitting with the XmlSerializer, the "new" (in .NET 2.0!!! but which many seem to forget about, just like AVOID doing new XmlTextReader in a PDC *keynote*) XmlSerializerFactory would do away with those. Well, bad news: you need to be AS careful as you are with the XmlSerializer in order to avoid those leaks (which are BY DESIGN, BTW). Turns out that apparently the same designer made the same "by design" decisions with the XmlSerializerFactory. For those not using the factory yet: it was basically meant to be the cache of XmlSerializer types that you had to do manually in the past). If provides a factory method with all the same overloads t......

2008 Nov 10

16 of 186 | NAV 2009 and Unicode! - The title might be a bit misleading, but I am writing this post as a response to a problem, which a partner ran into with NAV 2009 - and the problem is caused by Unicode. I am not a Unicode expert, so bare with me if I am naming some things wrong. As you know, NAV 2009 is a 3T architecture and the Service Tier is 95% managed code (only the lower pieces of the data stack is still unmanaged code). You probably also know, that managed code supports Unicode natively - in fact a string in C# or VB.Net is by default a Unicode string. In C# you use byte[] if you need to work with binary data. My earlier post about transferring binary data between the Service Tier and Client Side COM or Web Servi......

2008 Oct 19

17 of 186 | Binary XML (EXI) Last Call - On September 19, the W3C published the Last Call Working Draft for Efficient XML Interchange (EXI) -- which allows XML-based implementations to exchange documents without having to use XML's verbose syntax. ...

2008 Oct 17

18 of 186 | What happened to the WPD data in the thing type with HVCC V2? - In the latest version of HealthVault Connection center, we have optimized the size of the data being sent from the device to the HealthVault platform.  The WPD data is being stored in the "other-data" section. This content is in a zipped-base64 package that can be acessed with some additional work.  Below is sample code that is able to access the WPD content.         /// <summary>         /// The sample function demonstrating how to get WPD data from items uploaded to HealthVault          /// by v1.x (old behavior) and by v 2.x client (new behavior).         ......

2008 Oct 04

19 of 186 | Serializing internal types using XmlSerializer - Being able to serialize internal types is one of the common requests seen by the XmlSerializer team. It is a reasonable request from people shipping libraries. They do not want to make the XmlSerializer types public just for the sake of the serializer. I recently moved from the team that wrote the XmlSerializer to a team that consumes XmlSerializer. When I came across a similar request I said, "No way. Use DataContractSerializer".   The reason is simple. XmlSerializer works by generating code. The generated code lives in a dynamically generated  assembly and needs to access the types being serialized. Since XmlSerializer was developed in a time before the advent of lightweight ......

2008 Oct 01

20 of 186 | XMLSerializer, XDocument and LINQ - I took the sample from my previous post and wanted to use LINQ to query the XML. You can pretty much use the power of SQL on the document object to richly query for things you are looking for.   using System; using System.Linq; using System.Xml.Linq; using System.Collections.Generic; using System.Xml; using System.Xml.Serialization; using System.IO;   namespace Sample {     public class Company     {         List<Book> books;           [XmlElement(ElementName = "Book")]         public List<Book> Books   ......

2008 Sep 27

21 of 186 | WMRM SDK 10.1.2 best practice sample code - I wrote this sample code a while back to show how to validate the latest individualization version when using predelivery. Here are a few tricks that you need to do to make this work. Namely, you need to parse the “ClientInfo” XML fragment the hard way. This sample code shows you how to do just that. The documentation below is a complete walkthrough of the code but the code is also well documented. This is a great place to start if you are trying to do WM DRM predelivery form ASP.net. Keep in mind that this code will only work with the WMRM SDK version 10.1.2 or better. Older versions of the SDK may not work as expected. If you have an older version of the SDK you may need to modify the cod......

2008 Sep 04

22 of 186 | Getting Better Time Formats - Orcas introduced a new DateTimeOffset class that is easier to use for representing absolute times than the original DateTime class. However, if you run svcutil on a contract that contains a DateTimeOffset, you'll get an ugly generated structure because DateTimeOffset isn’t recognized as a natively supported type by the system. A new class is generated by svcutil to match the schema for DateTimeOffset in the metadata. namespace System { using System.Runtime.Serialization; [DebuggerStepThroughAttribute()] [GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")] [DataContractAttribute(Name="DateTimeOffset", Namespace="http://schemas.datacontract.org/2......

2008 Sep 02

23 of 186 | Serialize an Object Instance to XML - To serialize an object instance to XML, you need to use the XMLSerializer Class's Serialize method....

2008 Aug 29

24 of 186 | PowerShell – Base64 Encode/Decode a string - An easy way to convert data to/from base64 (or uuencode/uudecode, quoted-printable, url encode/url decode, JIS, Yenc, hex, or even creating md5 or sha1 hashes) is to use the NetCmdlets convert-data cmdlet. To encode: PS C:\> convert-data -data "Hello, World!" -to base64 Data Size Format ---- ---- ------ SGVsbG8sIFdvcmxkIQ== 20 base64 To decode: PS C:\> convert-data -data $encoded.Data data -from base64 Data Size Format ---- ......

25 of 186 | XFDF XML mit C# und einem Schema validieren ... -   In meinen letzten Blogseintrag "XFDF Felder mit C# lesen ..." habe ich über meine ersten Erfahrungen mit XFDF berichtet. Das Projekt schreitet voran und ich habe noch einige interessante Dinge XFDF mit .NET und Visual Studio 2008 zu berichten. Um die eingegangen XML XFDF Daten sinnvoll zu verarbeiten, wollte ich  mit folgendem Code die XML Daten mit dem offiziellen XSD Schema von Adobes Website  validieren.              try             {                 // Create a schema set......

26 of 186 | XmlSerialization to generate and consume XML - I want to talk about Xml Serialization this month. One of the work I was involved in recently required generation of XML and a I came across this wonderful technology which helps you generate and consume XML seamlessly.   If you are generating XML in a clumsy way using printf containing the XML tags, I would strongly suggest you to look into this technology. Incidetaly this plays well with Linq too. The XML after it is loaded into the object can be parsed with Linq queries. I will write a sample for that soon.     using System; using System.Collections.Generic; using System.Xml; using System.Xml.Serialization;   namespace Sample {     public cl......

2008 Aug 28

27 of 186 | Serialization using XElements - Introduction I recently starting fooling around with the new XML LinQ stuff in .Net, and it is very impressive. One thing that I found missing was the ability to serialize objects directly into XElements. However, Microsoft did provide the means to get me to hit the ground running and it took a couple of minutes for me to get it right. Readers and Writers One thing the classical .Net XML always lacked was an "XmlNodeWriter", a writer that basically allows you to create DOM XML nodes using a standard XmlWriter. There are several implementations, but they can only insert nodes into a document (or a node within that document). Microsoft has now filled that gap with the XNode.CreateReader()......

2008 Aug 25

28 of 186 | XFDF Felder mi C# lesen ... - Adobe Forms Dokumente werden in verschiedenen Anwendungsfällen verwendet und es ist nicht unwahrscheinlich, dass man in einer Anwendung Daten aus solch einem Dokument übernehmen muss. Adobe Forms können ihre Daten als FDF oder XFDF exportieren. Zum FDF Format gibt es ein Software SDK von Adobe. Liegen die Formsdaten als XFDF (= XML Forms Data Format) vor kann man die Daten mit Standard .NET Mitteln aus dem .XFDF File lesen, da es sich um eine XML Datei handelt. Die Grundstruktur jedes .XFDF Files sieht so aus und ist auch über ein Schema beschrieben.   <?xml version="1.0" encoding="UTF-8"?> <xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"> <f href="C......

2008 Aug 19

29 of 186 | Serializable XmlDocument - It's surprising that XmlDocument isn't marked [Serializable], because it's very natural to serialize one into a stream. I wanted to put an object into ASP.NET ViewState the other day, and quickly ran into this roadblock, because part of the object included an XmlDocument, which is not serializable. A quick search revealed that most people deal with this problem by storing a string instead. Indeed, that was where I started, but I quickly realized that there are multiple places in my code where I want to do this sort of thing, and I don't want to have to mess with it in each data structure that contains an XmlDocument. So I put together a simple class that holds an XmlDocumen......

2008 Aug 02

30 of 186 | Silverlight Cream for August 1, 2008 -- #340 - Denislav Savkov with a selection helper class, Mark Monster with SL Tag Cloud, Mike Taulty on asmx web services, Jesse Liberty on Page switching and his new SL book with Tim Heuer, and Martin Grayson on panels. From SilverlightCream.com: Tip: Easy/Reusable selection with ISelectable and SelectionManager Denislav Savkov submitted this quick tip of a helper class, to assist in selection process. All the code plus examples on the blog! Creating a Silverlight TagCloud UserControl I guess it's my own fault for not doing it, but a Silverlight TagCloud has been on my ToDo list... Mark did one, and is giving up the code... very cool, Mark... and thanks :) Silverlight 2 Beta 2 - ASMX Services &a......

2008 Jul 31

31 of 186 | Creating shared types with SvcUtil against multiple sources - One of the teams I am working with ran into an issue when generating shared types via SvcUtil.  The issue was SvcUtil was generating multiple types (e.g., classes, enums) in the proxy .cs file.  After a google search, I found this was being experienced by others: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=745657&SiteID=1 http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1392697&SiteID=1   An example of the duplicate types: [System.CodeDom.Compiler. GeneratedCodeAttribute("svcutil", "3.0.3906.22")] [System. SerializableAttribute()] [System.Xml.Serialization. XmlTy......

2008 Jul 26

32 of 186 | Protecting Content Passed From Web Services - Recently, I got called in to help a developer who had an issue where he was using the Infragistics HTMLWebEditor control to allow users to submit content.  Many of the users copy and paste code from Word into the editor.  For those in the web development industry we all know that Word's HTML is not your typical HTML.  The issue the developer ended up having was that certain characters were being saved to the database and when passed back to the front end from his web service they were causing XML validation errors because symbols were not being properly escaped.  Regardless of whether HTML should be saved to the database or not, the developer needed a solution quickly so that the users coul......

2008 Jul 25

33 of 186 | Testing OracleException - In the application I've been working on, we have the requirement to handle unique constraint errors gracefully.  It wasn't really hard, I just had to check for OracleException.Code == 1.  The trick was the testing.  Testing a unique constraint error was not a problem.  The issue is verifying that other exceptions are bubbled up properly. The basic exception handling code is like this:     1 protected bool HasUniqueConstraintError( Action databaseAction )     2 {     3     try     4     {     5         databaseAction();     6         return false;     7     }     8     catch( OracleException ex )     9     {    10         //Return false if exception is a Unique Constraint erro......

2008 Jun 02

34 of 186 | HOWTO: Change IIS User Impersonation Token - Question: Hi, We are using our third party component for doing authentication and authorization with IIS6 web server on win2k3 X64 EE. Here we are using IMPERSONATION concept for this integration. Can anybody describe the required configuration which are needed at IIS 6 for successfully impersonation of users with third party component? Should we need to set Anonymous authentication explicitely for this kind of configuration? Answer: Third party code will not be able to directly impersonate and have IIS use that user token. IIS will: Strip off the impersonation token after ISAPI Extension returns control to it Ignore and re-apply IIS's desired impersonation token if ISAPI Filter c......

2008 May 30

35 of 186 | ???????? XNA: ????? ????? ???? ?????? Visual3D.NET - Beta 2 - XNA ??????????? ??????? ??????? ? ???????? ???? ????? ??????? ??????? ?? Realmware Corporation ??? ????????? Visual3d.NET www.visual3d.net ?????? ????? ?????? Beta ????? ????????. ??? ???????? ?????? ????????????:API:1. ??????? ??????: ???????, ????????, ?????????????? ???????; ?????????? ????? ???????? ? ?????????; ????????? ???????????????; ???????????? hardware ? shader instancing2. ???????: ????????? ???????? .FX (?????? ????????????? ? DX SAS, ????????? NVidia FX Composer), HLSL ??? ??? ?????????????? ????? ????????? ?????????3. #SL – ??????? ?? C#: HLSL ??? ???????????? ?? ???? ?? ???????, ?????????? ?? C#, ?? ???????????? ??????? IL, ?????????? ???????? ????? ????? ? ?????????, ??......

2008 May 06

36 of 186 | XML Serializable Dictionary - Typically generic dictionaries are not serializable. For serializing the generic dictionaries we can write custom xml serializable dictionary class by inheriting from Dictionary<TKey, TValue> and also implementing the IXmlSerializable interface.   Below code snippet contains the code of XMLSerializable dictionary.   using System; using System.Collections.Generic; using System.Text; using System.Xml.Serialization; using System.Runtime.Serialization;   namespace CustomType {     /// <summary>     /// Xml serializable dictionary object.     /// </summary>     /// <typeparam name="TKe......

2008 Apr 21

37 of 186 | JSONVid: Pure JavaScript Video Player - Jacob Seidelin went on a ( crazy :) ) mission to create a pure JavaScript video player that didn't use Flash: My first thought was to read binary video files using a technique like the Andy Na posted about here, figuring that there must be some really simple to parse video formats around, but I soon changed directions and decided to make up a whole new video format. Enter.. JSONVid. Using a player like mplayer, it is easy to export all frames in a movie clip to individual jpeg files, and using whichever language you prefer it is also fairly trivial to collect these files, base64 encode the bunch of them and throw them all together in a nice JSON file (I used this PHP script). The forma......

2008 Apr 20

38 of 186 | Grouping, while publishing a ClickOnce application. - When we publish our application, Initially there is only a single group named Required. In our application, sometimes we would like to use XMLSerializer for optimization. This will create XMLSerializer.dll in your application. This XMLSerializer.dll we normally dont want to download everytime, when we publish our application again after some changes and want it to be downloaded for specific set of users. We can create a separate group for XMLSerializer.dll in ClickOnce, which will specify it to be downloaded to some set of user who belongs to that group. Note: Never put XMLSerializer.dll and main application dll or exe in same group.    ...

2008 Apr 03

39 of 186 | Simple Question on .NET - Next >> When was .NET announced? Bill Gates delivered a keynote at Forum 2000, held June 22, 2000, outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and delegates were given CDs containing a pre-release version of the .NET framework/SDK and Visual Studio.NET.   When was the first version of .NET released? The final version of the 1.0 SDK and runtime was made publicly available around 6pm PST on 15-Jan-2002. At the same time, the final version of Visual Studio.NET was made available to MSDN subscribers.   What platforms does the .NET Framework run on? The runtime supports Windows XP, Windows 2000, NT4 SP6a and Windows ME/98. Windows 95......

2008 Mar 29

40 of 186 | Encrypting Information in SharePoint Lists - Encrypting the information contained in SharePoint lists is a common request that I have heard from colleagues and customers.  SharePoint does not provide any built-in mechanism for encrypting the information that is contained in the content database. Sometimes a list might contain sensitive information, such as the social security number for an individual.  Once this information is entered into a SharePoint list, it is stored in the content database in plain sight of anyone that is able to view the database.  We should implement stringent security to limit who can access the database, but it can also be good to add another layer of security protection for the sensitive data......

2008 Mar 24

41 of 186 | FaviconGrabber and Social Graph - Alistair Rutherford has written a nice looking Flex application that visualizes the Social Graph API: Alistair told us about the application, and some of the fun features: The initial version was a bit boring looking so I thought it would be nice to pull the ‘favicons’ for the sites returned in the results. I have detailed how I did this here Because I could not fetch the icons directly using HTTPService I have used a cgi proxy script written in Python to fetch the target icons and convert them into a Base64 encoded string before returning the data to the Flex application. The Flex application decodes the Base64 and then passes the data to a modifed version of the IconLoader class f......

2008 Mar 23

42 of 186 | DataTable to JSON and ToJSON() Extension - Very recently I wrote an application where I had to deal with DataSet from a Web Service. Please note, I have no control on the Web Service and I ended up writing a small function which converts DataTable to JSON. I understand I haven't gain anything on the web traffic, but it surely simplified my JavaScript programming. Let me go through what I did Step 1.  Extract the XML Schema. DataTable has two handy methods to extract Xml and Xml Schema. I extracted the Xml Schema to be able to generate a C# class using the xsd.exe.     string path = "Your File Path";     myDataTable.WriteXml(path);     myDataTable.WriteXmlSchema(path); Step 2. Generate C# Class using X......

2008 Mar 20

43 of 186 | ASP.NET Basics: Foundation of ASP.NET - This has been pooled together from a number of resources: What is ASP.NET? Microsoft ASP.NET is a server side technology that enables programmers to build dynamic Web sites, web applications, and XML Web services. It is a part of the .NET based environment and is built on the Common Language Runtime (CLR) . So programmers can write ASP.NET code using any .NET compatible language. What are the differences between ASP.NET 1.1 and ASP.NET 2.0? A comparison chart containing the differences between ASP.NET 1.1 and ASP.NET 2.0 can be found over here. Which is the latest version of ASP.NET? What were the previous versions released? The latest version of ASP.NET is 2.0. There have been 3 vers......

44 of 186 | The Performance Woe of Binary XML - Analysis on why binary XML doesn't solve the real issue of XML performance...

2008 Mar 11

45 of 186 | Auto Generate a class from a Web Service or an XML file. - Lets Say ...  you are working on a COM component in C# that will wrap a Web Service. Callers of your object \ class want to use a particular web service but can not access it directly. So instead they are going to user your COM object as a proxy. One of the things your COM object  must do is mirror a class in the Web Service. There is a method call to GetSomeStuff() that returns a Stuff object. public Stuff GetSomeStuff(){.... The client consuming your object has no reference to SomeWebService.NamePace.Stuff and so will be unable to use it. However, they will have a reference to your COM object and so they will be able to get to MyKickButt.ComObject.Stuff So your stuff must ha......

2008 Mar 07

46 of 186 | Refactoring to Comply with the DRY principle (Don't Repeat Yourself) - If you're not living DRY, you're not a good programmer. Okay, I'm not talking about alcohol consumption!  I'm talking about the Don't Repeat Yourself principle--a principle every programmer should live by.  Recently I did a code review for a project we outsourced, and demonstrated how you can refactor bad cut-and-paste code into well-designed code.  You will note that the capabilities of the MagicStringTranslator class really help to reduce code clutter. Without further ado, I present the relevant portion of my code review: ...your branching logic has 12 lines of code in each branch except the final one.  I am inserting an excerpt for reference:         if (m_record.Text.Substring(13, 6)......

2008 Feb 26

47 of 186 | ??: .NET????????? - ???: Scott Hanselman ????: Tony Qu ????: http://feed.yeeyan.com/articles/view/15070/5074 ?????????ASP.NET??? ??. ?????????,????????,??????????????????“????,?????????????” ?????????,????????????? ???????.NET???????????????,?????????????????????ASP.NET(?WinForm)???????????????????,???????????????????????????????,??????????????? ????????????——???????,???????????????????????????????,???????????????????????,?????????????????????ASP.NET,?????????ASP.NET????????????????,?????????????????????????4??,????????????,?????????????????????????????,?????????????????????  .NET?????????? ??????.NET?? ??????????? ???Windows??,??????????EXE??????? Windows??????????????????????????????????????????????......

2008 Feb 23

48 of 186 | The Performance Woe of Binary XML - Analysis on Why Binary XML doesn't solve the real issue of XML performance...

49 of 186 | Use of SGEN.exe to avoid common XmlSerializer performance pitfalls - This week, I encountered a test scenario which makes use of an XmlSerializer on it's startup path. Unfortunately, MSDN's documentation for the type is not clear on the performance impact of using an XmlSerializer. The documentation on introducing XML serialization, found here, actually mentions the solution, but it also does not state what the problem is. When you use an XmlSerializer, a helper assembly(1) with a custom type for serializing your type is created. The C# CodeDom is used to generate this code, which then is compiled by the C# compiler. The runtime must then load this generated assembly, and JIT the code. Additionally, a separate assembly is generated for each type you create ......

2008 Feb 16

50 of 186 | "New" Statement Considered Harmful - All of us have probably written code like this: Foo f = new Foo(); And what could be simpler?  As long as the logic in the constructor is simple (or better yet, the constructor is empty), it would seem that the simplest code is the best, so just use the constructor.  Certainly the MSDN documentation is rife with code that uses public constructors.  You can probably find plenty of public constructors used right here on my blog.  Why invest the effort in writing (and using) a factory class that will probably never do anything useful, other than call a public constructor? In his excellent podcast entitled "Emergent Design: The Evolutionary Nature of Software Development," Scott Bain of Net ......

Page 1 of 4

Newest posts Newest posts in xmlserializer
 

    Email TopXML