File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Client Customised Device Content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Client Customised Device Content " Watch "Client Customised Device Content " New topic

Client Customised Device Content

Mat Anthony
Ranch Hand

Joined: May 21, 2008
Posts: 255
Hi All,

I have created several web services that provide display content data.
The content needs be based on the client device type (i.e. pc, mobile, etc) that is making
the request. I currently use Axis2.
Would I need to write my own Axis2 Module to customise the display content to the calling device .
How would I be able to detect the different device types from within this Module .

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
I have also been contemplating a similar problem and found XSLT, which would, as far as I understand, be able to help me transform some XML data into something I can put on a web page. That is, I use a different piece of XSLT depending on the type of the client.
The client type can be a parameter to the web service operation, but an alternative may be to get the client type from the HTTP headers of the request.
I haven't had time to explore this yet, so if you make any findings, please let me know!
Best wishes!
Mat Anthony
Ranch Hand

Joined: May 21, 2008
Posts: 255
Hi Ivan,
The problem is that I need the ws to be independent of any devices.
It would be ideal to have a Axis Module or something that intercepts the ws response before it is sent back to the client device.
This Module would use a spring service to provide the correct device display content via xsl.
The service would have to have knowledge about the HTTP header of the request to be able to determine the client device.
Not sure if the above is correct, hence need some help .

Mat Anthony
Ranch Hand

Joined: May 21, 2008
Posts: 255
Hi All,
has anybody developed WS under AXIS2, that provides different content based on
the client device, that made the request

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
That really cries out for a RESTful style approach, for example using the Jersey toolkit. AXIS2 claims to support RESTful requests but the mechanism looks like a kludge to me.

A Jersey based server could have annotations directing requests according to the "accepts" header and any other header information.

Do the clients really need a SOAP interface?

I agree. Here's the link:
subject: Client Customised Device Content
It's not a secret anymore!