Silverlight 2 RC0 Resources

by lichen 10/5/2008 8:56:00 PM

Silverlight 2 Release Candidiate is a developer-only release.

The official information can be found here. One the page, we can download the RC0 SDK and Tools for VS2008 SP1. It does not work with Expression Blend 2.5 Preview any more. Instead, it works with Expression Blend 2.0 + sp1 preview.

The RC0 offline document can be downloaded here.

The Silverlight Unit Testing framework has been updated for RC0 and can be downloaded here. Detail information can be found here. As for today, the Visual Studio 2008 Silverlight Unit Testing Project Template has not been updated, it works fine if you follow the option 1 path in this Jeff Wilcox's post.

There isn't a RC0 version of Deep Zoom Composer. Instead, we just need an updated project template.

Some projects are already porting to RC0, for example:

Siverlight multi-file uploader.

ExpandoHeaderControl.

There is an interesting form layout tool called XAML Power Toys and it supports RC0. 

Subscribe my Silverlight 2 Newsletter and get updated daily!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET | .Net | Silverlight 2

Create an asmx pass-through web service

by lichen 11/14/2007 3:00:00 PM

We need to call a 3rd party web service. In our development environment, we need to go through a Microsoft ISA proxy server. We have difficulty connecting to the web service with a Websphere web service client because it cannot handle NTLM authentication with the proxy server; we always get the 407 error from the proxy. The .Net client works fine with the proxy server. In order to move on with the development effort, we created a pass-through web service. The web services is running on our dev machine. When it is called, it simply set the proxy settings and forward the call to the external service. The following are the steps to create the pass-through web service:

1. Create an asp.net project.

2. Use wsdl.exe to create the proxy as well as the server interface:

wsdl.exe /proxy:http://server:port /pd:domain /pu:user /pp:password WSDLUrl

wsdl.exe /serverinterface /proxy:http://server:port /pd:domain /pu:user /pp:password WSDLUrl

Note the /serverinterface option in the second command. This will create MyService.cs and MyServiceInterfaces.cs files. If the web service accepts or returns objects, there might be duplicated classes defined in MyService.cs and MyServiceInterfaces.cs files. Delete the duplicated copy in MyService.cs.

3. Create a new asmx web service, MyServiceImpl. This will create MyServiceImpl.asmx and MyServiceImpl.cs.

4. Modify MyServiceImpl.cs to implement the service interface in MyServiceInterfaces.cs. In the implementation of each method, call the coresponding method of the proxy.

This is how MyServiceImpl.cs looks like:

public class MyServiceImpl : System.Web.Services.WebService, IMyService

{

MyService proxy;public MyServiceImpl()

{

proxy = new MyService();

WebProxy p = new WebProxy(proxyHost, proxyPort);p.Credentials = new NetworkCredential(proxyUser, proxyPassword, proxyDomain);

proxy.Proxy = p;

}

/// <remarks/>

public MyReturnObject MyMethod(string symbol)

{

return proxy.MyMethod(symbol);

}

...

}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET | .Net | Web Service

WS-Security interoperability between Java and Windows 1 - Export key to Windows

by lichen 11/5/2007 5:51:00 PM

In the Java world, keys are generated with keytool that comes with JDK. The keys are stored in keystores in either JKS or JCEKS format. In Windows world, the keys are stored in the Windows key store. Windows key stored can be managed by running the Cetificates MMC. The first step of Java/Windows WS-Security interoperability is be able to exchange keys between Java keystore and windows key store. In this blog, I will show how to export keys from Java keystore to Windows key store.

keytool can export certificates but cannot export private key. To export private key, one need a tool like KeyTool IUI. KeyTool IUI will export a private key entry into two files: one for the private key and one for the certificate. Windows key store cannot import these files so it is necessary to convert them with tools like OpenSSL. The following is the procedure to export a private key from Java key store:

  1. Use KeyTool IUI to export the private key. Select PEM as file format for both private key and the certificate file.
  2. Use notepad to append the two PEM files into a single file because this is required by OpenSSL.
  3. Run the following OpenSSL command: openssl pkcs12  -export -out mykey.pfx -in mykey.pem
  4. From Certificate MMC, import the mykey.pfx file.

Added 1/7/2008: An alternative to step 2 and 3 is to run KeyTool IUI in Plus mode. Run run_ktl_plus.bat. Create a pkcs12 keystore. Import a private key into the keystore. The UI allows us to import both the private key file and the certificate file so we do not need to append them as discussed in step 2.

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET | Web Service | Java

Say goodbye to .Text (dotText)

by lichen 10/29/2007 12:29:00 PM
It is finally the time to say goodbye to dotText. dotText has served me for the past 4 years. I am thankful to the creator of dotText to create the such wonderful package to that I can host my blog. On the otherside, dotText has been aging and out of maintanence. In the past two years, I have come out with updates in order for it to run under ASP.NET 2.0 as well as to fight comment spam. I encountered dotnetBlogEngine the other day and decided that I would rather be blog author than blog developer. So I migrated to dotnetBlogEngine. I had trouble with the built-in importer. I wrote a program to read from the .Text database and export to the dotnetBlogEngine database.

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET | .Net

My first impression with Ruby On Rail

by Li Chen 7/24/2007 4:56:00 PM

Whenever I search subjects relating to rapid application development, I always encounter Ruby On Rail (ROR). So I decided to take a look of ROR. The creators and supporters of ROR have done an excellent job to make starting with ROR really easy. Instant Rails has made download and installation a one stop shopping.The Rolling with Ruby on Rails is one of the best articles that I have ever read on introducing a new subject.

What makes ROR so productive? I think the following features really make ROR productive:

  1. Scafolding: ROR's code generator can generate the skeleton code from a database table. One can then work on generated code to meet the needs.
  2. Migration: A typical problem with database application development is what to do when the table schema is changed. ROR has excellent data migration tool built-in.
  3. Convention over configuration: ROR uses MVC pattern.Unlike other MVC frameworks such as Struts or String, ROR uses convention to instantiat objects and assemble them together. We neither to work with configuration files, nor have to assemble the objects.
  4. ActiveRecord: ROR's model often is simply a subclass of ActiveRecord without additional properties. It is not necessary to regenerate the model when the table schema is changed.
  5. Ajax support: ROR really shines at utility functions that can generate Javascript code to create an AJAX application.
  6. Easy to create unit tests to test the model and controller.

So am I going to develop my next big application wth ROR? I am still sketical for the following reasons:

  1. Scalability concern: I don't think I can do everything in Ruby. I think is much easier to find libraries in Java or .NET. So if I want to create an application with a single language, Java or .Net is a much better bet.
  2. Errors are captured at runtime instead of compile time.
  3. Debugging support.
  4. Model has access to database. I really hope model and persistency are implemented in different layers.

ASP.NET is current still my favorite web application development tool because it is the best tool for build sophiscated view for its support for rich controls. Microsoft has created excellent RAD tools such as strongly-typed dataset and it is nearly as productive as ROR. The main draw back with RAD deeloped with ASP.NET/Strongly-typed dataset is that the view and controller are combined in the code-behind so the controller is not testable. So we really need a scafolding tool to make it easier to generate the MVC skeleton. I am glad to see that projects like SubSonic is emerging.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | ASP.NET

Compare JSF to ASP.NET 2.0.

by Li Chen 7/18/2007 5:26:00 PM

JSF is the latest offering for the Java web application development. JSF is an MVC framework, similar to Struts. JSF is an enhancement to Struts:

  1. The action is now mapped to a method of a bean instead of a servlet. Components can now have events. This is much more like code-behind in ASP.NET. This reduces the number of files one has to work with.
  2. More custom tags and richer controls, such as Data Tables.

Here is how JSF compares with ASP.NET 2.0:

  1. ASP.NET 2.0 is the mainstream development framework in .net world. JSF is still considered as unproven. Only a quarter or less Java web developer jobs requires JSF.
  2. JSF is a specification instead of implementation. Depending on the implementation used, one may get more or less rich components. So evaluating implementation itself is a major task.

In conclusion, projects using ASP.NET 2.0 should expect stable and well behaved frameworks. Developers should find it much easier to develop web applications with richer functionality and to work with AJAX.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | ASP.NET | Java

Compare Struts to ASP.NET

by Li Chen 7/18/2007 4:40:00 PM

Struts is an MVC framework for Java web application development. Struts 1.0 was released in July 2001, roughly a year before ASP.NET 1.0. Currently, 70-80% of Java Web application developer's job requires Struts so it is fair to say that Struts is the current mainstream framework for Java web application.

Struts contains an MVC framework and a set of JSP custom tags. For a simplest application, developers need to provide:

  1. An html form in which user can enter data.
  2. A Struts bean that serves as model. The inputs in the form is mapped to the properties of the bean.
  3. An action servlet which serves as controller.
  4. One or more JSP pages that serves as view for the results.

The components are wired together with a configuration file struts-config.xml. Struts framework actually provides a servlet as front-controller in which all actions go to. The front-controller is responsible for instantiate the Struts bean, dispatch the action and route to the approprate view based on the return of the action.

In addition, Struts also supplies custom JSP tags that provides the following functionalities:

  1. Preserve the state of input if the view is same as the form.
  2. Validation.
  3. Layout with Tiles.

Struts provides serveral important functionalities in the framework and significantly reduced the repeatitive tasks in Java web development. ASP.NET does not require a regid MVC pattern like Struts (which could be both pro and con). Besides that, ASP.NET does almost every other things better:

  1. Struts still requires coding the same information twice, once in form and the second time in bean. In ASP.NET code-behind, controls are automatically created from form. In additional, ASP.NET supports rich controls, i.e., controls not available in HTML.
  2. The modle, view and controller of Struts is scattered in many files. The only place to find them is in the struts-config.xml file. It is inconvenient to work with large number of files. Although the seperation of functionalities into many classes remotes reuse, in reality, the classes are rarely reused.
  3. ASP.NET's mechanism to preserve form state is simpler to use.
  4. ASP.NET's validation architecture is better and it is transparent to render client-side Javascript depending on the type of clients.
  5. ASP.NET's master page and skin is superior to Tiles.

In conclusion, also Struts is a significant improvement over normal JSP/Serlet programming. Struts is still far behind ASP.NET in functionality and productivity. There are tools like AppFuse that would make Struts development easier. It is still nowhere near the experience with Visual Studio 2005 and ASP.NET 2.0.

Perhaps it is time to compare ASP.NET with JSF which is the latest offering in the Java world.

Currently rated 1.0 by 1 people

  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | ASP.NET | Java

Compare ASP, JSP and ASP.NET

by lichen 7/16/2007 6:44:00 PM

ASP (Active Server Pages) was a revolution to web development when it was released by Microsoft in 1997. Since then, Sun has answered with a better tool in JSP. Microsoft answered to the Java challenge with ASP.NET in 2002. How do they compare to each other? I have done a survey and will anwer the question in a series of posts.

ASP allows server scripts and expression to be embedded in HTML. When it is desirable to seperate the code from the content, one would write the code in a COM object (usually written in VB6) and call the COM object from ASP page.

JSP (JavaServer Pages) has the following advantages over ASP:

  • ASP is interpreted while JSP is compiled - better performance.
  • In the Java world, one can develop Servlet and Servelet filter. In ASP world, one has to use C++ to write ISAPI Extension and ISAPI filter. ISAPI Extension and filter does not share session state with ASP. Lack of an easy way to create filter is a limitation for ASP.
  • In Java world, one often seperate presentation and code with JSP/Java Bean, like the ASP/COM object combination. One limitation for the Java Bean is that it does not have context while the COM object can access the context. To access the context, one has to write custom JSP Tag. The capability of JSP does make custom components look like HTML.

ASP.Net was Microsoft's answer to JSP. ASP.NET not only has all the capability of JSP, it also represent a major productivity boost:

  • ASP.NET's HttpHandler and httpModule is equivalent to Servlet and servlet filter.
  • ASP.NET support custom controls, like the custom JSP tags.
  • ASP.NET supports a code behind model. This is a productivity boost compare to JSP/Java Bean. With JSP/Java Bean, one has to code the inputs once in the form and then again in the bean. One only create the controls once in ASP.NET pages and they are automatically accesible in code-behind.
  • ASP.NET support rich components (none-HTML, such as Grid and TreeView. These are usually DHTML controls manipulated by JavaScript with states saved in a hidden input control. ASP.NET has the viewstate framework for store and retrieve the property of controls. These rich controls can be accessed in the code-behind page transparently like any other control. JSP/Java bean are limisted simple HTML inputs. Therefore, it is much easier to develop feature rich page with ASP.NET than the JSP/Java bean approach.

In conclusion,  JSP is about half way between ASP and ASP.NET. It is perhaps not fair to compare ASP.NET and JSP since they are not really in the same generation. A better comparison to ASP.NET might be JSP/Struts or JSF.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET | .Net | Java

Cool open source html templates

by Li Chen 7/10/2007 10:08:00 AM

http://www.opensourcetemplates.org/ has some really nice templates.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET

Frustration with JSP technology

by Li Chen 7/7/2007 4:17:00 PM

The problem

When I worked at ESRI, I worked on the .net version of ArcGIS Server Manager, which is a web-based front-end for ESRI’s ArcGIS Server products. The Java team also has a Java version of the product based on the same UI spec. I was the only .net developer on the .net version while the Java team had 2 ½ developers on the Java version, but I was constantly ahead in features. I was proudly thinking that I am a much better developer than my peers on the Java team.

However, a recent project changed my thinking. My current employer is migrating some VB6 based projects to Java. I developed a web service in Java. At the end of project, I have some time left. So I decide to develop a few simple CRUD pages for the configuration table. The idea is fairly simple: I want to develop a page that lists the records in the table. It has a single form at the end of the page that allows me to insert a new record, as seen in the picture below:

Normal Mode

When I try to edit the record, the page will enter the edit mode. The row that I try to edit would contain some textboxes. The edit/delete link would change to update and cancel. The insert form would be hiden, as seen in the picture below:

 

Normal Mode

This is a fairly standard feature in asp.net. I can develop a page like this in a few clicks in less than an hour. However, in Java/JSP, I search the Google with words like “Java and RAD” but could not find any rapid application development solution that is simple to use.

The solution

I did a survey on how Java developers do similar things with JSP. JSP allows scriptlets, like ASP developers embed script inside the ASP page. However, it is not good practice to embed lots of code in the contents page. Servlet is a good place for code. You cannot embed Servlet in an JSP page. A typical pattern is that people will have a page post to a Servlet (controller) to do all the processing. The servlet will then forward/redirect to a JSP page (View) to display the result. That is a good practice except the view could need lots of scriptlets if there are lots of conditional rendering. It is possible to embed Java Bean in JSP. However, Java Bean does not have access to Http context. To gain access to the Http context, one would have to develop custom Jsp tags.

Since my goal is to develop a CRUD page that allows me to edit an simple table, here is the design approach that I take. I have one JSP page and 3 servlets. The 3 servlets are used for handling insert, delete and update. The JSP is reponsible for displaying the data. It also contains scriplets to switch between normal and edit mode:

  1. Normal mode: Display the table normally. Show the insert form.
  2. Edit mode: Display the row being edited as textboxes. Display the button of the row as Update and Cancel. Hide the insert form.

Here is the code:

boolean editMode = (request.getParameter("kc") != null);

if (editMode) {

    action = "updateConfig?kc=" + request.getParameter("kc") + "&kk=" + request.getParameter("kk");

} else {

    action = "addConfig";

}

<form action="<%= action %>" method="post">

    <table>

        <tr>

            <th>Configurationth>

            <th>Keyth>

            <th>Valueth>

            <th>th>

        tr>

<%

while(rs.next()) {

%>

<% if (editMode && rs.getString("CONFIG_NAME").equals(request.getParameter("kc")) && rs.getString("KEY").equals(request.getParameter("kk"))) {%>

        <tr>

            <td><%= rs.getString("CONFIG_NAME") %>td>

            <td><INPUT type="text" name="key" size="20" maxlength="64" value='<%= rs.getString("KEY") %>'>td>

            <td><INPUT type="text" name="value" size="20" maxlength="254" value='<%= rs.getString("VALUE") %>'>td>

            <td><INPUT type="submit" value="update"><a href='config.jsp'>cancela>td>

        tr>

<% } else { %>

        <tr>

             <td><%= rs.getString("CONFIG_NAME") %>td>

             <td><%= rs.getString("KEY") %>td>

             <td><%= rs.getString("VALUE") %>td>

             <td>

                 <a href='config.jsp?kc=<%= rs.getString("CONFIG_NAME") %>&kk=<%= rs.getString("KEY") %>'>edita>

                 <a href='deleteConfig?kc=<%= rs.getString("CONFIG_NAME") %>&kk=<%= rs.getString("KEY") %>'>deletea>

             td>

         tr>

<% }

}

%>

<% if (!editMode) {%>

         <tr>

             <td><INPUT type="text" name="configName" size="20" maxlength="64">td>

             <td><INPUT type="text" name="key" size="20" maxlength="64">td>

             <td><INPUT type="text" name="value" size="20" maxlength="254">td>

             <td><INPUT type="submit" value="insert">td>

          tr>

<% } %>

      table>

form>

I felt that I go back 10 years in time and become an asp programmer again. So here is what I think why at ESRI my peers on the Java team are so much slower than me:

  1. JSP does not have an efficient method like code-behind in asp.net that allows close interaction between code and view.
  2. The MVC frameworks like Struts that is main stream in Java community tend to product large number of classes for simply thing. Also the MVC promotes separation of responsibility and reuse at the first glance. However, in real life, only a small number of classes are actually reused; most of classes are only used once. The large number of classes create problems in both naming and finding things. In ASP.NET, it is far more easier to work with things and find code.
  3. JSP lacks a component model to work with non-HTML controls. Here the non-HTML control means a sophiscated control like Tree that is composed of html, images, css. Its behavior is manipulated by Javascript and DHTML and states often saved in a hidden control. JSP and MVC framework like Struts can only handle native HTML controls. The rich components are handled outside of framework. Therefore, I would say that JSP is about half way between asp and asp.net. For an asp.net developer to work on JSP, it is like going back to stone page.
  4. I hope JSF will provide a rich component model that rivals that of ASP.NET. Unfortunately, both the development and the adoption have been so slow. It does not help that our company is still standardized on J2EE 1.4.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | ASP.NET | Java

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  January 2009  >>
MoTuWeThFrSaSu
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

Pages

    Recent comments