AMQP support via JMS transport using Apache Qpid

2008-06-03 Thread Rajith Attapattu
Hi All,

Suran has got Apache Qpid working under JMS transport and had a few
questions for me.
Instead of answering him individually I wrote up the following in case
anybody else has questions.

I have tested the following with Axis2 1.4 release and should work well with
the up comming Synapse release as well.

Documentation is broken into two sections.
It is important to read and understand the pros and cons for each option.

If you have any questions/suggestions please post on
[EMAIL PROTECTED]
And/Or open a JIRA at http://issues.apache.org/jira/browse/qpid
Your feedback is most welcomed.

1) Configuring the JMS transport using Apache Qpid M2.1 release.
   This version is the latest stable release and supports the 0-9 version of
the AMQP protocol.
   You can download it from here http://cwiki.apache.org/qpid/download.html
   It is recomended that you use the Java broker.
   This is the recomended production version.

2) Configuring the JMS transport using Apache Qpid trunk. (with the usual
caveat that it is a less stable and a moving target).
   The trunk supports the 0-10 version of the AMQP protocol.
   You can build it from source.
https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid
   Next release is M3

   Has the following enchancements in the JMS client over M2.1

-
   1) You can specify multiple binding keys per destination.
  i.e you could bind a queue to a particular exchange using several
binding keys there by allowing you to listen from multiple sources.

   2) You can bind your queue to any exchange type using the binding URL.

   3) You can set the following options per JMS connection.
  maxprefetch - The maximum number of pre-fetched messages per
destination
  sync_persistence - When true, a sync command is sent after every
persistent message to guarantee that it has been received by the broker.

   4) A new blocking transport (as an alternative to MINA) that gives much
better latency, memory and increased throughput in many cases.


   Supported Broker
   -
   Currently only the c++ broker supports the 0-10 version.
   Supported platform is linux.

   In the pipeline
   
   Java Broker - expected to be in M3 release. Currently being refactored
   C++ broker - solaris and windows port are in progress (likely to be in M3
release)


1.0 Configuring the JMS transport using Apache Qpid M2.1 release
=

1.1 Qpid provides a convinient properties file based JNDI mechanism.
For provider URL please specify the location of the jndi.properties file.


org.apache.qpid.jndi.PropertiesFileInitialContextFactory
file:///opt/workspace/sandbox/axis2-1.4
TopicConnectionFactory


1.2 The following link provides documentation for the jndi.properties file.
http://cwiki.apache.org/qpid/how-to-use-jndi.html

The connection URL format is given here.
http://cwiki.apache.org/qpid/connection-url-format.html

1.3 The JMS transport allows you to specify a custom destination for your
service via the "transport.jms.Destination" parameter.
If you do not specify this then the JMS transport will create a queue with
the service name as its name.
In AMQP world the above translates to the following.
A queue will be created with service name as its name and will be bound to
the amq.direct exchange with service name as the routing key.

If you specify a custom destination name via transport.jms.Destination in
your services.xml then Qpid will look that up in the jndi.properties file
and create queue based on the definition given in the file.
The binding URL format is given here.
http://cwiki.apache.org/qpid/bindingurlformat.html


2.0 Configuring the JMS transport using Apache Qpid trunk
==
In addition to whats described above you can do the following.

2.1 Specifing multiple binding keys per destination
Ex
destination.wetherServiceQueue=topic://amq.topic/WeatherQueue?bindingkey='weather.us.*'&bindingkey='weather.ca.*'

The above will create a queue named WeatherQueue and will bind it to
amq.topic with 'weather.us.*' and 'weather.ca.*' as the binding keys. The
broker will then route any messages that matches the above patterns into
WeatherQueue.

2.2 Binding your queue to any exchange type the broker supports
By using the binding URL you can bind your queue to any exchange type the
broker supports.

For example if you want to bind your queue to a fanout exchange
destination.top10StockQueue=fanout://amq.fanout/WeatherQueue

2.3 Setting prefetch limit and sync_persistence per JMS connection
Ex.
amqp://username:[EMAIL PROTECTED]
/test?brokerlist='tcp://localhost:5672'&maxprefetch=2000&sync_persistence=true

2.4 Using the new transport
Set -Dtransport=io when starting Axis2 or Synapse.


Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/


Re: [ANN][Axis2] QuickStart Axis2 -- My first book on Axis2 is published

2008-05-30 Thread Rajith Attapattu
Congrats Deepal,
Remember all the discussions Srinath et al had about writing a book on
axis2.
I am very happy that it finnaly came to life.

Regards,

Rajith Attapattu
http://rajith.2rlabs.com/

On Fri, May 30, 2008 at 8:19 AM, Deepal jayasinghe <[EMAIL PROTECTED]>
wrote:

> This is to inform you with great joy that I was able to complete my book on
> Axis2. The book is now published and available on most of the online book
> stores [1] . It took more than 18 months to complete the book. I tried my
> best to cover most of the commonly used features as well as basis of Axis2 .
> I believe the book will help you to overcome and clarify most of the unknown
> areas of Axis2 as well as to improve your knowledge on Axis2 . I have added
> a number of code samples to make the reader's job easier , I hope that will
> help you to understand the content very easy manner. You can find more
> information from [2] , [3].
>
>
> [1] :
> http://www.packtpub.com/creating-web-services-with-apache-axis-2/book
> [2] :
> http://www.packtpub.com/article/create-quality-web-services-with-quicktstart-apache-axis2
> [3] :
> http://blogs.deepal.org/2008/05/quickstart-axis2-my-first-book-on-axis2.html
>
> Thank you!
> Deepal
>
> http://blogs.deepal.org
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: AxisCallback stuck the application

2007-10-12 Thread Rajith Attapattu
Put you notification logic in the

 public void onComplete() {
//nothing here
}

So when it completes (either fault/error or sucess) , this method will be
called.

Here is a faily elementry example (not the most elegant)
Modify the generated class as follows.

 public void onComplete() {
_complete = true;
}

and add a isComplete Method

boolean isComplete()
{
  return _complete;
}

you can now use it like the old Callback class.

while ( !_axisCallBack.isComplete())
{
   Thread.sleep(1000);
}

Hope this helps.

On 10/12/07, Huitang Li <[EMAIL PROTECTED]> wrote:
>
> Thanks, Deepal. I will be happy to create a JRIA. But can you show me a
> good example using this new API in the client code? I am working on a
> project, and I cannot wait for the next Axis2 release.
>
> Thanks.
>
> Huitang
>
>
>
> Deepal jayasinghe wrote:
> > Hi Huitang ,
> > Definitely a bug in codegen , please create a JRIA.
> >
> > Thanks
> > Deepal
> >
> >> All these codes are auto-generated by Axis2 1.3 wsdl2java command. I
> >> do not know whether it is an old callback or not. But it does says:
> >>
> >> _operationClient.setCallback(new
> >> org.apache.axis2.client.async.AxisCallback() {
> >> // all the codes that I pasted in my previous email.
> >> }
> >>
> >> In the generated code, the onComplete() method looks like this:
> >>
> >> public void onComplete() {
> >>// Do nothing by default
> >>}
> >>
> >>
> >> Maybe there is something incorrectly generated by wsdl2java?
> >>
> >>
> >>
> >>
> >> Rajith Attapattu wrote:
> >>
> >>> What do you mean by the "application is stuck" ? How does your
> >>> application figure out if a response is received?
> >>> Can you please cut paste the code that uses the AxisCallback.
> >>>
> >>> Does the onMessage, onError or onFault methods get called?
> >>> If so why do u say it is stuck?
> >>>
> >>> Looks like the onMessage and onError methods get called, bcos u seem
> >>> to have put the old callback there and you mentioned that it works.
> >>>
> >>>
> >>> public void onComplete() {
> >>> //nothing here
> >>> }
> >>>
> >>>
> >>> I also see that the onComplete method is empty.
> >>>
> >>> --
> >>> Rajith Attapattu
> >>> Red Hat
> >>> Blog http://mutlix.blogspot.com/
> >>>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Rajith Attapattu
Red Hat
Blog http://mutlix.blogspot.com/


Re: AxisCallback stuck the application

2007-10-11 Thread Rajith Attapattu
What do you mean by the "application is stuck" ? How does your application
figure out if a response is received?
Can you please cut paste the code that uses the AxisCallback.

Does the onMessage, onError or onFault methods get called?
If so why do u say it is stuck?

Looks like the onMessage and onError methods get called, bcos u seem to have
put the old callback there and you mentioned that it works.


public void onComplete() {
> //nothing here
> }
>

I also see that the onComplete method is empty.

-- 
Rajith Attapattu
Red Hat
Blog http://mutlix.blogspot.com/


Re: Database connection

2007-10-11 Thread Rajith Attapattu
On 10/11/07, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
>
> Hi VF
> > Hi all,
> > I would like to ask u, how can i utilize database connection in my web
> > service. I have one web service with more methods in it. Id like to
> create
> > database connection just once and not with each call (each operation
> works
> > with the same database connection) Is it enough to create this service
> with
> > application scope?
> >
> Well if you deploy the service in application scope and inside the
> following method you can have the DB initialization code and store the
> DB properties in ServiceContext.
>
> public void init(ServiceContext sc){
>//Db handling code goes here
> }


Deepal, If you enable clustering then u might have to mark this property for
filtering.
Which is not a problem, but I thought worth mentioning.

Or there is some other way of doing that. In that way you do not need to
> worry about the scope of the service , you can create the DB once and
> store in AxisService or in ConfigurationContext and access it inside
> your method call. To do that you need to have an implementation of
> "ServiceLifeCycle" interface and you can include that in your
> services.xml as follows. In the above impl write your code to start the
> DB inside the startUp and DB closing steps in side the shutDown method.


Deepal, when is lifecycle methods being called?
What is the relationship between the service scope and the life cycle?



>
> 
>
> Thanks
> Deepal
> > It looks like this:
> >
> > Available services
> > stkdds
> >
> > Service Description : stkdds
> > Service Status : Active
> > Available Operations
> >
> > * getFinishedOrderBin
> > * getOrderInfo
> > * updateOrder
> > * getUserInfo
> > * cancelOrder
> > * updateUser
> > * testOperation
> > * getOrdersOverview
> > * getAllAccountsInfo
> > * getFinishedOrder
> > * getAccountInfo
> > * newOrder
> >
> >
> > And my code for database connection smth like this:
> >
> > public Connection setConnection() throws Exception {
> >
> >   if(conn != null){
> >   return conn;
> > }
> >
> > Class.forName("org.firebirdsql.jdbc.FBDriver");
> >   conn = DriverManager.getConnection (p_connect_string,
> > sqlProps);
> > return conn;
> >
> >
> >
> >
> >  Thanks Vladi
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
>
> --
> Thanks,
> Deepal
> 
> "The highest tower is built one brick at a time"
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
Rajith Attapattu
Red Hat
Blog http://mutlix.blogspot.com/


Re: AxisCallback stuck the application

2007-10-11 Thread Rajith Attapattu
How did u use it?
Can you cut paste the code here.

Regards,

Rajith Attapattu
Red Hat.

On 10/11/07, Huitang Li <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> When I use the new API AxisCallback, the application seems stuck, and it
> is taking forever to get any response. However, when I switched to the
> Callback class, I got the response from web service quickly.
>
> Any idea?
>
>
> Thanks.
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: SOAP vs REST request

2007-10-09 Thread Rajith Attapattu
Sorry to say but the article listed below is very misleading.
Comparing REST vs SOAP is the same as apples vs oranges.
REST is an architectural style while SOAP is just a message format.
REST vs WS-* or SOA in general is a more meaningful comparison.
All though there are quite a few folks who think REST is one way to realize
SOA.

For most folks REST means XML over HTTP/GET which is not correct at all.
Read this blog post by Sanjiva
http://www.bloglines.com/blog/sanjiva?id=227to get a more balanced
view.

It is important to understand that in order for your service to be RESTful
your service needs to obey the REST constraints.
Flipping the switch "disableREST" doesn't make your service RESTful or not.
All it does is to change the message format from POX to SOAP.
You have a greater responsibility to ensure that you design your service in
such a way that it obeys the REST constraints.

Regards,

Rajith Attapattu.
Red Hat.

On 10/9/07, Ganesan, Chandru <[EMAIL PROTECTED]> wrote:
>
>
> Hi
>
> I'm newbie to Axis, so pardon my rudimentary question?
>
> What factors should I consider before choosing between  REST vs SOAP
> request processing in Axis 2.0?
> In case of SOAP I'd use axis2/services URI path in the WSDL soap port
> (AxisServlet)
> In case of REST I'd use axis2/rest URI path in the WSDL soap port
> (AxisRESTServlet)
>
> If you could also provide some basic info on the difference between REST
> and AXIS request processing, it w'd be very helpful
>
>
> thanks
> Chandru Ganesan
> HP Select Identity
> 972.497.2403 (Work)
> 3000 Waterview Pkwy
> Richardson TX 75080
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Database connection

2007-10-09 Thread Rajith Attapattu
Since only one instance of the Service is used to serve all requests, your
code needs to be able to handle concurrency.
As anthony mentioned you may need to either use a connection pool or
synchronize access to the getConnection method.
Apart from the connection method, if there is any shared state that is
modified as part of a request you may need to ensure it is done a in thread
safe way.

I would say that it depends on how frequently your service is accessed.
If it's accessed once in a while then a synchronized getConnection method
might be cheaper than a thread pool.
Downfall is that concurrent requests are handled serially as they will block
on getConnection.

If it's accessed more often then offloading the burden of maintaining
connections to a connection pool might be a good idea.

Regards,

Rajith Attapattu
Red Hat.

On 10/9/07, Anthony Bull <[EMAIL PROTECTED]> wrote:
>
> If this is a service that more than one user can access I'd recommend
> you use commons connection pooling to handle your connections.  That way
> you just ask for a connection when you need one, and the commons library
> handles the creation.  Its not going to work very well if multiple
> requests are being serviced using a single JDBC connection - and I'm not
> even sure if it is threadsafe to do so.
>
> Rajith Attapattu wrote:
> > If you deploy this service in Application Scope, then there will be
> > one and only one instance of this service throught out the life time
> > of the application.
> > This way you only create your database connection once.
> >
> > >Is it enough to create this service with application scope?
> > So the answer is yes.
> >
> > Rajith Attapattu
> > Red Hat.
> >
> > On 10/9/07, *VF* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
> >
> > Hi all,
> > I would like to ask u, how can i utilize database connection in my
> > web
> > service. I have one web service with more methods in it. Id like
> > to create
> > database connection just once and not with each call (each
> > operation works
> > with the same database connection) Is it enough to create this
> > service with
> > application scope?
> >
> > It looks like this:
> >
> > Available services
> > stkdds
> >
> > Service Description : stkdds
> > Service Status : Active
> > Available Operations
> >
> > * getFinishedOrderBin
> > * getOrderInfo
> > * updateOrder
> > * getUserInfo
> > * cancelOrder
> > * updateUser
> > * testOperation
> > * getOrdersOverview
> > * getAllAccountsInfo
> > * getFinishedOrder
> > * getAccountInfo
> > * newOrder
> >
> >
> > And my code for database connection smth like this:
> >
> > public Connection setConnection() throws Exception {
> >
> > if(conn != null){
> > return conn;
> > }
> >
> >  Class.forName("org.firebirdsql.jdbc.FBDriver");
> > conn = DriverManager.getConnection(p_connect_string,
> > sqlProps);
> > return conn;
> >
> >
> >
> >
> > Thanks Vladi
> >
> >
> >
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>
> >
> >
>
>
> --
>
> Anthony
> -
> Anthony Bull
> Senior Developer
> Black Coffee Software Ltd
> PO Box 10-192 The Terrace
> Wellington, New Zealand
>
> [EMAIL PROTECTED]
> Ph  +64 4 472 8818
> Fax +64 4 472 8811
> -
> www.bcsoft.co.nz
> ---
> This email may contain confidential or privileged information,
> and is intended for use only by the addressee, or addressees.
> If you are not the intended recipient please advise the sender
> immediately and do not copy, use or disclose the contents to
> any other person or organisation.
> Black Coffee Software Ltd accepts no responsibility for viruses
> received with this email, or to any changes made to the original
> content. Any views or opinions expressed in this email may be
> personal to the sender and are not necessarily those of Black
> Coffee Software Ltd.
> ---
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Database connection

2007-10-09 Thread Rajith Attapattu
If you deploy this service in Application Scope, then there will be one and
only one instance of this service throught out the life time of the
application.
This way you only create your database connection once.

>Is it enough to create this service with application scope?
So the answer is yes.

Rajith Attapattu
Red Hat.

On 10/9/07, VF <[EMAIL PROTECTED]> wrote:
>
> Hi all,
> I would like to ask u, how can i utilize database connection in my web
> service. I have one web service with more methods in it. Id like to create
> database connection just once and not with each call (each operation works
> with the same database connection) Is it enough to create this service
> with
> application scope?
>
> It looks like this:
>
> Available services
> stkdds
>
> Service Description : stkdds
> Service Status : Active
> Available Operations
>
> * getFinishedOrderBin
> * getOrderInfo
> * updateOrder
> * getUserInfo
> * cancelOrder
> * updateUser
> * testOperation
> * getOrdersOverview
> * getAllAccountsInfo
> * getFinishedOrder
> * getAccountInfo
> * newOrder
>
>
> And my code for database connection smth like this:
>
> public Connection setConnection() throws Exception {
>
> if(conn != null){
> return conn;
> }
>
> Class.forName("org.firebirdsql.jdbc.FBDriver");
> conn = DriverManager.getConnection (p_connect_string,
> sqlProps);
> return conn;
>
>
>
>
> Thanks Vladi
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: AxisCallback vs. the deprecated Callback

2007-10-09 Thread Rajith Attapattu
Deepal,

I agree that an isComplete method is convinient, but it can be easily added
as I have shown in the example.
So it's not a major issue.
Perhaps if we document the behaviour properly we don't really need to add
that method in a hurry.

But I also agree that for the sake of backward compatibility it is good to
add that method.
It will also allow an easy migration path to the users.

Regards,

Rajith

On 10/8/07, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
>
> Hi Huitang ,
> Yes I also agree with you that is one of the missing API in the
> AxisCallback , and even I have found it difficult without that. So
> please create a JIRA I am more than happy to fix that  , though it is
> going to be a API changes.
>
> Thanks
> Deepal
> > Hi,
> >
> > I created a web service client following Async/One Channel model using
> > axis2-generated stub. In the stub code, AxisCallback interface is used.
> >
> > For almost all tests, no soap message response is received before the
> > client is finished. This is verified with the help of the excellent
> > tool tcpmon.
> >
> > In AxisCallback, I did not see something like isComplete() to test
> > whether a whole message is retrieved or not. So I had to replace the
> > AxisCallback with the depreciated Callback, and then put the following
> > code in the stub.
> >
> > while (!callback.isComplete()) {
> >Thread.sleep(1000);
> > }
> >
> > Does anyone have a better solution without having to use the
> > deprecated API?
> >
> > Thanks.
> >
> >
> >
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: AxisCallback vs. the deprecated Callback

2007-10-08 Thread Rajith Attapattu
There are several ways you can use AxisCallback to notify the completion to
interested parties.
What I showed you was a way to implement something simillar to the way the
old Callback class was used.

We could add a sample on how to use the new API.
The general idea is for you to hook up your notification logic in the
onComplete method.
How this notification should happen depends on your implementation
stratergy.
Above is just one example.

Regards,

Rajith

On 10/8/07, Huitang Li <[EMAIL PROTECTED]> wrote:
>
> Thanks very much. I will try it. I hope axis2 developers will  use the
> new API in the sample codes (under userguide folder) for next axis2
> release so that they can give me an idea on how to use it without having
> the spawning thread die prematurely.
>
>
> Rajith Attapattu wrote:
> > Here is an idea on how to use the new AxisCallback in a similar
> > fashion to the old Callback. (if thats what you are looking for)
> >
> > When you implement your callback, in the onComplete method you could
> > do the following.
> >
> > void onComplete()
> > {
> >_complete = true;
> > }
> >
> > you can add an additional method to your implementation called
> > isComplete().
> >
> > void boolean isComplete()
> > {
> >   return _complete;
> > }
> >
> > Now you have the same functionality as the old Callback.
> >
> > You can poll for isComplete to know if it's done and the java doc for
> > onComplete says that it will be called at the end of a MEP no matter
> > what happens.
> > (I looked at the code and I see that it is the case)
> > So you can be sure that the MEP is completed when the _complete
> > boolean is set to "true".
> >
> > Regards,
> >
> > Rajith Attapattu.
> > Red Hat Canada.
> >
> > On 10/8/07, * Huitang Li* <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> > Any thought here, please? I would love to use new API, but I do
> > not know
> > how to fit it into the product.
> >
> >
> > Huitang Li wrote:
> > > Thanks for your input. I saw the thread you mentioned before I
> sent
> > > out my question to the list. However, I cannot see the solution
> > to the
> > > question. The main thread can be finished before the spawning
> thread
> > > finishes getting the response from the web service server. Also,
> in
> > > axis2 1.3 sample codes, it still uses the old Callback class.
> > >
> > > I just wonder how the main thread can detect whether the spawning
> > > thread is complete or not with the new AxisCallback API.
> > >
> > > Any idea?
> > >
> > >
> > >
> > >
> > > Suran Jayathilaka wrote:
> > >> Huitang Li wrote:
> > >>> Hi,
> > >>>
> > >>> I created a web service client following Async/One Channel model
> > >>> using axis2-generated stub. In the stub code, AxisCallback
> > interface
> > >>> is used.
> > >>>
> > >>> For almost all tests, no soap message response is received
> before
> > >>> the client is finished. This is verified with the help of the
> > >>> excellent tool tcpmon.
> > >>>
> > >>> In AxisCallback, I did not see something like isComplete() to
> test
> > >>> whether a whole message is retrieved or not. So I had to
> > replace the
> > >>> AxisCallback with the depreciated Callback, and then put the
> > >>> following code in the stub.
> > >>>
> > >>> while (!callback.isComplete()) {
> > >>>Thread.sleep(1000);
> > >>> }
> > >>>
> > >>> Does anyone have a better solution without having to use the
> > >>> deprecated API?
> > >>>
> > >>> Thanks.
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> >
> -
> > >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>
> > >>> For additional commands, e-mail: [EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>
> >

Re: AxisCallback vs. the deprecated Callback

2007-10-08 Thread Rajith Attapattu
Here is an idea on how to use the new AxisCallback in a similar fashion to
the old Callback. (if thats what you are looking for)

When you implement your callback, in the onComplete method you could do the
following.

void onComplete()
{
   _complete = true;
}

you can add an additional method to your implementation called isComplete().

void boolean isComplete()
{
  return _complete;
}

Now you have the same functionality as the old Callback.

You can poll for isComplete to know if it's done and the java doc for
onComplete says that it will be called at the end of a MEP no matter what
happens.
(I looked at the code and I see that it is the case)
So you can be sure that the MEP is completed when the _complete boolean is
set to "true".

Regards,

Rajith Attapattu.
Red Hat Canada.

On 10/8/07, Huitang Li <[EMAIL PROTECTED]> wrote:
>
> Any thought here, please? I would love to use new API, but I do not know
> how to fit it into the product.
>
>
> Huitang Li wrote:
> > Thanks for your input. I saw the thread you mentioned before I sent
> > out my question to the list. However, I cannot see the solution to the
> > question. The main thread can be finished before the spawning thread
> > finishes getting the response from the web service server. Also, in
> > axis2 1.3 sample codes, it still uses the old Callback class.
> >
> > I just wonder how the main thread can detect whether the spawning
> > thread is complete or not with the new AxisCallback API.
> >
> > Any idea?
> >
> >
> >
> >
> > Suran Jayathilaka wrote:
> >> Huitang Li wrote:
> >>> Hi,
> >>>
> >>> I created a web service client following Async/One Channel model
> >>> using axis2-generated stub. In the stub code, AxisCallback interface
> >>> is used.
> >>>
> >>> For almost all tests, no soap message response is received before
> >>> the client is finished. This is verified with the help of the
> >>> excellent tool tcpmon.
> >>>
> >>> In AxisCallback, I did not see something like isComplete() to test
> >>> whether a whole message is retrieved or not. So I had to replace the
> >>> AxisCallback with the depreciated Callback, and then put the
> >>> following code in the stub.
> >>>
> >>> while (!callback.isComplete()) {
> >>>Thread.sleep(1000);
> >>> }
> >>>
> >>> Does anyone have a better solution without having to use the
> >>> deprecated API?
> >>>
> >>> Thanks.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >> Hi!
> >> Please refer to this thread.
> >> http://www.mail-archive.com/axis-user@ws.apache.org/msg31442.html
> >>
> >> Cheers.
> >> Suran
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: [Axis2] Sesion management [soapsession]

2007-04-02 Thread Rajith Attapattu

Here is an example

serviceClient.engageModule(new QName("addressing"));

Rajith

On 4/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


 Rajith,

How to engage addressing for Client? I have engaged the same for Server.

_
Thanks & Regards,
Vinodh


 ------
*From:* Rajith Attapattu [mailto:[EMAIL PROTECTED]
*Sent:* Monday, April 02, 2007 9:48 PM
*To:* axis-user@ws.apache.org
*Subject:* Re: [Axis2] Sesion management [soapsession]

Hi Kumar,

Have u enabled addressing?
Axis2 uses WS-Addressing to exchange the service group id to manage the
soap session.
So unless u have addressing engaged in both the client and service u want
have session support.

regards,

Rajith

On 4/2/07, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
>
>  Hi,
>
> I was trying out session management in Axis2 throught the help of doc
> posted in 
developers.com(http://www.developer.com/java/web/article.php/10935_3620661_2).
>
>
> I deployed application in Soap session scope in Service Context.
>
> I made followng changes as suugested in the article
>
> 1. Made change in service.xml to include soapsession.
>
> 2. Have included method init(), destroy() and a method for getting
> ServiceContext in skelton class.
>
> public void init(ServiceContext serviceContext)
> {
>System.out.println("In init() method");
>serviceContext.setProperty("conferenceId" , new
> Integer(1000));
>   }
>
>   public void destroy(ServiceContext serviceContext)
>   {
> System.out.println("In destroy method");
>serviceContext.getProperties().remove("conferenceId");
>   }
>
>
>   private ServiceContext getServiceContext() {
> MessageContext messageContext = MessageContext
>   .getCurrentMessageContext();
> ServiceContext serviceContext = messageContext.getServiceContext
> ();
> return serviceContext;
>}
>
>
>
>
> 3. In the client stub I have added below line for managing the session
>
> stub._getServiceClient().getOptions().setManageSession(true);
>
>
> I used the stub(same instance)  to invoke a functionality multiple
> times. Each time functionality is invoked, init() method is getting called
> (i,e) new instance of service is created for each request with the same
> client instance in soap session.
>
> Are there any more changes required to support soapsession.
>
> Please let me know how to proceed further for acheiving soap session
> scope.
>
>
>
> _
> Thanks & Regards,
> Vinodh
>
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you are
> not the intended recipient, you should not disseminate, distribute or copy
> this e-mail. Please notify the sender immediately and destroy all copies of
> this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
>
> www.wipro.com
>


The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s) and
may contain proprietary, confidential or privileged information. If you are
not the intended recipient, you should not disseminate, distribute or copy
this e-mail. Please notify the sender immediately and destroy all copies of
this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com



Re: [Axis2] Sesion management [soapsession]

2007-04-02 Thread Rajith Attapattu

Hi Kumar,

Have u enabled addressing?
Axis2 uses WS-Addressing to exchange the service group id to manage the soap
session.
So unless u have addressing engaged in both the client and service u want
have session support.

regards,

Rajith

On 4/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


 Hi,

I was trying out session management in Axis2 throught the help of doc
posted in developers.com(
http://www.developer.com/java/web/article.php/10935_3620661_2).

I deployed application in Soap session scope in Service Context.

I made followng changes as suugested in the article

1. Made change in service.xml to include soapsession.

2. Have included method init(), destroy() and a method for getting
ServiceContext in skelton class.

public void init(ServiceContext serviceContext)
{
   System.out.println("In init() method");
   serviceContext.setProperty("conferenceId" , new
Integer(1000));
  }

  public void destroy(ServiceContext serviceContext)
  {
System.out.println("In destroy method");
   serviceContext.getProperties().remove("conferenceId");
  }


  private ServiceContext getServiceContext() {
MessageContext messageContext = MessageContext
  .getCurrentMessageContext();
ServiceContext serviceContext = messageContext.getServiceContext
();
return serviceContext;
   }




3. In the client stub I have added below line for managing the session

stub._getServiceClient().getOptions().setManageSession(true);


I used the stub(same instance)  to invoke a functionality multiple times.
Each time functionality is invoked, init() method is getting called (i,e)
new instance of service is created for each request with the same client
instance in soap session.

Are there any more changes required to support soapsession.

Please let me know how to proceed further for acheiving soap session
scope.



_
Thanks & Regards,
Vinodh


The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s) and
may contain proprietary, confidential or privileged information. If you are
not the intended recipient, you should not disseminate, distribute or copy
this e-mail. Please notify the sender immediately and destroy all copies of
this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com



Re: Clustering

2007-01-22 Thread Rajith Attapattu

Stefan,

If your web services are truly stateless or if your state is backed by a
data base after every request then u can deploy axis2 in a cluster.

However if your services have some state carried in the service ctx or
service group contexts (SOAPSession or Application scope) then u have to
wait till we add the replication support for this.
Unfortuantely I have been sitting on this for a while. Hopefully will try to
add this soon into a branch and where people can play around with it.
This is based on a proposal by Chamikara/Chathura.

Regards,

Rajith

On 1/20/07, Stefan Kok <[EMAIL PROTECTED]> wrote:


Hi All


I am curious do Axis support any form of clustering ? I have seen some
proposals on the net but that about it.

Regards
Stefan.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [Axis2] Session Management and WS-Addressing

2007-01-22 Thread Rajith Attapattu

I have the same problem too.

Deepal, if you do options.setManageSession(true); shouldn't the client do
the copying ?
Do we have to manually copy the groupId paramater ?

Regards,

Rajith

On 1/17/07, Tim, Jane and Chelsea Johnson <[EMAIL PROTECTED]> wrote:


 Thanks for replying. Yes, I read that article. That is why I am stumped
as to why my service doesn't response with the correct headers when the
client calls it the first time with the correct WS-Addressing headers. Do I
have to build the WS-Addressing headers by hand or should Axis2 build them
for me automatically?

When you deploy a service in SOAP session and when a client tries to
access the service in the first time, Axis2 will generate serviceGroupId and
send that to the client as a reference parameter in wsa:ReplyTo, as shown
below:


   
  http://www.w3.org/2005/08/addressing/anonymous
   
   
  http://ws.apache.org/namespaces/axis2";>
urn:uuid:65E9C56F702A398A8B11513011677354
  
   


If the client wants to live in the same session, he has to copy that
reference parameter and send it back to the server when he invokes the
service the second time. As long as a client sends the valid serviceGroupId,
he can use the same session, and the service can maintain the
session-related data. Unlike a request session, a SOAP session has a default
timeout period, so if the client does not touch the service for 30 seconds,
the session will expire, and if the client sends the old serviceGroupId, he
will get an AxisFault too.

- Original Message -
*From:* Brian De Pradine <[EMAIL PROTECTED]>
*To:* axis-user@ws.apache.org
*Sent:* Wednesday, January 17, 2007 7:52 AM
*Subject:* Re: [Axis2] Session Management and WS-Addressing


Hello,

You may find the following link useful, [1]

[1]  http://www.developer.com/java/web/article.php/3620661

Cheers

Brian DePradine
Web Services Development
IBM Hursley
External  +44 (0) 1962 816319 Internal 246319

If you can't find the time to do it right the first time, where will you
find the time to do it again?


"Tim, Jane and Chelsea Johnson" <[EMAIL PROTECTED]> wrote on 17/01/2007
00:54:12:

> I am running the latest version of axis2 - 1.1.1. I am trying to use
session
> management via WS-Addressing.
> In soapmonitor I can see the WS-Addressing headers going out on the
request
> to the server. But my service's response doesn't have any of the
> WS-Addressing headers (specifically the groupID header). Addressing is
> enabled globally via the entry in Axis2.xml. In service.xml I set scope
for
> the service to be "soapsession".
>
> This is what the client is sending. Is there something I need to add or
> change to get the service to re-act with WS-Addressing headers.
>
> 
> http://www.w3.org/2005/08/addressing";
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
>   
> http://localhost:8080/axis2/services/AiMessageServices

> 
>   http://www.w3.
> org/2005/08/addressing/anonymous
> 
>
urn:uuid:F18B205BFF468A597911689950656872
> urn:login
>   
>   
> 
>   124
>   2567
>   SJPC120.y
>   2003
> 
>   
> 
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>




Re: Axis2 Programmatic Deployment

2007-01-22 Thread Rajith Attapattu

Angle,

There are two possible angles.
One is what Deepal just descried. This way your Confgiurator implementation
will do all the work.
This is complex and will take time.

Another and perhaps more simple way of doing it is once u have got the
relevent data from your third party source, then u can create services
programaticaly using the following code.

ConfigurationContext ctx =
ConfgiurationContextFactory.createConfigurationContextFromFileSystem(null,
null);
AxisService service = AxisService.createService("GreetingService.class",

ctx.getAxisConfiguration(),

RPCMessageReceiver.class);

ctx.getAxisConfiguration().addService(service);

Regards,

Rajith

On 1/19/07, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:


Hi Angel;

You can deploy services programatically very easily in Axis2 , what you
need to do is write your own AxisConfigurator and create then call

ConfigurationContextFactory.createConfigurationContext(
AxisConfigurator axisConfigurator);

Thanks
Deepal

>
>
> I saw that there is no way to deploy a service programmatically in
> Axis2. Is that the case? Only building the AxisService object instance
> is possible through the buildService method of the deploymentEngine,
> but this doesn't help much. The doDeploy() method checks an array of
> WSArchives , which are loaded through ArchiveFileData.
>
> I am more interested in deploying a service without having any AAR
> archive on the file system, but some other repository (a third party
> app or a database for instance).
>
> Thanks for the feedback.
>
> Best Regards,
> Angel
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
Thanks,
Deepal

"The highest tower is built one brick at a time"




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: WS debugging in Eclipse

2006-12-06 Thread Rajith Attapattu

Vladi,

Another more easy option would be for you to deploy your services on axis2
and then remote debug using eclipse.
You can also use tcpmon http://ws.apache.org/commons/tcpmon/ to check the
SOAP messages that are exchanged between the service and the client.

Regards,

Rajith


On 12/6/06, VF <[EMAIL PROTECTED]> wrote:


Hi all,
Is it possible to debug web services in Eclipse?


   Vladi


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to create multiple web services

2006-11-04 Thread Rajith Attapattu
Rahul,I would definitely recomend using Axis2 which is where all the innovation is happening.Axis is maintainence mode with no active development.As I understand your requirment is whether u can deploy multiple web services within the same axis2 instance ? (Rahul correct me if I am wrong here)
The answer is yes.  You can deploy "n" no of services.I am not sure about what u mean by keeping them in different directories ?? Can u explain a bit more?All services are deployed to a single directory as an archive file or in "exploded format". Either way as a user u really don't have to worry as axis2 will handle it and they will be distinct independent services.
Perhapse if you can explain what u are trying to achive then we can help u more.Regards,RajithOn 11/3/06, Gupta, Rahul <
[EMAIL PROTECTED]> wrote:Axis1 and Axis2 are two different servlet container provided by Apache,if I am not 
wrong.Actually  I want to deploy different web services,by using either of them (Axis1 or Axis2) but I m confused which would be more better.As you said Axis2 by default keeps services independently, does it means that Axis1 does not keep service independently while Axis2 keeps 
independently.Therefore, whenever I would deploy a new web service in Axis1 it has to be in same directory Tomcat5.5/webapps/axis/service1...service2...serviceN and if I deploy in Axis2 it would be in different directory. I mean how Axis2 keeps service indepedently.
Could  you please explain.Sorry for asking such basic questions, as I am new to Web services.ThanksRahul-Original Message-From: Thilina Gunarathne [mailto:
[EMAIL PROTECTED]]Sent: Friday, November 03, 2006 3:08 AMTo: axis-user@ws.apache.orgSubject: Re: How to create multiple web servicesYour question is not clear to me... Are you talking about running
Axis1 & Axis2 in the same servlet container or to have several Axis1or Axis2 webapps running in the same servlet container...I assume its the second issue since you are talking about keepingservices independently...  This is not an issue in Axis2...Axis2 by
default keeps the services independently when you are deployingmultiple services in same Axis2 web app... No need to have separatesevlets..ThilinaOn 11/3/06, Gupta, Rahul <
[EMAIL PROTECTED]> wrote:> Hi>> I am just a beginner in web services and I have to figure out one problem. If I want to create multiple web services, Is their any way I can configure multiple axis in Apache as like we are doing for one axis, so that the webapps directory of Apache would now contain axis1,axis2axisN, so that I can now keep my related services independently in each folder.
>> Thanks> Rahul>> -> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]>>--http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/-To unsubscribe, e-mail: 
[EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]-
To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Axis2] Out-only how-to

2006-11-04 Thread Rajith Attapattu
Hi Andrea,Untill deepal puts out a sample here is a basic code snippet to do it.OMElement payload = // use AXIOM to create a payloadServiceClient client = new ServiceClient();Options options = new Options();
options.setTo(//set the EPR here);client.setOptions(options);// from the client side this is a out only operationserviceClient.fireAndForget(payload);Regards,Rajith
On 11/2/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
Hi Andrea ;At the moment we do nt have any sample with out-only operations , andwrting a such a service is not a big deal too. I will try to write asample and I created aJIRA(
https://issues.apache.org/jira/browse/AXIS2-1590)  too , so that Iwont forget to write that.ThanksDeepal> Hello,>> I'm new to Axis2. I would like where to know> if examples are available on how to develop
> services with out-only operations, starting> from the WSDL.>> Thanks a lot>> Andrea Parodi> IRIS SrL -
> To unsubscribe, e-mail: [EMAIL PROTECTED]> For additional commands, e-mail: [EMAIL PROTECTED]
>>>--Thanks,Deepal"The highest tower is built one brick at a time"-
To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]



Re: [axis2] spring support

2006-10-31 Thread Rajith Attapattu
The last time I checked 1.1 with Spring it worked like a charm.Btw did Saminda port the fix for spring from 1.1 to trunk (sorry didn't get a chance to check this out)Regards,Rajith
On 10/31/06, Thilina Gunarathne <[EMAIL PROTECTED]> wrote:
wow... great.. Hope your list has loads of stuff in it..Stay tuned in the next 24 hours.. RC2 could come out at any time...;-)~ThilinaOn 10/31/06, Alex Hollerith <
[EMAIL PROTECTED]> wrote:> hi robert,>> i will put in on my list of things to check against 1.1.> but i planned to wait for RC2... :-)>> alex>> On Mon, 30 Oct 2006 02:13:07 -0200, robert lazarski wrote
> > Hi alex,> >> > Actually the latest axis2 nightlies and the soon to be released 1.1> > will not include the spring 1.2.8 libs, one of the reasons being the> > spring 2.0
 release and not knowing which version users will be using.> > There is however the axis2-spring-*.jar included in the distro which> > does support using spring via a servlet context or inside the aar, as
> > documented here:> >> >> http://svn.apache.org/repos/asf/webservices/axis2/branches/java/1_1/xdocs/1_1/spring.html
> >> > The good news is I just gave spring 2.0 a spin and it worked as> > expected, as axis2 really only uses core funtionality.> >> > We are getting close to a 1.1 release and if you could give the
> > spring support in axis2 a test drive it would be appreciated.> >> > Thanks,> > Robert> >> > On 10/28/06, Alex Hollerith <
[EMAIL PROTECTED]> wrote:> > > hi,> > >> > > i saw that spring 1.2.8 libraries are now part of the axis2 1.1 package.> > > any plans to move to spring 2.0? are there any version specific dependencies
> > > to spring 1.2.8 or can the libs safely be replaced by spring 2.0 libraries?> > >> > > i am asking this because we integrated a spring 2.0 based application> > > with axis2 
1.0 by hand and i would like to think about moving to the> > > spring integration that comes with axis2 1.1.> > >> > > thanks> > > alex> > >> > >
> > >> > > -> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]> > >> > >> >> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]> > For additional commands, e-mail: 
[EMAIL PROTECTED]>>> -> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]>>--http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/-To unsubscribe, e-mail: 
[EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]


Re: Can I put the interface name and the implemented class name in the services.xml ?

2006-10-09 Thread Rajith Attapattu
Here is an alternative stratergy if it's acceptable for your requirments.You can leverage the axis2 spring support to do what you want to do.Your web service can work with the business interfaces and get spring to wire the impl during runtime.
This way it gives you the flexibility of mainting a your business methods via a set of interfaces and also swap the impls through configuration.Hope this helps.Regards,Rajith
On 10/9/06, Reddy, Sanket (US - Hyderabad) <
[EMAIL PROTECTED]> wrote:
HI GuysIn services.xml , can i mention the Interface name and then theimplemented class name. Are there any params which accepts the interfacename?As everywhere I have seen the class name given in the class="asas" />      This is my first service, which says hello      HelloWorld
     class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>   As all buisness methods in my project are exposed with the interfaces,
can I somehow mention that.Or it doest make sense to expose the functionality from interface as weare mentioning the class directly in the services.xml.I am little confused.Regards
Sanket
This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law.  If you are not the intended recipient, you should delete this message.
Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1]-

To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: 
[EMAIL PROTECTED]




Re: [axis2] use spring configured bean inside axis2 as implementation class

2006-08-04 Thread Rajith Attapattu
Hi Anderson,Thanks for the feedback and I definitely appreciate it.Once you are free please try out the fix by Dims to the class loading issue.I guess that will take care of the main concern you have.
 
Also you don't have to expose your spring beans (the ones that implement the business logic) directly to leverage the spring support.also please see my comments inline. 
Regards,
 
Rajith 
On 8/3/06, Dave Andreasen < [EMAIL PROTECTED]
> wrote:




Hi Rajith,
 
Here is how I am putting my application together.  I have a set of core services that are Spring beans.  I use Hibernate as my persistence tier.  The Web services layer calls a Spring service that implements the business logic.

 
Axis2's Spring support allows the developer to expose Spring beans as Web Services.  However, I don't really want to expose my Spring beans directly as Web Services.  My main motivation for this is that I can change the service interfaces without affecting my public Web services interface.  I can also hide some service interfaces that are used by other services but should not be publicly available (I could also just not expose them in the WSDL too).  I am also thinking it might help me with versioning down the road since I can have different Web service endpoints for different versions of my API. 

[RA] You don't have to expose your spring beans (the ones that implement the business logic) directly to leverage the spring support.You could still have the WebService that calls your core spring beans (which implements the business logic) as Spring beans. So you are not directly exposing your business logic, but still you are using spring to wire your web service with the spring beans that implement the business logic.

For examplepublic class MyWebService {  private MyGreeting myGreeting;             // let spring inject the dependency         public void setMyGreeting(myGreeting){  
this.myGreeting = myGreeting;  }  public String greet(String name){   return myGreeting.greetAccordingToTheTimeOfDay(name);  }}//your business logicpublic class MyGreetingImpl implements MyGreeting{ 
    public  String greetAccordingToTheTimeOfDay(String name){    // if morning   return "Good morning " + name:       }      public String greetWithLove(String name){ 
   // .   }} 




My main issues with using Axis2 and Spring revolved around the Service classloader.  Spring likes to use the context classloader which does not have access to the resources deployed with the service.  I tried setting the classloader for Spring (one can set the classloader for the application context and the bean loader) but I ran into some problems with setting properties on Spring beans that I chalked up to permissions issues.  My current workaround is ugly but it works.  I deploy the Spring jars and the core services jar in the WEB-INF/lib for Axis2.  My service AAR just contains the Web Service skeletons.

 
I do want to try the latest build.  The changes in the Service classloader look promising. Unfortunately I am going on vacation for a few days after today.  I am also trying to do a QA drop before I go so I am quite busy today.  That means I can't try the nightly build until late next week.  I would really like to not have to mess with the 
axis2.war so I am eager to try it out.
 
Thanks for the quick response on the issue though.
 
Dave




From: Rajith Attapattu [mailto:
[EMAIL PROTECTED]] Sent: Tuesday, August 01, 2006 7:50 PM
To: axis-user@ws.apache.org; 
[EMAIL PROTECTED]Subject: Re: [axis2] use spring configured bean inside axis2 as implementation class

 
Anderson
 ,>I didn't use the extensions because they didn't apply to the approach we used for creating our Spring beans.  I did create an Axis module that loads my Spring >beans on Axis startup. 
Anderson if you don't mind I would like to hear about your use case about the spring bean creation. Perhaps we can improve our spring support based on your feedback.Regards,Rajith

On 7/31/06, Dave Andreasen <
[EMAIL PROTECTED]> wrote:



I had the same issue.  The problem is related to the Service using it's own classloader and Spring wanting to use the thread context classloader.  See 
http://issues.apache.org/jira/browse/AXIS2-400.  
 
There have been some extensions made to support Spring in Axis2 in the nightly builds.  You try pulling them down to see if they help you out.  Look at JIRA issue 
http://issues.apache.org/jira/browse/AXIS2-272 for more information
 
I didn't use the extensions because they didn't apply to the approach we used for creating our Spring beans.  I did create an Axis module that loads my Spring beans on Axis startup.  

 
Hope this helps!
 
Dave Andreasen
 




From: Shaowei Mao [mailto: 
[EMAIL PROTECTED]] Sent: Monday, July 31, 2006 2:59 PM
To: axis-user@ws.apache.org
Subject: [axis2] use spring configured bean inside axis2 as imple

Re: Book for Axis (NEXT)

2006-08-02 Thread Rajith Attapattu
Jose,
 
Axis2 is defnitely a huge improvement over Axis 1.x 
>The user group (newsgroup) of Axis 2 seems to have more questions/mails than Axis 1.x - I >am folowing both
 
>Does this means that there is more problems using Axis 2 because of lacks of >documentation or because it is still not a mature release.
 
Not at all. Axis 1.x does not have active development and it's mostly in supported mode (bug fixes and periodic release cycles ..ect)
 
Axis2 has a lot of active development going on and there are lots of people using/trying it out.
Thats why u see a lot of traffic for Axis2.
 
 
Regards,
 
Rajith 
On 8/2/06, José Ferreiro <[EMAIL PROTECTED]> wrote:


Well, 
 
All my developpers friends are using Apache 1.x and no one is using Axis 2...
I don't know really what is the best, but if they are all using Apache 1.x it should be because of something...
 
The user group (newsgroup) of Axis 2 seems to have more questions/mails than Axis 1.x - I am folowing both
 
Does this means that there is more problems using Axis 2 because of lacks of documentation or because it is still not a mature release. I cannot answer or figure out an answer.
 
And as we all know things in computer science use to go very fast.
 
Then does anyone has an input to give about Apache Axis 1.x against Apache Axis 2?
 
Thank you for your contribution.
 
Regards
José 
On 8/2/06, Wenbo Zhu <[EMAIL PROTECTED]> wrote: 




I also like to hear about the actual use/design of Axis 2, compared to 1.3 ... ?

 


-Original Message-From: sudip shrestha [mailto:
 [EMAIL PROTECTED]] Sent: Wednesday, August 02, 2006 3:52 PMTo: axis-user@ws.apache.org 
Subject: Re: Book for AxisWondering if Axis 2 is production ready or if not when we should expect it to be production ready?
On 8/2/06, José Ferreiro < [EMAIL PROTECTED] 
> wrote: 

hello Sudip,I am also new to web services and I bought this book: http://agileskills2.org/DWSAA/ 
I am interested in WSS4J security.As I am a beginner I don't know if this is a good book or not. I start it and it is not too bad.It explains Eclipse, Axis 1.3 and WSS4J! Hope this helps. I am starting soon also with a project about web services. 
However I think I will use Axis 1.4 (obviously Axis 2 is another way). Some comments from someone between Axis 1.x and Axis2 will be appreciated.Thank you.José

On 8/2/06, sudip shrestha < [EMAIL PROTECTED]> wrote: 


Hi,What is a good reference book for Apache Axis?  Need to start diggin into Web Services  I am new to web services, should I jump into Axis 2, (not studyin Axis 2)?  

-- José FerreiroEPFL Communication Systems engineering.sys.com.dipl.EPFLPhone: +41 (0)79 644 98 25 [+41 (0)76 526 55 55] 



Re: Axis2: Installing Axis2 as part of existing web application

2006-08-02 Thread Rajith Attapattu
Syam,
 
Do u want to have Axis2 bundled with your existing web app? 
Like do u wanna have Axis2 and your web app to be deployed as a single WAR file?
 
if so check the following article by Dims
 
http://www.wso2.net/kb/90
 
Regards,
 
Rajith
 
On 8/2/06, Syam Prasad <[EMAIL PROTECTED]> wrote:




 
Hi,
 
Can anybody tell me how to install axis2 as part of existing web application? I do not see anywhere in the documentation. It will be great even if you can point me in right direction.

 
Thanks,
Syam 


Re: [axis2] use spring configured bean inside axis2 as implementation class

2006-08-01 Thread Rajith Attapattu
Anderson,>I didn't use the extensions because
they didn't apply to the approach we used for creating our Spring
beans.  I did create an Axis module that loads my Spring >beans on Axis
startup. Anderson if you don't mind I would like to hear about your use case about the spring bean creation. Perhaps we can improve our spring support based on your feedback.Regards,
RajithOn 7/31/06, Dave Andreasen <[EMAIL PROTECTED]> wrote:














I had the same issue.  The problem is
related to the Service using it's own classloader and Spring wanting to
use the thread context classloader.  See http://issues.apache.org/jira/browse/AXIS2-400.
 

 

There have been some extensions made to
support Spring in Axis2 in the nightly builds.  You try pulling them down
to see if they help you out.  Look at JIRA issue http://issues.apache.org/jira/browse/AXIS2-272

for more information

 

I didn't use the extensions because
they didn't apply to the approach we used for creating our Spring
beans.  I did create an Axis module that loads my Spring beans on Axis
startup.  

 

Hope this helps!

 

Dave Andreasen

 









From: Shaowei Mao
[mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 31, 2006 2:59
PM
To: axis-user@ws.apache.org
Subject: [axis2] use spring
configured bean inside axis2 as implementation class



 

Hi, I am trying to use
spring configured bean by creating spring container inside skeleton generated
by wsdl2java to create my own implementation class for web service, but spring
container BeanFactory can't load my classes packaged inside axis2 aar file. I
think this is related to class loader aixs2 is using for each web service. Does
anyone have sample code to solve this problem?

 

Shaowei Mao

aMind Solutions LLC

Phone: 425-313-3107

Email: [EMAIL PROTECTED]


website: www.amindsolutions.com