Thursday, May 22, 2008

JavaOne 2008 Altova Follow Up

It's been awhile since writing a post on my blog page, but I finally have some time to write a quick follow-up to my last post.

JavaOne ended about 2 weeks ago, but if you want to take a look at some short videos created by David McGahey using Windows Movie Maker on his iPhone, you can find them available on YouTube The videos are short and sweet and provide quick glances at the new features offered in the latest release of Altova tools. There's also many more videos you can watch on NikiDevgood's Channel. David's passion is photography and also has online photography at, http://whatsnew.fotki.com/DaveMcG/

By the way if you're wondering why I haven't written anything in awhile, my wife just gave birth to our second son! Jonathan was born on Mother's Day at 3:33 p.m. and weighed in at 7.7! If you're interested in looking at a few photos, you can find them here. Eventually, I'll get them all uploaded.

Tuesday, April 29, 2008

Get your "Java to go" with Altova Software

With less than a week to go before JavaOne, Sun has revealed that Java is at long last to be made 100% open source.

While we're on the subject of Java, I also wanted to briefly summarize the existing features and support for Java with many of the Altova tools! Here's a brief list of just a few of them and a few reasons why you may want to check out these tools.

You can also check out the link below for a brief summary detailing all of their support:

http://www.altova.com/dev_portal_languages.html


In addition, any of the Java code generated from their applications doesn't require any software licenses, it is royalty free!


Altova just released a new version of their software today which is free for you to try. Check out the latest press release!

Altova engineers will be at the JavaOne show giving live demos of their tools and answering any questions so stop by if you get a chance.

Dates: May 6-9, 2008

Place: The Moscone Center, San Francisco, CA Booth # 211

JavaOne Pavilion Hours:
Tuesday, May 6
11:30 am - 8:00 pm, 6:30 pm - 8:00 pm (JavaOne Pavilion Welcome Reception)
Wednesday, May 7
11:30 am - 4:30 pm
Thursday, May 8
11:30 am - 4:30 pm


It's a great opportunity to learn how the Altova tools can increase your overall efficiency as well as pick up some free Altova swag!



Of other interest, you might want to check out this resource here at Open Source software in Java.

Thursday, April 24, 2008

Using AltovaXML to process XML documents

The software we need from Altova is a freebie, AltovaXML 2008, which consists of an XML Validator, an XSLT 1.0 Engine, an XSLT 2.0 Engine, and XQuery Engine. The part of AltovaXML 2008 we're interested in for this example is the .NET Interface.

I've already installed Microsoft's Visual C# 2005 Express Edition, so I'll instead cover the basics of installing AltovaXML 2008. Here is the download to AltovaXML

AltovaXML has a few options in how it can be used, but for this article, I'm going to use it as a .NET Interface.

After installing AltovaXML, launch Microsoft's Visual C# 2005 Express Edition and create a new project. I chose a Windows Application for this simple example. Drag a button control from the toolbox and view the code, by double-clicking on the button.

Next, update the C# code for a button event listed below:

private void button1_Click(object sender, System.EventArgs e)
{
Altova.AltovaXML.ApplicationClass appXML = new Altova.AltovaXML.ApplicationClass();
Altova.AltovaXML.XMLValidator XMLValidator = appXML.XMLValidator;
XMLValidator.InputXMLFromText = "<test>Is this data well-formed? <a></test>";
if ( XMLValidator.IsWellFormed() )
{
MessageBox.Show( this, "The input data is well-formed") ;
}
else
{
MessageBox.Show( this, "The input data is not well-formed") ;
}
}


Now all we need to do is to add the AltovaXML DLL as a reference to the project. If you miss this step, you'll receive the following error when compiling the code, "The type or namespace name 'Altova' could not be found (are you missing a using directive or an assembly reference?)" This is added by going to the Project\Add Reference menu, and double-clicking on the Altova.Altovaxml

See screen-shot below:



Once this is done, you can compile and run the application. Here is the result of running the above application.



A quick update to this line:

"<test>Is this data well-formed?</test>"

and all is well!

That's it! The AltovaXML can do a lot more than a simple well-formedness check of your xml files, so if you want to harness the full power of this free tool, I can only suggest you download and try it out for yourself!

Tuesday, April 22, 2008

Working with The eXist OpenSource Native XML Database and XMLSpy

I have been using the eXist OpenSource XML Database for just a day now and I must say that it has already exceeded my expectations! eXist is in fact a Native XML databases. (One particular item of note: The only interface to the data in native XML databases is XML and related technologies (such as XQuery, XPath, the DOM) or an XML-specific API, such as the XML:DB API. XML-enabled databases, on the other hand, offer direct access to the data, such as through ODBC))

Anyway, XMLSpy already works great with XML-enabled databases, but I wanted to mention support for native XML databases, since the learning curve is so much less painful and it's so easy to get started right away. Not only that it's FREE. There are other native XML databases available as well, but this one appears to offer the most functionality. The Wiki entry for XML Database is a good resource.

It was so easy to download and install, I was really surprised. See screen-shot below!




Once the database is running, you can log in and start uploading some xml documents as well as import the examples for testing.

You can also actually edit the data directly in the eXist database from within XMLSpy by just using the "Open URL" option of the XMLSpy editor. See screen-shot below:

(Note: Using WebDav to Access the Database)



After uploading some test XML documents as shown below:





I was then able to run XQuery over my uploaded xml documents using XMLSpy as shown below:


This also assumes you've downloaded and installed either edition of XMLSpy.

Pretty easy stuff!

Monday, April 21, 2008

Deploy a WebService quickly with MapForce

MapForce is a very "simple to use" data mapping tool that also includes support for Web Services in the Enterprise Edition.

If you'd like to get started learning how to use MapForce to implement your very own web service, then check this out!

Prerequisites:You can download MapForce 2008 Enterprise Edition, and check out the prerequisites as they detail in the product documentation here. For this example I generated and deployed C# code, but I also generated and deployed Java code on my Vista box that has Apache (Jakarta) Tomcat: http://jakarta.apache.org/tomcat/index.html. As a side note, you can only use C# or Java code for this, so you should select the code that best fits your situation.

For this excercise, I used the existing TimeService.wsdl file supplied by Altova when you download their software which you can also get online here, http://www.nanonull.com/TimeService/TimeService.asmx?WSDL

The first modification you need to make is detailed below. (If you're deploying on Tomcat, note the following:

AXIS-style WSDL:

<service name="PersonWS"><port name="PersonWSQuerySoapPort" binding="tns:PersonWSSoapBinding"><soap:address location="http://localhost:8080/axis/services/PersonWS%22></port></service&gt;

For this demonstration, I'm deploying under IIS.

IIS-style WSDL:

<service name="PersonWS"><port name="PersonWSQuerySoapPort" binding="tns:PersonWSSoapBinding"><soap:address location="http://localhost/services/PersonWS.asmx%22&gt;</port></service>

Updated WSDL for this example.

* You cannot compile the generated code with either the Visual Studio Express 2005 Editions of Visual Web Developer or Visual Studio C# (http://www.microsoft.com/express/2005/download/default.aspx#).
I used Visual Studio.Net 2005 Pro. Edition to compile the code. Either Visual Studio .NET 2002/2003 or 2005 is supported.

After making the modifications to the shipped TimeService.WSDL, I created a new Web Service Project in MapForce.

See screen-shots below:



In order to fast-track this a bit, Altova software ships with completed examples. Therefore, I opened the pre-exisitng project located here, C:\Documents and Settings\gds\My Documents\Altova\MapForce2008\MapForceExamples\TimeService\TimeService.mfp in another instance of MapForce. Now, with both MapForce project files open, open each of the individual mapping files in the completed project and copy over all the functions that were used in their example and make the same connections into your web service mappings for each operation. Once this is done, make sure you have setup your code generation settings as shown below:


Now, we're almost done!
Once you're finished with your new project, generate the C# code from the Project menu, run the vbs script in the Mapping subdirectory, by double-clicking the file. (This script creates a virtual directory within IIS that points to the location of your generated code), finally compile the code.



That should be it! Considering you have met all the prerequisites and didn't run into any compiler errors as shown below,


Your new web service should now be up and running.

Now, we can quickly test our service with XMSpy as detailed below.

Using the Web service:


1. Using a WSDL client, e.g. XMLSpy, create and send a SOAP request.



2. Select SOAP Create a new SOAP request.



3. Enter the WSDL file location on the IIS server and hit OK. (http://localhost/TimeService/TimeService.asmx?WSDL)


4. Select the SOAP operation name that you want to use "getServerTime in this example, and hit OK to create the SOAP Request document.
We'll select the operation from our Web service to deliver the current time.


5. Edit the Body as shown below:
<SOAP-ENV:Body><m:getServerTime xmlns:m="http://localhost/TimeService/"/></SOAP-ENV:Body>
6. Select SOAP Send request to server to send the request to the server.The SOAP Response document is returned by the Web service, and contains the current time.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<getServerTimeResponse xmlns="http://localhost/TimeService/">
<getServerTimeResult>2008-04-21T14:23:07.1751167-04:00&lt;/getServerTimeResult>
&lt;/getServerTimeResponse>
&lt;/soap:Body>
&lt;/soap:Envelope>

I also played around a bit with the DailyDilbert WebService from this site: http://www.esynaps.com/WebServices/DailyDiblert.asmx?WSDL

Dilbert.com finally has an official feed for you: http://feeds.feedburner.com/DilbertDailyStrip

When you launch XMLSpy, the completed web page for the TimeService example can be found in the Soap Debugger project folder as shown below.


If you have any questions or run into any problems, please contact me.

Friday, April 11, 2008

SpyComponents ValidatorBuddy Plug-In for XMLSpy

XMLSpy currently supports DTD, & XML Schema schema languages "out-of-the-box". However, there are others such as Relax NG which is also a grammar based schema language as DTD's & XML Schemas. In addition, their is Schematron which is a rule based schema language. No current schema language supports both grammar- and rule based validation.

By using the SpyComponents ValidatorBuddy Plug-In for XMLSpy, you can now have support for Schematron validation, to include other features such as XSV validation, (XSV, (XML Schema Validator) is an open source (GPLed) schema-aware processor which implements standards defined by XML Schema Part 1: Structures and XML Schema Part 2: DataTypes.) SpyComponents does have really good plug-ins for XMLSpy if you're ever looking for additional features.

I'm just going to focus on the different schema languages since I've mostly only used W3C XML Schema's, but lately had some interest in looking at the other choices provided besides the popular W3C XML Schema. Other examples of schema languages are RELAX NG, & Schematron, (Schematron was invented by Rick Jelliffe), and DTD. While it's true that Relax NG is the simpler, cleaner, and in certain dimensions more powerful language, and with a nicer syntax, one can make the case that W3C XMl Schema has technical advantages for certain scenarios as well. Schematron is a rule-based XML schema language, offering flexibility and power that W3C XML schema, RELAX NG, and DTDs simply can't match. The popularity between these languages varies and most organazations use W3C Schemas, however, while Schemas are powerful, that power comes with substantial complexity. Even though there are better and simpler alternatives to W3C XML Schema's, check out Dr. Michael Kay's response to a recent discussion on the xml-dev list for the following question, "What is the "market share" of Relax NG vs XSD schema?".

If you ever requested or wished that your favorite xml tool included support for Schematron, you can now download ValidatorBuddy 2.3 from SpyComponents and start working with Schematron in XMLSpy now. There is also a simple Flash Demonstration that shows how quickly and easy it is to get started. Here's a nice link to a Schematron Tutorial, by Roger Costello, that also includes a few examples for download.

The Schematron demo uses the XSLT transformation of AltovaXML and assumes you have also gone into the advanced settings to set the following paths shown below.


To run the samples you need to change the schema namespace to the new ISO one. If you want to use a 1.5 Schematron namespace, (schema xmlns="http://purl.oclc.org/dsdl/schematron") you need to provide the XSLT in the settings and make the changes in the files before you can validate the xml files. You also need to download AltovaXML before-hand since this engine is used. With everything installed and setup correctly, you can now use XMLSpy to work with Schematron files. This is pretty cool because now you don't need to get up to speed and use another tool. For the time being you need to use project folders, but perhaps in the near future, validation will be possible by assigning a P.I. to the files. See screen-shot below that shows validation output when selecting the validate button under the Schematron tab.

In addition, the batch validation can also be used directly from XMLSpy... http://www.spycomponents.com/valbuddy/help/batch_howto.htm
A recent customer reported he is now validating 15000+ XML files using the command line tool.



Summary: XMLSpy enables you to create your own plug-ins and integrate them into XMLSpy. You can do this using XMLSpy's special interface for plug-ins. A description of how to create plug-ins is given in the section XMLSpy Plug-ins. Maybe a plug-in for RelaxNG support is next?

Tuesday, March 25, 2008

Altova at FOSE 2008

Altova at FOSE

Date: April 1-3, 2008
Location: Walter E. Washington Convention Center, Washington, D.C. Booth #1123
Exposition Hours: 10:00 am - 4:00 pm, Tuesday, Wednesday, and Thursday.

Altova will be at the upcoming FOSE Conference and Exposition, demoing their award winning software, and giving away free prizes!

If you've never been to a trade-show or got an opportunity to speak live with an Altova representative, this is an excellent opportunity. I'll personally be there to answer any questions as well as demo Altova software.

Feel free to add Altova, Inc. to your itinerary and please stop by for a great demo and free prizes! As always we love to hear great customer stories and meet all of our fans!

If you’re going to be attending FOSE, let me know!

Altova is General Services Administration (GSA) certified and you can find more details on the following page, http://www.altova.com/GSA_contract.html