The i-Technology Media!
Register | Log in
   
 
.NET  ·  AJAX  ·  CLOUD  ·  ECLIPSE  ·  FLEX  ·  OPEN WEB  ·  iPHONE  ·  JAVA  ·  LINUX  ·  OPEN SOURCE  ·  ORACLE  ·  PBDJ  ·  SEARCH  ·  SILVERLIGHT  ·  SOA  ·  VIRTUALIZATION  ·  WEB 2.0  ·  WIRELESS  ·  XML
Comments
Drool, Britannia? Is the UK Failing the Cloud?
By Roger Strukhoff
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Jan. 8, 2012 11:38 AM EST
read more & respond »
Cloud Expo on Google News
Did you read today's front page stories & breaking news?

Cloud Expo & Virtualization 2011 West
Keynotes
Oracle
Opening Keynote | An Enterprise Cloud for Business-Critical Applications
Abiquo
Day 2 Keynote | The Enterprise Cloud Tightrope - Balancing for Success
Akamai
Day 3 Keynote | The DNA of an Enterprise Cloud
DIAMOND SPONSOR:
Oracle
Many Clouds, Many Choices'Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Enterprise Cloud Best Practices - Town Hall - Join the discussion…
PLATINUM SPONSORS:
Intel
Progressing Toward the Federated, Automated and Client-Aware Cloud
New Relic
How to build an app with Twitter-like throughput
Rackspace
Computing in the Cloud Era
GOLD SPONSORS:
Gale Technologies
Practical Cloud Migration
IBM
Re-think IT. Re-inventing Business.
Intel/McAfee
Identity Driven Security in the Cloud
PerspecSys
Hackers Hackers Everywhere, Is My Public Cloud That Safe?
Red Hat
Unlock the Value of the Cloud
SHI
Mission Critical Applications and the Cloud - Myth or Reality?
SoftLayer
Not Your Grandpa's Cloud
Terremark
Integrating Enterprise Clouds
VMware
Upgrade to a vCloud
POWER PANELS:
Cloud Expo Silicon Valley: CTO Power Panel
Cloud Expo Silicon Valley: CEO Power Panel
Cloud Expo Silicon Valley: Cloud SuperStars Panel
Cloud Expo Silicon Valley: CloudNOW Panel
Click For 2010 West
Event Webcasts
Cloud Expo & Virtualization 2011 East
DIAMOND SPONSOR:
Dell
Dell & VMware Deliver the Enterprise Hybrid Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Are Financial Services Organizations Risking Security by Avoiding Cloud Computing?
Oracle
From Consolidation to Enterprise Private PaaS
PLATINUM SPONSORS:
Intel
Driving the Transformation to Next Generation Cloud Data Centers
Rackspace
The Inevitability of an Open Cloud
GOLD SPONSORS:
CA Technologies
Follow YOUR path to Cloud Computing
Interxion
Who Keeps the Cloud in the Air?
Microsoft
Patterns for Cloud Computing
PerspecSys
War in the Clouds: Are you ready?
ServiceMesh
The Big Win: Stop Playing Small-Ball with Your Cloud Strategy
Terremark
Evaluating Enterprise Clouds
Xiotech
Cloud Storage: Myths and Realities
POWER PANELS:
Cloud Expo New York: CTO Power Panel
Cloud Expo New York: CEO Power Panel
Cloud Expo New York: CMO Power Panel
Cloud Expo New York: Wrap-Up Power Panel
Click For 2010 West
Event Webcasts
Live Google News by SYS-CON!
Top Three Links You Must Click On


Ajax Proxy for Web 2.0 Feature pack - quick look

By: Kevin Haverlock
Dec. 2, 2008 03:59 PM

The security model of modern browsers dictate that XMLHttpRequests (Dojo.xhr style requests if using the Dojo Toolkit) must have the same domain in order to connect and exchange data. From a security perspective, that is a good thing and helps make your web application secure from outside influence. The problem is that it makes cross site mashup creation downright difficult.

There are a couple of options that have been proposed:

Flash: A proprietary solution that requires learning Adobe's programming model. Requires the deployment of a crossdomain.xml file.

JSONP: proposed by Bob Ippolito, JSONP is a script tag injection which passes the response from the server (normally JSON) into a user specified function.

Proxy: Using a service that marshals requests to the server. Since the Proxy is located on the same domain, the content appears to originate from the same server.

Lets look at the proxy option as a it relates to the Web 2.0 Feature Pack for WebSphere Application server. The Ajax proxy is a lightweight proxy application that is used by Ajax clients to issue out of domain requests. As an example, your web application may access various RSS sites outside of the your original domain to display current news information.

Under the covers the Ajax proxy uses Apache's HTTPClient to handle connecting to other servers and passing the results back to the Ajax client. On top of HTTPClient is code that provides a configuration interface that can be used to tailor the proxy. The customization include context mapping, white-listing, filtering based on cookies, mime-type, HTTP verbs (POST, GET, etc). The end result is a highly customizable Servlet proxy that can be embedded into your JEE application to provide proxy services. At the heart of the Ajax proxy is the proxy-config.xml configuration file. The configuration file is located in your WEB-INF/ directory of the Ajax Proxy WAR file.

The listing shows a basic proxy configuration that is used to access two services. In this case Yahoo's and CNN's RSS feeds. Lets walk through the configuration.

<?xml version="1.0" encoding="UTF-8"?>
<proxy:proxy-rules  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:proxy="http://www.ibm.com/xmlns/prod/sw/ajax/proxy-config/1.0">
	    
    <proxy:mapping contextpath="/rss/tech"          url="http://rss.news.yahoo.com" />    
    <proxy:mapping contextpath="/rss/cnn_world.rss" url="http://rss.cnn.com" />
            
    <proxy:policy url="http://rss.news.yahoo.com/*" acf="none"> 
        <proxy:actions>
	    <proxy:method>GET</proxy:method>
	</proxy:actions>  
    </proxy:policy>
    
    <proxy:policy url="http://rss.cnn.com/*" acf="none">
       <proxy:actions>
	    <proxy:method>GET</proxy:method>
	   </proxy:actions>  
    </proxy:policy>       

    <proxy:meta-data>
         <proxy:name>maxconnectionsperhost</proxy:name>
         <proxy:value>2</proxy:value>
	</proxy:meta-data>	
     <proxy:meta-data>
         <proxy:name>maxtotalconnections</proxy:name>
         <proxy:value>5</proxy:value>
	</proxy:meta-data>	

The <proxy:mapping> sets the contextpath for the URL of the service you are connecting too. As an example, if you are trying to access http://rss.news.yahoo.com/rss/tech from your site, then the contextpath would be /rss/tech and the matching URL would be http://rss.news.yahoo.com. When it comes time to access the service through the proxy, you would use the <servlet-mapping>

	<servlet-mapping>
		<servlet-name>ProxyServlet</servlet-name>
		<url-pattern>/proxy/*</url-pattern> 		
	</servlet-mapping>

combined with the context root mapping of mysite. As an example, if the Ajax proxy Servlet is accessed from http://localhost/mysite/proxy then the URL for Yahoo's news service would be http://localhost/mysite/proxy/rss/tech.

The <proxy:policy> defines a policy to be used against the URL. In the case of http://rss.news.yahoo.com, the <proxy:method> states that only a HTTP GET request is supported on the URL. Other requests, such as POST will be rejected by the Ajax proxy. In addition >proxy:method<, other rules can be applied such as preventing cookies, allowing only certain mime-types and http headers.

Additionally, performance tuning can also be done against the Ajax proxy. The parameters correspond to those that are available Apache's HTTPClient and can be used to fine tune the Ajax proxy. The <proxy:meta-data> contain optional parameters. The maxconnectionsperhost is a global value that specifies the maximum number of connections kept alive for any host or port combination and can be increased if your site access more than two remote sites for content. The maxtotalconnections is the maximum total of connections supported by the proxy. The default value is 5. The value you choose must be a high enough to support the number of simultaneous connections you might receive. In reality, the maximum connections will also be dependent on how WebSphere's Web container is configured.

There are additional parameters as well, including unsigned SSL certificate support, pass-through proxy support (in case the Ajax proxy needs to authenticate through a border firewall before accessing the network). Information and parameters are available with the documentation and can be found online through IBM's InfoCenter for the Web 2.0 Feature Pack.

Kevin Haverlock

Read the original blog entry...

Published Dec. 2, 2008— Reads 1,443
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
About Kevin Haverlock
Kevin Haverlock is an advisory software engineer for IBM's WebSphere Application Server product. He joined IBM in 1995 at Research Triangle Park, NC, where he worked as a developer for the Tivoli division. In 2000 he transferred to the WebSphere Application Server organization and is currently an architect and developer for the WebSphere Application Server Express product.

Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers

ADS BY GOOGLE

Breaking Java News
Research and Markets: Global PT Testing Market: US, Europe, Japan
HazelTree and Treasury Curve to Partner
Fourth Annual IPAC/Deloitte Public Sector Leadership Awards Recognize Innovation
Global Interior Design Survey 2012: Changes in Product Demand, New Technology Trends and Interior Design Materials
Media Advisory: Premiere Screening of the First Episode of Operation Unplugged Tv Series, Attended by Minister Peter Kent and Cast Members
AmCham-China Statement on Vice President Xi Jinping's US Visit
BMO Credit Card Health Check: Prognosis is Good for Credit Card Users as Two-Thirds of Canadians Paid Off Their January Credit Card Bill in Full
Neopost Wins Business Info Editor's Choice Award for Its Versatile DS-35 Folder Inserter
Desert Gold Announces an IP Anomaly Discovery on the Farabantourou Permit
GOOD MORNING

ADVERTISE   |   MAGAZINE SUBSCRIPTIONS   |   FREE BREAKING-NEWSLETTERS!   |   SYS-CON.TV   |   BLOG-N-PLAY!   |   WEBCAST   |   EDUCATION   |   RESEARCH

.NET Developer's Journal - .NETDJ   |   ColdFusion Developer's Journal - CFDJ   |   Eclipse Developer's Journal - EDJ   |   Enterprise Open Source Magazine - EOS
Open Web Developer's Journal - OPENWEB   |   iPhone Developer's Journal - iPHONE   |   Virtualization - Virtualization   |   Java Developer's Journal - JDJ   |   Linux.SYS-CON.com
PowerBuilder Developer's Journal - PBDJ   |   SEO / SEM Journal - SJ   |   SOAWorld Magazine - SOAWM   |   IT Solutions Guide - ITSG   |   Symbian Developer's Journal - SDJ
WebLogic Developer's Journal - WLDJ   |   WebSphere Journal - WJ   |   Wireless Business & Technology - WBT   |   XML-Journal - XMLJ   |   Internet Video - iTV
Flex Developer's Journal - Flex   |   AJAXWorld Magazine - AWM   |   Silverlight Developer's Journal - SLDJ   |   PHP.SYS-CON.com   |   Web 2.0 Journal - WEB2
Apache   |   CMS   |   CRM   |   HP   |   Oracle Journal   |   Perl   |   Python   |   Red Hat   |   Ruby on Rails   |   SAP   |   SaaS

SYS-CON MEDIA:   ABOUT US   |   CONTACT US   |   COMPANY NEWS   |   CAREERS   |   SITE MAP
SYS-CON EVENTS:   |  AJAXWorld Conference & Expo  |  iPhone Developer Summit  |  Cloud Computing Conference & Expo  |  SOA World Conference & Expo  |  Virtualization Conference & Expo
INTERNATIONAL SITES:   India  |  U.K.  |  Canada  |  Germany  |  France  |  Australia  |  Italy  |  Spain  |  Netherlands  |  Brazil  |  Belgium
 Terms of Use & Our Privacy Statement     About Newsfeeds / Video Feeds
Copyright ©1994-2008 SYS-CON Publications, Inc. All Rights Reserved. All marks are trademarks of SYS-CON Media.
Reproduction in whole or in part in any form or medium without express written permission of SYS-CON Publications, Inc. is prohibited.
 
close this window