Robert,
Excellent points, I will look into each suggestion.
Regarding item 1, do you know if this requires Mozilla's Rhino usage on
the client? I am stuck with MS IE 6.x and later on the client, I wasn’t
clear if Rhino was a server only requirement or client & server.
Thanks much!
-ch
From: robert lazarski
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 30, 2006 2:29
PM
To: [email protected]
Subject: Re: [Axis2] How to design
a Java API that is both Java and web-service friendly?
I'll try and answer your
questions to a point where you can start moving torwards a solution. Some of
these I haven't tried yet but I know they exist:
1) For an axis2 _javascript_ service, take a look here:
http://issues.apache.org/jira/browse/AXIS2-625?page=all
2) For registering a listener, using JMS as the transport might be what you're
after though I haven't used axis2 with JMS. Axis2 supports JMS, and while I
didn't find any docs where I thought they would be, there are unit tests in the
source such as JMSEchoRawXMLTest . Dims may be able to comment more.
3) I typically use an adapter or a Spring service that sits in between the
axis2 / web layer invokations to the business layer that provides the same glue
between the layers.
4) WS-Addressing generates an UUID that can be used for session tracking, along
with ServiceGroupContext. I often either generate a UUID and store it via
EHCache, or use a stateful session bean to generate and expire an ID for me -
but I'm strange like that ;-) .
HTH,
Robert
http://www.braziloutsource.com/
On 5/30/06, Dave
Hoffer <[EMAIL PROTECTED]>
wrote:
I have some POJO classes
that I am designing were I will have both Java
clients (using the classes directly thru jar) as well as clients
accessing the code through a web-service API (the primary web-service
client will be _javascript_/IE). Ideally (not required), I would like
both API's to be the same. Here is the proposed Java API:
public class Driver implements ISpotMeasurement
{
/**
* This initiates the process of measuring and
registers a listener
for the measurement results.
*
* @param listener
*/
public void
addSpotMeasurementListener(ISpotMeasurementListener
listener)
{
}
/**
* This terminates the process of measuring and removes
the
registered listener.
*
* @param listener
*/
public void
removeSpotMeasurementListener(ISpotMeasurementListener
listener)
{
}
/**
* Enable the instrument to take a measurement
now. The actual
measurement may be delayed until the
* user performs the physical measurement, in the case
of
instruments with shoe activated measurement.
*/
public void beginSpotMeasurement()
{
}
}
public interface ISpotMeasurementListener
{
public void onSpotMeasurement( double[] data, int
statusCode );
}
The client calls beginSpotMeasurement() asynchronously and the data is
returned via the listener. This makes sense in the case of the Java
application but can Axis2 & web-services make this sort of an
API? Can
a web-service API register listeners? I definitely need state
maintained on the server which I understand Axis2 supports; however is
there a better way to implement this API for the web-service clients?
What about _javascript_? What client proxies are available?
I understand, as newbie, that Axis2 can generate synchronous and
asynchronous method calls; how does this work given this API, given the
_javascript_ client?
Thanks,
-dh
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]