Archive for category Web Services

What should go into the UW Web Services Registry?

In a recent ROA Technical team meeting we discussed as a team what things should and should NOT go into the Registry. The intention is to expand the scope of the Registry to list all useful programmatic web end points including RSS & ATOM feeds vs just focusing on web services designed and built by UW developers. The goal for the Registry is to be the first stop for developers needing programmatic access to UW data over the web.   Let us know if you think there are other things we should add or remove from the list.

What should go into the Registry?

  • Something that is accessible over the web (in other words uses http)
  • Contains UW data
  • The content is machine parseable (json,xml,xhtml)

What should NOT go into the Registry?

  • Oren’s Blog (RSS/Atom feed)
  • A link to an HTML page that is NOT XHTML strict

No Comments

How to request content types (XML, XHTML, JSON, etc.) from RESTful services?

How should web services determine the format of a response to a client? Or how does a client ask for XML, XHTML, or JSON?

This question is becoming more pressing as UW web services such as the Student Service, Financial Service, and ID Card Service begin to expand their format offerings. These services began with just XHTML, largely due to how conveniently it renders in a browser, but a growing number of developers have vocalized their desire for a more terse XML format that works with their libraries and tooling that read XML, but not XHTML.

In our recent discussion of this issue on the ROA Technical team, we considered several options for how to request content type:

  1. URI query string

    GET /books/12345?format=xhtml HTTP/1.1

  2. URI file name extension

    GET /books/12345.xhtml HTTP/1.1

  3. Content negotiation using the Accept header

    GET /books/12345 HTTP/1.1
    Accept: application/xhtml+xml

There is plenty of debate about which is the better approach.

In their book, Richardson and Ruby prefer the explicit URI specification over the content negotiation:

Unlike humans, computer programs are very bad at dealing with representations they didn’t expect. I think an automated web client should be as explicit as possible about the representation it wants. This almost always means specifying a representation in the URL (RESTful Web Services, 94).

We lean that way, too, and prefer the URI file name extension option. It’s intuitive from all of our Web browser years; it’s simple; and it’s easy to test in a browser (you don’t have to monkey with headers).

We also think services should expose a default extension-less URI that either redirects to the .xhtml/.xml resource or returns a location header to it.


GET /books/12345 HTTP/1.1

Even though we think that the URI file name extension option is preferable, we’re not too religious about it. As long as the contract is made clear, any of these three methods are acceptable.

Let us know what you think.

2 Comments

Repost: “An invitation to build with the UW’s Student Web Services”

The following entry was published on the Office of the University Registrar’s blog earlier this week. It’s relevant to On the ROA readers, so it’s reposted here for convenience.

The term “web services” has been used frequently on this blog when discussing new tools for the University community. Some examples include m.UW, the UW’s iPhone app; an improved course catalog search; and Kuali, the next-generation student software initiative. With the fourth version of the Student Web Services (SWS) open and available for use, it’s time that the Office of the University Registrar officially invite interested developers (and their managers!) to dive and start creating new, useful tools.

Okay, but how do I start?

That’s a good question. Here are the ingredients necessary to get a SWS project off the ground:

  1. Join the community – The UW’s web services community is strong, and if you’re going to develop something using SWS you should get to know it. Read On the ROA, the UW’s web services blog; review ideas from other developers at UserVoice; and stop by at a Web Services Discussion Group meeting. Sign up on the “appdev@u” mailing list to be notified of meeting dates and locations.
  2. Identify a need – Have you wished there was a site that did X? Are your students asking for Y? Want to find a better way to display Z? Once you’ve identified something to build, fix, or improve upon, you can plan a web site, iPhone application—or something else—to accomplish it using the data available to you (see number 3).
  3. Research the services at your disposal – The Web Services Registry is a maintained list of UW web services, including a description and links to documentation and a contact person. You can also submit your own UW-centric web service to the registry. But don’t limit your idea to UW-specific data; maybe there’s another dataset that you could mash up it up with?
  4. Build it – Web services really shine when it comes to accessing data. If you’re using public information you can simply access the service you want and start using the data returned. And it’s easy to do so regardless of your preferred language: PHP, Python, .NET, Ruby on Rails, etc. There’s a PHP class already available to simplify things even further; a .NET version is in the works.

What about an example?

Part of the reason for inviting the community to built tools with SWS is the “serendipity” factor. With pubicly-available data and a whole community of smart people, the sky’s the limit on what sort of useful tools might emerge.

An example is the recent improvements to the University’s course catalog search. A developer in the Office of the University Registrar saw the data available, knew of the issues with the current Google-based search, and built a prototype replacement in just a few days. A presentation of this tool’s development was recently given at the Office of Information Management’s Community Forum (the developer’s slides are available for download).

So go ahead: wow your students and the University as a whole with your creation. Show us the tool we didn’t know we couldn’t live without.

2 Comments

Catalyst GradeBook is now using the IdCard Photo Service

Instructors can now see their students as they assign grades, thanks to the IdCard Photo Service.  Now that Catalyst is consuming this service, we plan on taking advantage of it in many other Catalyst Tools in the near future.

1 Comment

Use UserVoice to prioritize campus Web services

UserVoice is our catch basin for Web service ideas, and if it ain’t there it’s probably not going to happen. At UserVoice you can share your Web service ideas, vote for ideas submitted by your UW colleagues, and join the discussion.

These ideas submitted to UserVoice have become a reality or are underway:

* Course description available in SWS

* Course url available in SWS

* Publicly available student Web services

* Person Web service

* Publicly available IdCard Web service

* Student transcript data

* Classroom scheduling Web service using R25 data

 Make your voice heard at: http://ontheroa.uservoice.com/

No Comments

Web Services Registry now in the Cloud

Yes, it finally happened.  We moved the registry over to the mystical, magical cloud. There were a few bumps in the road but nothing so tragic or unique that it took much time to solve. Most of the issues were not specific to the cloud but more to the migration itself.

Amazon EC2 was chosen for hosting the project for its infinite scalability and general developer friendliness. Tony had some prior experience with the environment which certainly helped smooth many of the potential pitfalls. The control panel is really a breeze to use and the whole migration was really straightforward.

There certainly was a process as it was more involved than other hosting environments, but once done is really a set and forget operation. We mapped out the backup strategy to make sure we had a path forward just in case by using some of the built-in tools. We used a really basic Ubuntu image and then installed the environment for the application.

The application switch occurred several weeks ago and we’ve had no major problems. We look forward to continually improve the application and now we have a stable platform for some really great changes. Until then please submit some services to the registry, you’ll be glad you did.

, ,

No Comments

Financial Web Service (FWS)

Version 1 of the Financial Web Service (FWS) is now in production. It provides access to UW budgets, vendors and organizations, including search capabilities, from a near-real-time data source. Several developers are already developing or modifying existing applications to use it. More information can be found in the documentation.

No Comments

Using the photo resource of the IdCard service

Since 2001, the Computer Science department has maintained its own collection of photos of CSE faculty, staff, and students.  We have a number of web apps such as photo directories or class lists that display these images.  We long ago settled on a standard size for the images and developed a procedure for adding a person’s name to the image.  But with Autumn quarter bringing in close to 200 new students, the process of capturing and processing these images is a lengthy one.

With the release of the IdCard web service this quarter, the work involved has dropped to near zero.  We can now automatically retrieve a student’s photo from the IdCard service rather than taking our own (note that by policy, we can only retrieve student photos, not those of staff or faculty).  Our undergrad program alone admitted 105 new students this quarter, and if we assume 10 minutes per photo, it would take over 17 staff-hours to collect all photos.  I was able to modify our existing infrastructure to take advantage of the IdCard service in one afternoon. This quarter alone, the time savings is huge.

The process was simplified because access to our local store of photos all went through a single PHP web app.  Students have the right to opt-out of having their photos displayed to the public or their peers, and one of the main jobs of this application was to control access to the photos depending on the person making the request.  My strategy is first to look in our local store of photos, and if one is not found then to try the IdCard service.  If found there, the photo is retrieved, normalized to our standards, and then stored locally.  The next time the photo is requested, it is found in local “cache” and no request to the web service is needed.

The design of the IdCard service makes this task quite easy.  The photo resource lets you retrieve the photo in the size that’s most convenient to you.  I request the photos in our standard dimensions and then use the PHP interface to the GD image processing functions to add a student’s name to the image.  That image is then stored locally along with all the others, and all of our existing infrastructure now takes full advantage of the IdCard’s photo resource.  If we wish to “override” one of the ID card photos, we simply take and upload a person’s photograph as before, and the new one is served preferentially.

One side-note is that, as with most web resources concerning students, the native identifier for a person is his regid.  We had never before used regids, keeping instead system_key and uwnetid for each user.  In order to collect regids, we use the person resource of the SWS to do a system_key to regid translation, and then save the regid locally so that this translation only happens once per person.

The listing of the IdCard service in the registry is awaiting some polishing of the documentation (restricted) but expected soon.  For access, contact Tony Chang or Paul Schurr.  To use this service, you will need to obtain a test and a development client certificate for your application which you will use to authenticate to the IdCard service.   Permission to use the resource is granted by the registrar, and before getting the final OK, you and they will do a short security review of your application.  It’s all easier than it sounds, and if you get stuck you can contact roa-technical@u.washington.edu and they’ll hook you up with someone who can answer your questions.

No Comments

Simple PHP Rest Client

A couple folks here at the UW Seattle campus and I created a  SimpleRestClient class to help PHP devs programmatically consume RESTFul X.509 protected web services using PHP cURL. We feel that there is a small hurdle in developing against X.509 certificate protected web service resources so quickly created something to help PHP devs jump over that hurdle in addition to other challenges.

You can download the PhpRestClient and associated SampleApp from GitHub. BTW Github is the source control repository that we are using to host our UW Web Services Registry code.

http://github.com/tonychang/PhpRestClient (click on the download button)

You can simply untar the files into the same directory and run the sample app from any webserver with a current version of PHP on it.

Since this code was contributed by developers at multiple UW departments we consider this an UW Community Source project. Yea I just made up the term right now but think it has a nice ring to it. If you want to help contribute to the project just let me know and I can get you added as a GIT contributor.

This is just a first iteration of it and its possible that someone will add additional features like supporting all the HTTP methods (vs just GET and POST) and allowing for Basic/Digest HTTP authentication.  Stay tuned for something similar to help .NET devs.

The code is not officially supported but we are happy to answer any questions you may have.

Developers:

Dan Boren – Computer Science and Engineering

Tony Chang – Office of Information Management

Paul Hanisko – College of Education

No Comments

One developer’s perspective on the SWS’s course search resource

The Office of the University Registrar (OUR) recently posted an entry on its blog about an improvement to the course catalog search, aptly titled “Course catalog search, at your (web) service.” That entry discusses the improvements in the catalog search in terms of features and usefulness to students. It mentions the UW’s Student Web Services (SWS), but doesn’t go into detail, as that blog’s audience likely isn’t interested.

You, dear On the ROA reader, are. Let’s dive in.

Read the rest of this entry »

,

No Comments