Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic, Microsoft Cloud

Weblogic: Article

Running ASP.NET Applications on WebLogic Easier Than You May Think!

A First Look at Visual MainWin for J2EE

When WLDJ wanted someone to take a First Look at Visual MainWin for J2EE, we turned to interoperability expert Laurence Moroney - coauthor of a forthcoming book on Web services security and a senior architect in a major financial services house in New York City. In the course of assessing the product, Laurence in fact became more and more involved - in the end, on a staff basis - with the company behind it, Mainsoft. So this First Look should be read with that basic journalistic disclosure in mind.

When WebLogic workshop was first conceived and presented to the public, it was done so as an alternative to the hugely popular Visual Studio.NET development environment - one that was just as easy to use, and equally if not more powerful, because it would allow you to build J2EE applications, including EJBs, in as easy a manner as a VB programmer could put together a Windows-based object.

However, many shops that have existing assets in .NET and build in C# would have to port all that code into Java using Workshop, and effectively throw away their existing investments should they want to run on the WebLogic J2EE platform. This became, and still is, a huge hurdle in migrating between the platforms. In addition to this, a real strength of WebLogic Workshop 8.1 is in its ability to easily construct EJBs and to easily construct workflow applications and expose them as services. On the front end, it has the very useful pageflow technology that can be used to construct UIs that consume these, but many would argue that there is no better productivity alternative for front-end Web applications than ASP.NET with Visual Studio.NET. It would be nice if you and your team could use WebLogic for what it does best - middleware EJBs and Workflows, and ASP.NET for what it does best - front ends.

Now there is a way: Visual MainWin for J2EE is a product from Mainsoft (dev.mainsoft.com) that offers a unique and innovative solution to this. In a nutshell, this product, nicknamed Grasshopper, takes the Microsoft Intermediate Language (MSIL) generated by .NET and converts it into Java Byte Code, supported by a Java port of the Mono libraries. This way your C# code can be compiled and run on a J2EE application server such as WebLogic on Windows, Linux, or anywhere else it is supported. It's a wonderful way of capitalizing on the usability of Visual Studio.NET with the run-time reliability and characteristics of WebLogic.

In this article you will take a look at what it takes to deploy your existing ASP.NET front ends to WebLogic 8.1, and to interop with assets such as EJBs that are already running on that platform.

How It Works
The concept behind this product is very simple - but very effective. Mainsoft is a major contributor to the Mono project, and they have used their tool to port the Mono source code to Java. This provides the namespace support so that the ASP.NET namespaces can be called from Java. It then takes your C# or VB.NET code and cross-compiles the MSIL generated by the .NET framework compilers into Java Byte code. This is then a pure Java solution that will run on your J2EE application server. They also add support to consume Java References and EJBs.

When developing an application you simply create an ASP.NET application and use their wizard to convert it to J2EE, or you can create a C#/VB.NET for J2EE application using the new project types in Visual Studio.NET after installing.

The rest - developing, debugging, code completion, intellisense, etc. - all work cleanly within Visual Studio.NET. It's very compelling, and if you or any member of your team is comfortable in this development environment, you'll be amazed at how cleanly it integrates. There's something very cool about writing C# and running and debugging it on WebLogic as cleanly as you would on IIS.

Getting Started - A Very Simple Example
This first example takes a standard C# Web form, adds an EJB reference to it to allow it to consume an EJB off a WebLogic 8.1 server, and then compiles the Web form to run on WebLogic.

To get started, use WebLogic Workshop to create a simple EJB that implements the following method:

/**
* @ejbgen:remote-method
*/
public String echoHelloWorld(String strIn)
{
return "Hello World, " + strIn;
}

It is very simple and just returns "Hello World" and the caller's name.

You'll need to install the enterprise edition of Visual MainWin for J2EE to continue, because only the enterprise edition supports BEA WebLogic. You can find this at dev.mainsoft.com. They also have a free edition of the tool that supports Tomcat. Once you have downloaded and installed the tool, you can launch Visual Studio.NET and create a simple Web form like the one shown in Figure 1.

Adding a reference to an EJB is very straightforward - and will look very familiar if you are used to consuming Web services in Visual Studio.NET. If you right click on the "References" node in the solution explorer, you will notice two new entries - "Add Java Reference" and "Add EJB Reference." The former allows you to consume JAR files and use them from within ASP.NET, and the latter does the same but for EJBs. If your EJB (from above) is deployed to WebLogic and the Application Server is running you can use the Add EJB reference, and you'll get the dialog that is shown in Figure 2.

You can add the EJB reference using either a path to the JAR file that contains it, or by using JNDI.

Once the EJB reference is made, Visual Studio.NET and Visual MainWin for J2EE create a proxy class that allows you to talk to it. This then allows you to code to the J2EE using all of the productivity features of Visual Studio.NET, such as autocomplete.

On the simple ASP.NET UI that you created earlier, you can now add the following code (the textbox should be called "txtName" and the label should be called "lblResp" for this code to work):

localhost.ejbhwRemote myEjb = new localhost.ejbhwRemote();
string strTest = myEjb.echoHelloWorld(txtName.Text);
lblResp.Text = strTest;

Using a WebLogic Workflow
One of the massive strengths of the WebLogic Workshop 8.1 is the impressive workflow engine. This allows you to graphically design workflows and processes, and to interface them with external components such as Web services or EJBs. In many ways it is the foundation of an enterprise service bus. In this section you will look at how you can tie your ASP.NET user interfaces to these workflows using Web References, and deploy both the workflow and the UI to WebLogic.

More Stories By Laurence Moroney

Laurence Moroney is a senior Technology Evangelist at Microsoft and the author of 'Introducing Microsoft Silverlight' as well as several more books on .NET, J2EE, Web Services and Security. Prior to working for Microsoft, his career spanned many different domains, including interoperability and architecture for financial services systems, airports, casinos and professional sports.

Comments (4) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
WLDJ 10/19/05 07:15:10 PM EDT

Running ASP.NET Applications on WebLogic! When WLDJ wanted someone to take a First Look at Visual MainWin for J2EE, we turned to interoperability expert Laurence Moroney - coauthor of a forthcoming book on Web services security and a senior architect in a major financial services house in New York City. In the course of assessing the product, Laurence in fact became more and more involved - in the end, on a staff basis - with the company behind it, Mainsoft. So this First Look should be read with that basic journalistic disclosure in mind.

WebLogic Journal New Desk 10/19/05 05:42:31 PM EDT

WebLogic Journal - Running ASP.NET Applications on WebLogic! When WLDJ wanted someone to take a First Look at Visual MainWin for J2EE, we turned to interoperability expert Laurence Moroney - coauthor of a forthcoming book on Web services security and a senior architect in a major financial services house in New York City. In the course of assessing the product, Laurence in fact became more and more involved - in the end, on a staff basis - with the company behind it, Mainsoft. So this First Look should be read with that basic journalistic disclosure in mind.

.NET News Desk 10/19/05 05:32:11 PM EDT

WebLogic Journal - Running ASP.NET Applications on WebLogic! When WLDJ wanted someone to take a First Look at Visual MainWin for J2EE, we turned to interoperability expert Laurence Moroney - coauthor of a forthcoming book on Web services security and a senior architect in a major financial services house in New York City. In the course of assessing the product, Laurence in fact became more and more involved - in the end, on a staff basis - with the company behind it, Mainsoft. So this First Look should be read with that basic journalistic disclosure in mind.

WebLogic Journal New Desk 10/19/05 05:09:08 PM EDT

WebLogic Journal - Running ASP.NET Applications on WebLogic! When WLDJ wanted someone to take a First Look at Visual MainWin for J2EE, we turned to interoperability expert Laurence Moroney - coauthor of a forthcoming book on Web services security and a senior architect in a major financial services house in New York City. In the course of assessing the product, Laurence in fact became more and more involved - in the end, on a staff basis - with the company behind it, Mainsoft. So this First Look should be read with that basic journalistic disclosure in mind.

@ThingsExpo Stories
SYS-CON Events announced today that Daiya Industry will exhibit at the Japanese Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ruby Development Inc. builds new services in short period of time and provides a continuous support of those services based on Ruby on Rails. For more information, please visit https://github.com/RubyDevInc.
As businesses evolve, they need technology that is simple to help them succeed today and flexible enough to help them build for tomorrow. Chrome is fit for the workplace of the future — providing a secure, consistent user experience across a range of devices that can be used anywhere. In her session at 21st Cloud Expo, Vidya Nagarajan, a Senior Product Manager at Google, will take a look at various options as to how ChromeOS can be leveraged to interact with people on the devices, and formats th...
SYS-CON Events announced today that Yuasa System will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Yuasa System is introducing a multi-purpose endurance testing system for flexible displays, OLED devices, flexible substrates, flat cables, and films in smartphones, wearables, automobiles, and healthcare.
SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Taica manufacturers Alpha-GEL brand silicone components and materials, which maintain outstanding performance over a wide temperature range -40C to +200C. For more information, visit http://www.taica.co.jp/english/.
As hybrid cloud becomes the de-facto standard mode of operation for most enterprises, new challenges arise on how to efficiently and economically share data across environments. In his session at 21st Cloud Expo, Dr. Allon Cohen, VP of Product at Elastifile, will explore new techniques and best practices that help enterprise IT benefit from the advantages of hybrid cloud environments by enabling data availability for both legacy enterprise and cloud-native mission critical applications. By rev...
Organizations do not need a Big Data strategy; they need a business strategy that incorporates Big Data. Most organizations lack a road map for using Big Data to optimize key business processes, deliver a differentiated customer experience, or uncover new business opportunities. They do not understand what’s possible with respect to integrating Big Data into the business model.
Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, will discuss how they b...
Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities – ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups. As a result, many firms employ new business models that place enormous impor...
SYS-CON Events announced today that Dasher Technologies will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Dasher Technologies, Inc. ® is a premier IT solution provider that delivers expert technical resources along with trusted account executives to architect and deliver complete IT solutions and services to help our clients execute their goals, plans and objectives. Since 1999, we'v...
SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
SYS-CON Events announced today that TidalScale, a leading provider of systems and services, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale has been involved in shaping the computing landscape. They've designed, developed and deployed some of the most important and successful systems and services in the history of the computing industry - internet, Ethernet, operating s...
SYS-CON Events announced today that TidalScale will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale is the leading provider of Software-Defined Servers that bring flexibility to modern data centers by right-sizing servers on the fly to fit any data set or workload. TidalScale’s award-winning inverse hypervisor technology combines multiple commodity servers (including their ass...
Amazon is pursuing new markets and disrupting industries at an incredible pace. Almost every industry seems to be in its crosshairs. Companies and industries that once thought they were safe are now worried about being “Amazoned.”. The new watch word should be “Be afraid. Be very afraid.” In his session 21st Cloud Expo, Chris Kocher, a co-founder of Grey Heron, will address questions such as: What new areas is Amazon disrupting? How are they doing this? Where are they likely to go? What are th...
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
Infoblox delivers Actionable Network Intelligence to enterprise, government, and service provider customers around the world. They are the industry leader in DNS, DHCP, and IP address management, the category known as DDI. We empower thousands of organizations to control and secure their networks from the core-enabling them to increase efficiency and visibility, improve customer service, and meet compliance requirements.
Join IBM November 1 at 21st Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Cognitive analysis impacts today’s systems with unparalleled ability that were previously available only to manned, back-end operations. Thanks to cloud processing, IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Imagine a robot vacuum that becomes your personal assistant tha...
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, will lead you through the exciting evolution of the cloud. He'll look at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering ...
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
SYS-CON Events announced today that N3N will exhibit at SYS-CON's @ThingsExpo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. N3N’s solutions increase the effectiveness of operations and control centers, increase the value of IoT investments, and facilitate real-time operational decision making. N3N enables operations teams with a four dimensional digital “big board” that consolidates real-time live video feeds alongside IoT sensor data a...
In a recent survey, Sumo Logic surveyed 1,500 customers who employ cloud services such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). According to the survey, a quarter of the respondents have already deployed Docker containers and nearly as many (23 percent) are employing the AWS Lambda serverless computing framework. It’s clear: serverless is here to stay. The adoption does come with some needed changes, within both application development and operations. Tha...