Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client Customised Device Content

 
Mat Anthony
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .

Mat
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mat Anthony
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
has anybody developed WS under AXIS2, that provides different content based on
the client device, that made the request

Mat
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic