Archive for the ‘.NET’ Category

Geocortex & Silverlight at PUG 2009

March 11th, 2009 by Robert

A couple weeks ago during the plenary session at the Petroleum User Group Conference (PUG) in Houston, the ESRI Energy Team presented an ArcLogistics solution that included mobile and AVL (automatic vehicle location) viewer components.

At the invitation of ESRI, Latitude created the AVL viewer component using ESRI’s new Silverlight API. Although our team is slammed right now, helping build the demo tied in nicely with the work we’re doing with Geocortex Essentials 2.0. I was in the audience, and I thought the ESRI team did a great job in presenting a complete workflow from start to end (we also appreciated them acknowledging our contribution on stage).

The purpose of the demonstration was to illustrate the power of ArcLogistics to optimize the processing of oil field production maintenance orders. The scenario is built using maintenance orders with the Rocky Mountain Oilfield Testing Center field data in Wyoming. Maintenance orders are taken from SAP, loaded to ArcLogistics and optimized between a small fleet of contractor vehicles. Diagnostics indicate the expected savings in time and mileage. The routes for each truck are dispatched by wireless to a simulated in-car station that informs the driver of his schedule for the day and provides an advised route generated by ArcLogistics. Through a lightweight mobile app, the contractor indicates that he has completed a job, posts it back to the dispatch desk, and then continues to his next job. Using a Geocortex tracking viewer (via ESRI’s Silverlight API), we then simulated the dispatch center’s view; real-time tracking of multiple fleet vehicles on an interactive map.

I expect that ESRI’s ArcLogistics tied in with a mobile solution has a bright future (and not just in the petroleum industry).

Handy Trick for JSON Serialization

February 17th, 2009 by Drew

The Geocortex Essentials REST API (written for the upcoming 2.0 release) relies heavily on the ability to serialize objects to JSON (JavaScript Object Notation). JSON is used as a stateless response to an HTTP request for a REST resource; whether generated by the ArcGIS Server JavaScript API, Flex API, or other (Silverlight for example).

One of the interesting things about serializing server-side, .NET objects (to JSON or any format for that matter) is the way in which we determine which properties are serialized. Most automatic serialization mechanisms (implementing ISerializable for example) require that all components of a class are themselves serializable and simply convert the entire object into its serialized representation.

Sometimes; however, you may want two different serialized representations for the same object. For example, when serializing a Geocortex.Essentials.Map object, we may want to know the name and type of each Geocortex.Essentials.Layer within that Map; however, if serializing just an individual Layer we may wish to get a more “verbose” representation including its extent, visibility, or other properties.

Joel (Geocortex Essentials Product Developer) introduced me to a handy way of easily serializing an object to JSON for this scenario. Using the JavaScriptSerializer object (from the MS AJAX library), you can simply serialize a Dictionary containing key/value pairs and the result is a JSON string representing just those properties you wish to serialize. If the order of your properties is important, you could also use an OrderedDictionary.

Consider, for example, this “Person” object, containing an associating with an “Address” object.

PersonAddress

Now, if I want to serialize the person to JSON while explicitly selecting the components I’m interested in, I can create a Dictionary as follows (assuming I have a variable named “person” which is assigned to a Person object as depicted above):

jsonPart1

Serializing the dictionary is accomplished easily with this line of code:

jsonPart2

And the result is a nice JSON string which is exactly what I was looking for:

{
    “name” : “Smith, John”,
    “address” : “123 Main St., New York, NY”
}

Note; however, that the same handy conversion “trick” is not available when using the DataContractJsonSerializer (from the WCF library in .NET 3.5):

jsonPart4

The DataContractJsonSerializer creates a much more explicit representation of my Dictionary (an array of key/value pairs) which isn’t as useful when using JavaScript to parse and evaluate the JSON:

[
   {
        "Key" : "name",
        "Value" : "Smith, John"
    },
    {
        "Key" : "address",
        "Value" : "123 Main St., New York, NY"
    }
]

In case you’re interested, the JavaScriptSerializer was deprecated in .NET 3.5 (which is odd since it was made available in MS AJAX 1.0); however, it has been de-deprecated in .NET 3.5 SP1.

Geocortex Essentials 2.0 Moves to .NET 3.5

February 6th, 2009 by David

I want to make everyone aware of a technology decision we’re planning on moving ahead with for Geocortex Essentials 2.0. We’ve decided to increase the minimum .NET Framework for Essentials from 3.0 to 3.5, the latest .NET version. There are a number of compelling reasons for the move, the primary one being our customers’ interest and our own interest in leveraging the powerful new features in the latest .NET framework. The Essentials installer will ensure that the necessary prerequisites are installed before installing Essentials 2.0. Also, applications targeted at the 2.0 and 3.0 versions of the .NET framework should remain fully compatible with 3.5.

Please let us know if you have any questions about this.

ArcGIS Server 9.3 APIs Part 1

March 28th, 2008 by David

With the release of ArcGIS Server 9.3, you’ll have the following APIs available for building web applications with ESRI software:

  • Web ADF (.NET and Java)
  • REST (.NET and Java)
  • JavaScript
  • Google Maps Extender
  • Virtual Earth Extender

In addition to these APIs, ESRI is also working on a Flex API and Silverlight API that will be released post 9.3. No matter what the technical requirements are for your project, at least one of these APIs should help you get the job done. But which one? With choice comes confusion. There’s obvious strengths and weaknesses of choosing one over the other, as well as overlap in the functionalities they offer. Sometimes the choice is clear based on the technology stack and features you’re targeting. For example, if you require a secure solution and are standardized on .NET Framework then the .NET Web ADF is likely the best choice. Over the next few weeks I’ll discuss and compare these APIs in hopes of making your decision a little bit clearer, as well as share our experiences with them to date.

.NET Framework Source Code Available Soon

October 3rd, 2007 by David

Scott Guthrie from Microsoft made an exciting announcment on his blog this morning — Microsoft will be making the .NET 3.5 libraries source code available for download under the Microsoft Reference License (MS-RL) later this year. As an ISV, we’re super excited about this move as it will allow us to gain valuable insight into the internal workings of .NET as well as extract best practices for use in our own software.