Thursday, September 27, 2012

An OAuth Provider for Java based on Scribe

If you've been following my travels with ABBI, you know I recently embarked on developing a sample OAuth provider service.  A day later, and I've managed to implement it.  There's one bug with the URL decoding that I need to work on (basically, what starts out as a + winds up as a space later on).  This is intermittent, but not sufficiently so that I was unable to find it.  It shows up when dealing with tokens, so the quick fix is to swap out some characters when I create them.  The longer fix will be to figure out where the double decode is occurring.

I started with a Java OAuth client library known as Scribe, which has a lot going for it.   The solution includes the Scribe library, and 9 additional classes.  All told, it's less than 650 lines of code, and relatively sparse on documentation.  And I managed to get it to work in two days. Two days.  I'm done listening to complaints about OAuth complexity.

So, given my lack of copious documentation, here's an explanation of how this stuff works.

InvalidOAuthRequestException

public class InvalidOAuthRequestException extends Exception {
   public InvalidOAuthRequestException(String reason) {
   super(reason);
  }
}

This is an exception class that I use to report a variety of different reasons why an OAuth request might not be valid.  As far as my code is concerned, I don't need to differentiate these.  If someone sent the wrong data, the error message is enough to tell you why my provider rejected the request.  Classes don't get much shorter than this.

OAuthProvider 

public interface OAuthProvider {
  public Token getRequestToken(HttpServletRequest req) 
    throws InvalidOAuthRequestException;

public String authorizeUser(HttpServletRequest req) throws     
    throws InvalidOAuthRequestException;

public String getCallback(HttpServletRequest req) throws 
    throws InvalidOAuthRequestException;

public Token getAccessToken(HttpServletRequest req)
    throws InvalidOAuthRequestException;

public void validate(HttpServletRequest req)
    throws InvalidOAuthRequestException;

   public TokenRepository getRepository();
}

This interface describes a provider service, and contains six key methods.  In the OAuth workflow, there are four main steps:
  1. The first step is to get a request token.  The getRequestToken() method of OAuthProvider handles most of the effort.  It takes a HttpServletRequest that has been generated by calling the request token end point appropriately, and generates a new token. 
  2. The next step is dealing with the login flow.  Once it has a request token, the client needs to pass it the "login" page of the service provider.  The service provider can either accept or reject the users credentials, and the user can agree or cancel on the authorization.  
    1. If the user credentials are accepted AND the user authorizes the calling application to access their data, then a temporary token and verification string is created and the user is redirected to the client application with those values.  The temporary token is created using the authorizeUser() method.  That method returns the callback string which can be used to redirect the user appropriately.
    2. If the user credentials are not accepted, OR the user does not authorize the calling application, we need to return back to the calling application WITHOUT passing a temporary token.  That's what getCallback() helps with.  It generates the appropriate callback string to handle this "unauthorized" path.
  3. Having been authorized (following from 2.1 above), the client application now must request an access token.  The getAccessToken() method of OAuthProvider again, handles most of that effort.
  4. Finally, API requests need to verify that they are being accessed with a valid access token.  That's what the validate() method does.
  5. Tokens, Tokens, Tokens.  Every provider deals with a ton of tokens.  It has to be configured with a place to create and store these things persistently.  getRepository() provides access to the provider's token repository.

OAuthProvider10aImpl

There are number of variations on a theme that could be used to implement an OAuth provider.  I picked a few reasonable settings and implemented them.  It uses the HMAC-SHA1 signature method as the only method that it expects clients to use. I don't need the complexity of RSA-based signing, but I don't want to support PLAINTEXT signing.  

The core methods of my implementation follow the same general pattern:

  • Map the ServletRequest into an OAuthRequest.
  • Validate the signature of the OAuthRequest.
  • Perform some business logic with various OAuth parameters, manipulating tokens as necessary.
  • Return the token (or other data) needed for the next step.

TokenRepository

import org.scribe.model.Token;

public interface TokenRepository {
  enum TokenType {
    CLIENT_KEY,
    REQUEST_TOKEN,
    TEMP_TOKEN,
    ACCESS_TOKEN
  };
  public Token get(TokenType type, String key);
  public void put(TokenType type, Token t);
  public Token remove(TokenType type, String key);
  public Token create(String data);
  public boolean isNonceUsed(String nonce);
  public void saveNonce(String nonce);
}

The TokenRepository interface defines an interface to a persistent store of tokens, and provides a mechanism to create them.  It also keeps track of "nonce" values, single use values that ensure that replay attacks cannot be used in the protocol.  The get/put/remove methods work like the related Map methods.  In fact, my implementation of a memory based token repository uses just that as the backing store.  The isNonceUsed and saveNonce methods are interfaces to something like a Set.  The saveNonce() method adds the nonce to the set of previously seen nonce values.  The isNonceUsed method checks to see if a nonce has been seen before.  In the real world, you don't save every nonce forever.  Typically, you save those that have been used in the last 5-10 minutes, and refuse to process any request that has a time stamp that is older than that.

MemoryTokenRepositoryImpl

MemoryTokenRepositoryImpl is an implementation of the TokenRepository class.  It uses a HashMap to keep track of tokens and nonces.  The get/put/remove methods map into get/put/remove on  its hashmap with the TokenType prefixed to the key.  The same hashmap is also used to store nonce values, with "nonce:" prepended to the nonce value serving as the key.  It's a totally simple and useless implementation, unless of course you need something quick and dirty for testing.  In which case, it works just fine.

Tokens (and secrets) are created by generating about 24 bytes worth of random bits (using java.util.Random), and then base64 encoding the results, and splitting the string into two parts.  The first part becomes the key, and the second part the secret.

Util

This was really intended to be a utility class, but instead it is what does most of the heavy lifting.

public static OAuthRequest createRequest(HttpServletRequest req)

This method creates an OAuthRequet object (a class existing in Scribe) from an existing HttpServletRequest object.  OAuthRequest is the class that Scribe uses to generate signatures from, which is why I do this.  I don't want to have to regenerate the signature creation logic.  This method is called very early by each of the request processing methods found in OAuthProvider10aImpl.

public static Map<String,String> parseHeader(String header)

This method is used to parse the "Authorization" header of a request.  OAuth parameters can appear either in query parameters, as POST parameters, or in the Authorization header.  The parser is dead simple.  It splits content at sequences of commas and spaces, and then splits those into a name and value part.  Because of the very smart way that OAuth defined the OAuth schema for this header parameter, you can use a dump parser like this.  This method is called by createRequest above to read the Authorization header of a request and store the parameters into the OAuthRequest.

public static Verb getVerb(String method) 

This method maps a string into an appropriate enumeration type, turning "GET" into Verb.GET, and "POST" into Verb.POST.

public static Token validate(OAuthRequest r, TokenRepository tokens) throws InvalidOAuthRequestException

This method does the real work .  It checks the OAuth Version (1.0 only), ensures the request is not too old, verifies the nonce hasn't been used before, maps the consumer_key and token to a consumer_secret and token_secret, regenerates the signature and compares it to the existing one.  If, somewhere along the way, one of these tests fails, it throws an InvalidOAuthRequestException explaining the stage at which the failure occured.

public static String getSignature(OAuthRequest r, String consumerSecret, String tokenSecret)

This method computes the signature from the request, given the consumer and token secrets.  This is five lines of code.  It simply puts together the right parts from elsewhere in Scribe to generate the signature.

OAuthRequest

This is a servlet that implements the token request and access request endpoints.  It expects something implementing the OAuthProvider interface I described above to be stored in "OAuth.Provider" attribute of the application.  The doGet() method usually returns a 404 (but if the URL includes the word test, it duplicates doPut()).  The doPost() method gets the operation to perform from the end of the URL Path (either /request or /access).  It calls getRequestToken() or getAccessToken() appropriately from the OAuthProvider.  Then it writes the returned token to the response in application/x-www-form-urlencoded format.

init.jsp

The OAuthRequest servlet needs a provider.  This JSP creates one and stuffs it into the appropriate application attribute.

Authorize.jsp

This is my login page.  Right now, it looks something like this:

By entering your name and password below and clicking on "I Agree", you agree to the following:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Username: 
Password: 


The point demonstrated is that Authorization can be worded as "consent".

validateCredentials.jsp

 The whole point of OAuth is to validate that requests have been authorized.  So this page is a dummied up API call.  It looks something like this right now:


<%  response.setHeader("Content-Type", "application/json"); 
    OAuthProvider provider =
      (OAuthProvider)application.getAttribute("OAuth.Provider");
    try
    { provider.validate(request); }
    catch (InvalidOAuthRequestException ex)
    { ex.printStackTrace();
      response.sendError(401);
    }
%>{ 
 "Test": "This is a test",
 "name": "Hi Keith",
 "screen_name": "Did this work?"
}

It fails if you aren't sending an OAuth signed request, and succeeds if you are.  The content is just some JSON that my ABBI application knows how to process.

Download

Everything you need to build this OAuth provider is available for download on Google code.  Just download the ABBI-Auth project from svn here. 

Wednesday, September 26, 2012

An OAuth Provider for ABBI

My exercise for the past couple of days has been to build an OAuth provider for Java.  There are several reasons why I'm doing this.  The first is because when I started doing the security risk analysis, I realized that ABBI needs to be an OAuth provider, not a client.  My first implementation of Monday implemented the client.  Oh well, live and learn.

While there are plenty of OAuth Java frameworks for the client side, there were only a few for the provider side, and many of those required use of frameworks more complicated than I wanted to handle (e.g., Spring).  I suppose that someday I'll have to learn how to use these frameworks, but not right now.  I had already been using Scribe as my OAuth client framework.  It's really simple to use, and I was able to implement an OAuth client in about 4 hours with several interruptions included in that time.

Because both the OAuth client and the provider have to go through many of the same steps to verify a request, I wondered how difficult it would actually be to create a provider on my own.  So I decided to figure out how to take Scribe and use it to create an OAuth provider implementation.  I spent a good part of the day understanding the Scribe internals.  It's pretty clean code, and I found that I could reuse quite a bit of it to create the provider side.  One of the reasons I decided to stick with Scribe was because it was very light-weight.  Even so, like all gems there's quite a bit of capability if you look deep enough.

About halfway through this exercise, we had the ABBI Pull call, and several folks had raised concerns about OAuth and the effort their clients would need implement it instead of some other framework for accessing patient data.  For a lot of good reasons, I don't trust code not developed by security experts to secure my information.  OAuth has a lot of features that I understand to secure a connection.  Some OAuth-like structure that works in different ways with different sites just doesn't cut it for me.

So, yesterday's discussion about the access framework for ABBI reassured me that understanding how complex it would be to implement OAuth starting with just what I know, and a few additional tools, would probably be a good idea.

Today I'm about halfway there.  Having the client implementation helps, because it becomes part of how I test my implementation.  I did my original tests with ABBI using Twitter as my OAuth provider.  What I now needed to do was develop an OAuth provider implementation that I could direct ABBI at instead of Twitter.  Once that was able to complete the workflow correctly, I knew I'd be done.  I've completed testing about half the workflow.

I should be finished with the provider tonight, and I'll post about how it works tomorrow, along with the source code for anyone else who might be seeking a Java OAuth provider.  I expect that it will be fewer than 500 lines of code.  It won't be production code, in that it won't have all the cool enterprisy stuff like user creation and management, access controls, persistence, et cetera that you need for a full blown authentication server.  What it will have is the stuff you need to integrate what you already use for those things with OAuth, so that you can authorize other applications to access data via your application API.

-- Keith


Tuesday, September 25, 2012

Provisioning an Application to automatically find ABBI's BlueButton

One of the challenges for ABBI is how the user (the patient) will be able to find how to access their data from an application.  We could send them an e-mail they'd need to copy into their application, but that can often be challenging.  My big fingers are challenged typing in on my iPhone, and depending on what account you send the URL to, it might not be one that is accessible on my iPhone.

But I can readily point a browser to my favorite sites.  In fact, those are pretty easy to find on any of my devices.  So what if we made it possible for the provider website to "provision" the third party application that wants to access my data?

If you view source on this website, you'll find the following links in the HTML header.

<link rel="alternate" type="application/atom+xml"
  title="Healthcare Standards - Atom" 
  href="http://motorcycleguy.blogspot.com/feeds/posts/default" />
<link rel="alternate" type="application/rss+xml"
  title="Healthcare Standards - RSS" 
  href="http://motorcycleguy.blogspot.com/feeds/posts/default?alt=rss" />

These are commonly understood by browsers to be the where  the atom and RSS feeds for this web site are found.  Because of those, browsers are able to automatically identify the feeds, and allow you to subscribe to the site.

[I'll give you just a brief moment to subscribe to this site...]

Every patient portal that wants to support ABBI should have a similarly easy mechanism to point their users to the search URL that the application needs.  That way, third party applications can readily be configured by just pointing them to the patient's portal, and they'll automatically configure themselves correctly.

The <link> tag has several attributes:
rel
The relationship between the content and the linked URL
type
The mime type of the linked URL
title
The title of the content associated with this link
href
The URL to go to get the linked content
Type is a mime type, and so cannot be used to identify ABBI content distinctly from other sorts of content.  After all, what I'm proposing is simply application/atom+xml, the same as what I use for my blog above.  Title is supposed to be the human readable title of the content.  We want that to be customizable by portals, and so would not want to fix that value.  An href is where we need to go.  We could standardize the URL (and in fact, in my specifications, I have), to some degree.  So it could be uniquely identifiable as the ABBI endpoint.  But I don't like that answer.

HTML defines a number of standard relationships, including alternate, appendix, bookmark, chapter, contents, copyright, glossary, help, home, index, next, prev, section, start, stylesheet, and subsection; but none of these are really appropriate in any case.  So, let's just use ABBI as the value for rel.  If the portal has a <link rel='ABBI'>, then an application could know to use that as the endpoint for requests.


<link rel="ABBI" type="application/atom+xml" 
  title="Automated Blue Button Download" 
  href="URL to atom search feed" />

This same sort of mechanism is widely adopted not just to associate feeds with a web page, but also stylesheets, icons, and a number of other readily accessible resources.  We just use this with ABBI to make it easy for applications (and users) to navigate the their data sources.

  -- Keith

Monday, September 24, 2012

ABBI Security

Designing for Security is incredibly important.  As John Moehrke will often tell you, you shouldn't be adding it as an afterthought.  The key to securing the ABBI Protocol that I'm proposing are the two URLs it exposed.  These are originally specified by the IHE Mobile Access to Health Documents profile (and will be subtly modified in my proposal):

Search: https://<location>/net.ihe/DocumentDossier/search[.atom|.json]
Document Access: https://<location>/net.ihe/Document/<entryUUID>/

The first is the search URL which returns the atom feed or json representation, and the second is used to access possibly transformed document content.  These two URLs must be secured using SSL (ideally TLS, but I'm not going to require that for other reasons), and the user (the patient) must also somehow "log in" to the application.  

Securing my web application ought to be straighforward.  I'm using Tomcat, JSP and Servlets, and web application security is pretty much built in to the deployment model.  I identify the resources that need to be secured (the two I mentioned above) in a <security-constraint> element in my deployment descriptor:

<security-constraint>
  <web-resource-collection>
    <web-resource-name>SecurePages</web-resource-name>
    <description>Security constraint for ABBI Resources</description>
    <url-pattern>/net.ihe/*</url-pattern>
  </web-resource-collection>
 ...


Indicate the required user role:
 ...

  <auth-constraint>
    <description>only let users login </description>
    <role-name>user</role-name>
  </auth-constraint>
 ...



Specify the degree of content protection needed:
 ...


  <user-data-constraint>
    <description>SSL required (Change to NONE for testing ONLY)</description>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
  </user-data-constraint>
 ...



And lastly indicate how the user is to login:
 ...


  <login-config>
    <auth-method>?</auth-method>
  </login-config>
</security-constraint>




Now here is where it gets tricky.  To demonstrate how logins are secured, I want to use OAuth.  I'm not going to use OAuth 2.0 just yet (because it is harder to demonstrate).  My first step will just be to demonstrate secure access via OAuth 1.0, as employed by Twitter.

Unlike common authentication protocols, these don't typically deal with usernames and passwords.  Instead, the OAuth protocol deals with three separate sets of credentials.  The first set belong to the application (e.g., my ABBI Server), and are simply used to request a temporary set of credentials (which are the second set). That second set of credentials are sent by my server to the by the end user's credential holder site (in this case Twitter), to authorize my application.  Twitter returns to my server the final set of credentials, which are what my ABBI server uses to perform requests on the user's behalf.

All I will be doing with those credentials is getting back the user's Twitter handle, and that only to demonstrate that I've successfully authorized my application.

I have four choices for how to enable the user to log in.  These are:
  • BASIC: Uses HTTP-Authorization headers and the Basic Authentication method.
  • DIGEST: Uses HTTP-Authorization headers and the Digest Authentication method.
  • FORM: Uses form based authentication with specified parameters for 
  • CLIENT-CERT: Authenticates using a client certificate

None of these is a perfect match for what I want, but of the four, FORM is the closest to what I need. Here's a classic example of a login page:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Login Test: Login Form</title>
</head>
<h1>Login Form</h1>
  Welcome to the login page.
    <form method="POST" action="j_security_check">
      Username: <input type="text" name="j_username"><br />
      Password: <input type="password" name="j_password"><br />
 <br />
      <input type="submit" value="Login">
      <input type="reset" value="Reset">
    </form>
</html>


Clearly, that isn't the "OAuth" way.  So there's a bunch of stuff I need to do to hack this into what I want. Here's how I think I can make it work: 
  1. In my ABBI Server, I'll send a POST Request to Twitter's request_token URL.  It's authorization header will contain my application's "login credentials".  
  2. Twitter will respond to my server with three parameters containing the credentials needed to authorize the application.  These will become part of a URL request that will appear within a frame and/or dialog the my server will create in the page and which will be launched for the user. 
  3. After the user logs in to Twitter, the Twitter authentication page will redirect the user back to my application (in that frame and/or dialog), passing back appropriate application access credentials.  
  4. My server will store the application access credentials, and will send back some sort of fake values for j_username and j_password that will make my web application server happy.

I ought to be able to create a form that will do the necessary, which means I can insert the following for the login-config portion.

  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>ABBI</realm-name>
    <form-login-config>
        <form-login-page>/login.jsp</form-login-page>
        <form-error-page>/lerror.jsp</form-error-page>
    </form-login-config>
  </login-config>



This step is probably going to take me a bit of time, because I've never done it before, and there are lot of tricky bits.

There's a bunch of easy stuff that follows this step, but I'm taking the approach that I need to work on the hard stuff first.  While OAuth isn't rocket science, it certainly qualifies as the most risky component of my prototype right now.  Everything else is pretty-much "rote" programming that I know can be done, even if I haven't written the code yet.  This is the one part that I'm not so sure about.  Even though it isn't using the same version of OAuth that RHEx has specified, I feel comfortable enough that if I can demonstrate OAuth 1.0, that eventually, I'll be able to plug into 2.0.  That's just an incremental refinement.

For demonstration purposes, I'll need to link the Twitter account to a patient identifier.  In real life, the application would get that via an API call to the service protected by the OAuth access credentials.  This could also be done using PIX/PDQ.  The provider offering the service would request the user to supply a user id (e.g., a Twitter account) that only they had access to.  That service would register that identifier with a master patient index.  When the user "logged-in" to the ABBI service, we'd get the account identifier that they logged in with, and query the master patient index using PIX to get the associated patient identifier that the registry used to provide access to the patient records.

As I finish this, I realize that I need to do a security risk assessment for this application.  Sounds like another blog post.

  -- Keith

Friday, September 21, 2012

Happy Friday: Time for Wave 3

Just in case you had nothing better to do this weekend...

HealthIT.gov
2014 Draft Test Methods: Wave Three Released for Public Review and Comment
The Office of the National Coordinator for Health IT (ONC) is pleased to announce the release of the third set of 2014 Edition draft Test Methods (test procedures, tools, and applicable test data and files).

All Test Methods will undergo public review and comment before being finalized and approved by ONC for use in testing and certification. The final set of Test Methods is expected to be available for use in early 2013.

Comments and suggestions should be submitted to
ONC.Certification@hhs.gov. All submissions should include "2014 Test Methods" in the subject line. Please be as specific as possible in your comment submission.

For additional information, and to access the 2014 Edition draft Test Methods, please visit the 2014 Edition Draft Test Procedures webpage.
.


ABBI's First Data Holder Connection to IHE XDS via OHT

I started my ABBI Prototype yesterday by refreshing my development environment.  The next step was to ensure that I could connect my application to a Web Service that would provide data I could start playing with to develop the service.  I spent several hours last night trying to get it to work and went to bed having not succeeded.  Today, I finally got it to work.

The architecture for my prototype is based on the IHE Documents for Mobile Health profile.  It will respond to RESTful queries by reformatting them into XDS/XCA queries to an Initiating Gateway, and return responses that reformat the ebXML gunge response into an Atom feed that is much more useful for developers.  So, my first step was to connect my application to the NIST XDS Test Facility on the intertubes.

I've used this in the past, but it's been a while.  Refamiliarization took a little bit of time.  When connecting to the NIST Test facility as an XD* Client, the first thing you need to create is a patient identifier.  It took me a bit to find this page where I could do that.  That page also points you to testing tools that allow you to perform queries on that identifier, submit test data, and a bunch of other goodies.  It's great that I don't have to create a full blown XCA Server just to test my prototype.

Having now created a patient, and given them a document, my next step was to ensure that I could create an application that would be able to do the same.  As I mentioned previously, I'm using the Open Health Tools IHE Profiles project to do that.  This is where I got stuck last night.  I'm apparently an odd-ball, in that I like to write POJO's to do the work, rather than adding a bunch of other stuff.  I suppose I could have used the Bridge to make life easy, but that requires I configure another service, and I'm always swapping Tomcat in and out depending on what I'm up to right now.  It's not like I have extra computers devoted to my build/deployment environment.  It's all running on my laptop.

The challenge I learned later has to do with the way that Axis2 works.  It needs to be configured with an XML file that you have to tell it where to find.  That doesn't come with the ihetools project of OHT.  You have to pull it from another project.  It also likes to be in charge of class loading.  This is in part because you need to be able to maintain several versions of a handler in memory at the same time to deal with different possible cases where messages can be handled in various ways, with multiple services running at the same time, et cetera, and so on.  So, rather than putting certain things in my classpath, like I'd expect (or in WEB-INF\lib), I had to do things differently.  Axis 2 is cool.  But it's also enterprise class software, and quite honestly, for a client application, is probably overkill.

Somewhere along the line, I decided to replace the Axis jar that shipped with OHT with the original jar files that come from the Apache Axis project.

It took me quite a while to figure out how to make things run, but eventually, I figured out the right command line switches, and everything worked.  Today, I was able to verify that I could connect to the NIST Test Registry and get metadata about my test patient's documents in a simple POJO with a main() method.  The next step was to make sure that my Web Application, which would be serving up the ABBI API could do the same.  It turns out that starting Tomcat with the same JVM switches solves the problem.  It's NOT the right way to do it, but it works.  I can dink with classpaths and server.xml files later.

My first test isn't connecting to the NIST Registry securely.  To do that, I need a certificate.  I think I have one from last year that still works, and I'll be getting a new one for the connectathon this year.  For now, I know what needs to happen, and how to secure that link.

My next steps are to figure out how I want to set up the prototype to show off what it can do.  Now that I know I can get to the data, generating queries from RESTful API and transforming results into atom are just a simple matter of writing code.

  -- Keith



If you are an OHT User, these notes might be helpful to you if you just want to write simple Java command line applications to access an XDS Registry.
  1. Download the IHETools ZIP File from OHT
  2. Unzip it and copy the resulting JARs to location1.
  3. Rename  location1/org.apache.axis2_1.4.1.jar to location1/org.apache.axis2_1.4.1.bak
  4. Grab Axis2 from Apache's web site (I used V1.4.1) and unzip it to location2.
  5. Download axis2.xml from here and put it in location3.
  6. Copy location2/repository/modules/addressing-1.41.mar to location1/addressing-1.41.jar
  7. When you run your Java application, add these parameters:
    1. -Djava.ext.dirs=location2/lib 
    2. -Daxis2.repo=location2/repository
    3. -Daxis2.xml=location3/axis2.xml
    4. CLASSPATH=location1
These do several things:
1.  Makes Java happy about where to find and how to load certain Axis classes.
2.  Makes Axis Happy.
3.  Configures Axis to generate SOAP Headers.
4.  It makes it possible for your application to find the addressing module which is needed to generate those SOAP headers.


Thursday, September 20, 2012

Fall is Coding Season

After not having tested anything personally at an IHE Connectathon in a couple of years, I'm now back to some hard core coding this fall in order to deliver on about three different projects from the same code base:

My goal is to use the same code base to:

  1. Test the IHE Mobile Health Documents Profile at the IHE Connectathon in Late January
  2. Create an ABBI Prototype for the ONC S&I Framework
  3. Test a FHIR Profile for Document Access at the HL7 Connectathon in Early January
The specifications all vary to some extent at this point, but are being converged.  This particular experiment will help me identify the common core, and essential variants for each of these different initiatives.

Given that it's been a while, it's time to refresh my development environment.  I've been using Java 1.6, Eclipse 3.2, Tomcat 5.0 and Axis 2.1.3.  

I won't have to change my Java Runtime or Development Environment, as that is easy to keep up to date.
I do need to upgrade at least to Eclipse Helios (3.6.2),  because that is what my preferred IHE Profile library needs.  I'll be installing Open Health Tools IHE Profiles 2.0 and MDHT 1.1.  Apache Tomcat is now at release 7.0, but I don't yet know what version I'll be using, or which works best with my development environment.  If I can, I'll stick with Tomcat 5.0 because the few things I have to change, the better off life is.  If it works in Tomcat 5, it'll work with later releases.

I have no clue if I'll even need to worry about new releases of Xerces and Xalan.  I expect I won't have to, since those have been correctly configured in my development environments without any outside action be me for the past several years.  It used to be I had to mess around to get the right editions that could do what I need to.  These have stabilized to the point that I rarely have needed to mess with them, and only when I was dealing with optimization (e.g., pre-compiling stylesheets).

Downloading and installing Eclipse was easy.  I love apps that say "extract" the zip, run the app, done.  Configuring my workspace to support MDHT was hard, probably because I should have done something simple like copy files rather than import the existing MDHT Workspace folders.  I never could figure out what the problem was with .JetEmitters, so I blew away the new workspace, and used the MDHT supplied one.  I don't quite like where it lives, but I can live with that.

One challenge I had with MDHT was that my default JRE is 1.6, but MDHT likes 1.5 (which I also have, I keep a few editions laying around).  So I had to configure Eclipse to know where to find that.  Then after refreshing the projects, everything was OK as far as I could tell.

I've downloaded the OHT IHE Libraries, and my next step is to figure out how to connect to the NIST Test Registry.  Once I've figured that out, I'll write a short (I hope) post on how to accomplish that.