Re: JAX-WS support in axis2

2008-12-21 Thread Amila Suriarachchi
On Mon, Dec 22, 2008 at 12:54 PM, Shehan Simen  wrote:

>  Hi,
>
> I would like to know how far Axis2 supports JAX-WS.
>
> Metro fully uses JAX-WS. If I want to use jax-ws, is there any reason that
> I should select axis2 instead of Metro?
>
> The reason to use Jax-ws is that I can use jaxb separately in other
> projects to validate the xml files. And then feed those xml files to the web
> service directly, then for sure I know that there won't be any mismatch
> between the xml syntax.
>
>
>
> If I use ADB instead of JAXB, can I guarantee that I can pass an xml
> document to the web service, which is validated against JAXB?
>
One option here is to use the jaxbri data binding with the wsdl2java tool.
(-d jaxbri) then you have the jaxbri code for data binding.

> Or is there a way that I can validate an xml document against ADB separate
> from web service? It is also a viable option for me. (to select axis2
> instead of Metro)
>
>
>
> Please axis2 gurus, reply me.
>
>
>
> Thanks.
>
>
>



-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/


JAX-WS support in axis2

2008-12-21 Thread Shehan Simen
Hi,
I would like to know how far Axis2 supports JAX-WS.
Metro fully uses JAX-WS. If I want to use jax-ws, is there any reason that I 
should select axis2 instead of Metro?
The reason to use Jax-ws is that I can use jaxb separately in other projects to 
validate the xml files. And then feed those xml files to the web service 
directly, then for sure I know that there won't be any mismatch between the xml 
syntax.

If I use ADB instead of JAXB, can I guarantee that I can pass an xml document 
to the web service, which is validated against JAXB?
Or is there a way that I can validate an xml document against ADB separate from 
web service? It is also a viable option for me. (to select axis2 instead of 
Metro)

Please axis2 gurus, reply me.

Thanks.



Permission Denied - Attachments

2008-12-21 Thread John B. Moore
I've installed an open source DMS (Document Management System) called 
Xinco that uses Axis between the server and a Java WebStart application.


OS: CentOS 4.7
Tomcat 5.5.23

It uses Attachments when uploading larger files.

I'm getting the error listed below

I'm trying to understand where Axis is try to write this temp file. I've 
look through the source at the method flushtoDisk() This is where the 
error is triggered, but it is not clear at this point where this 
directory is trying to be created.


I had assumed, wrongly it was trying to write to the tomcat/temp 
directory, but that does not seem to be the case..


Can anyone point in the right direction...

Thank you

John..




== Error =
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.io.IOException: Permission denied
 faultActor:
 faultNode:
 faultDetail:
	{http://xml.apache.org/axis/}stackTrace:java.io.IOException: Permission 
denied

at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1704)
at java.io.File.createTempFile(File.java:1793)
	at 
org.apache.axis.attachments.ManagedMemoryDataSource.flushToDisk(ManagedMemoryDataSource.java:386)
	at 
org.apache.axis.attachments.ManagedMemoryDataSource.write(ManagedMemoryDataSource.java:276)
	at 
org.apache.axis.attachments.ManagedMemoryDataSource.(ManagedMemoryDataSource.java:149)
	at 
org.apache.axis.attachments.MultiPartRelatedInputStream.readTillFound(MultiPartRelatedInputStream.java:557)
	at 
org.apache.axis.attachments.MultiPartRelatedInputStream.readAll(MultiPartRelatedInputStream.java:433)
	at 
org.apache.axis.attachments.MultiPartRelatedInputStream.getAttachments(MultiPartRelatedInputStream.java:439)
	at 
org.apache.axis.attachments.AttachmentsImpl.mergeinAttachments(AttachmentsImpl.java:171)
	at 
org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:550)

at org.apache.axis.Message.getAttachments(Message.java:689)


Re: thread safe axis2 client stub

2008-12-21 Thread Amila Suriarachchi
On Mon, Dec 22, 2008 at 2:14 AM, Deepal Jayasinghe wrote:

>
> >
> > We used the commons pooling approach in the end but only creating one
> > ConfigurationContext. This seems to work well. The only thing that
> worries
> > me now is Deepals last comment. Any insight into this?
> >
> Well cleaning up the transports is good in every cases, specially when
> you use the case configuration context and if you try to invoke
> considerable amount of service call. Then you will get some exception
> due to open client sockets. So to clean them service client has an API.
>
> If you do not have any problem with what you are doing, then you do not
> need to worry about the transport cleanup, but in a long run you might
> need to clean the transports.


hi Deepal,
Do you know the exact reason for not been  thread safe?

The generated stub class operations cleans up the transport at the finally
block.

} finally {

_messageContext.getTransportOut().getSender().cleanup(_messageContext);
}

The only state variable _serviceClient which keeps a serviceContext object.
As a result of this every operation Client uses same serviceContext Object.
But this won't make any problem unless you use different options for
different operation invocations.
This can be avoided by creating new stub objects per operation using the
same configuration context object.

As I know axis2 works in a state less manner. It uses some thread safe
tables to keep dispatching and callback information. Unless some one using
some stateful invocations (using different scope other than request) it
should work in thread safe manner.

thanks,
Amila.


>
> Deepal
> > Merry Xmas.
> >
> > -Original Message-
> > From: Deepal jayasinghe [mailto:deep...@gmail.com]
> > Sent: 21 December 2008 15:00
> > To: axis-user@ws.apache.org
> > Subject: Re: thread safe axis2 client stub
> >
> > Yes, creating ConfigurationContext is very expensive since it involve
> > reading various files. So as Thilina mentioned create a
> ConfigurationContext
> > and use the created ConfigurationContext for subsequent call. Simply when
> > you create the stub pass the same configuration context.
> >
> > However when you use this approach, do not forget to cleanup the
> transport.
> > You can do that by getting the service client from the stub, and calling
> its
> > cleanup transport method.
> >
> > Deepal
> >
> >> AFAIK creating a stub is not expensive, but creating the
> >> AxisConfiguration & ConfigurationContext is very expensive. You can
> >> create one AxisConfiguration & ConfigurationContext and share it
> >> across any number of clients. No need to create them per thread basis..
> >>
> >> thanks,
> >> Thilina
> >>
> >> On Mon, Dec 15, 2008 at 12:51 AM, Shehan Simen  >> > wrote:
> >>
> >> Hi Samera,
> >>
> >> So do we have to create a ConfigurationContext for each thread?
> >> Is'nt it too much for each thread?
> >>
> >>
> >>
> >> Regards,
> >>
> >> Shehan
> >>
> >>
> >>
> >> *From:* Sameera Jayasoma [mailto:sameera.madus...@gmail.com
> >> ]
> >> *Sent:* 2008-12-15 15:06
> >>
> >> *To:* axis-user@ws.apache.org 
> >> *Subject:* Re: thread safe axis2 client stub
> >>
> >>
> >>
> >>
> >>
> >> On Tue, Dec 9, 2008 at 9:50 PM, Paul French
> >> mailto:paul.fre...@kirona.com>> wrote:
> >>
> >> This seems strange to me that the client stub cannot be made
> >> thread safe.
> >>
> >>
> >>
> >> After reading the below I have changed my client service to create
> >> the client stub on each call to one of my service methods since
> >> the client stub is not thread safe.
> >>
> >>
> >>
> >> I have no idea how inefficient this is? I have noticed that every
> >> time I create the client stub (for each and every call) I get the
> >> message:
> >>
> >>
> >>
> >> `[INFO] Deploying module: metadataExchange -
> >> file:/C:/downloads/axis2/axis2-1.4.1/lib/mex-1.4.1.jar
> >>
> >> It suggests a lot of work is going on to simply service a single
> >> web service call.
> >>
> >>
> >> you get the above message, when creating a new
> >> ConfigurationContext instance. Creating a CC instance is a heavy
> >> operation, therefore you can instantiate a CC instance once and
> >> use it for all subsequent calls.
> >>
> >> Sameera
> >>
> >>
> >>
> >>
> >> The link below suggests some tricks you can do to make things
> >> more efficient. What are these tricks?
> >>
> >>
> >>
> >> Thanks
> >>
> >> Paul
> >>
> >>
> >>
> >>
> >> --
> >> --
> >>
> >> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com
> >> ]
> >>
> >> *Sent:* 09 December 2008 04:26
> >>
> >>
> >> *To:* axis-user@ws.apache.org 

JAXBException.......in axis2 services

2008-12-21 Thread Kiran Narasareddy
Hello,I am currently working on a java project involving services in axis2.
I have written and compiled my code successfull..in java. I have used Jaxb
in my code. When I deug my code in Eclipse ide, My serivce class methods are
functioning well.M creating  an jaxb context as follows in my code..

private JAXBContext jc;
jc = JAXBContext.newInstance(DomainPath);
where DomainPath=com.mds.decision.Response .(my package
name.)



When i debug my code in java jc is created...
But when deploy this service class as my service in axis2 , and prepare a
client in .NET, by adding a web reference to the service deployed... and
invoke this service, a exception is thrown at the above code..
JaxbExceptioncould not find ObjectFactory.class or jaxb.index...

I checked my code but found that ObjectFactory.class was present...but
jaxb.index was no where to be found...I tried googling it...but was no
reference to jaxb.index any where. But I found that it just contains the
entries of the classes with no .class or .java extension each on newline, so
that jaxb should knw which classes to load at runtime. So i myself made a
jaxb.index file and entered all the classes names and redeployed the service
and invoked it via .NET. But the same error
My specifications are.
Sun SDK , Eclipse sdk 3.3.01,Apache tomcat 5.5.27 , axis2  1.4
Visual Studio 2005.

Also I recompiled  all the source files from my XSD using .XJC
complier...but the jaxb.index file was not found
Can u Please tell me where am I going Wrong.Or what may me the source of
my problem.
-- 
Kiran Narasareddy
Computers make very fast, very accurate mistakes.


Re: thread safe axis2 client stub

2008-12-21 Thread Deepal Jayasinghe

>
> We used the commons pooling approach in the end but only creating one
> ConfigurationContext. This seems to work well. The only thing that worries
> me now is Deepals last comment. Any insight into this?
>   
Well cleaning up the transports is good in every cases, specially when
you use the case configuration context and if you try to invoke
considerable amount of service call. Then you will get some exception
due to open client sockets. So to clean them service client has an API.

If you do not have any problem with what you are doing, then you do not
need to worry about the transport cleanup, but in a long run you might
need to clean the transports.

Deepal
> Merry Xmas.
>
> -Original Message-
> From: Deepal jayasinghe [mailto:deep...@gmail.com] 
> Sent: 21 December 2008 15:00
> To: axis-user@ws.apache.org
> Subject: Re: thread safe axis2 client stub
>
> Yes, creating ConfigurationContext is very expensive since it involve
> reading various files. So as Thilina mentioned create a ConfigurationContext
> and use the created ConfigurationContext for subsequent call. Simply when
> you create the stub pass the same configuration context.
>
> However when you use this approach, do not forget to cleanup the transport.
> You can do that by getting the service client from the stub, and calling its
> cleanup transport method.
>
> Deepal
>   
>> AFAIK creating a stub is not expensive, but creating the 
>> AxisConfiguration & ConfigurationContext is very expensive. You can 
>> create one AxisConfiguration & ConfigurationContext and share it 
>> across any number of clients. No need to create them per thread basis..
>>
>> thanks,
>> Thilina
>>
>> On Mon, Dec 15, 2008 at 12:51 AM, Shehan Simen > > wrote:
>>
>> Hi Samera,
>>
>> So do we have to create a ConfigurationContext for each thread?
>> Is'nt it too much for each thread?
>>
>>  
>>
>> Regards,
>>
>> Shehan
>>
>>  
>>
>> *From:* Sameera Jayasoma [mailto:sameera.madus...@gmail.com
>> ]
>> *Sent:* 2008-12-15 15:06
>>
>> *To:* axis-user@ws.apache.org 
>> *Subject:* Re: thread safe axis2 client stub
>>
>>  
>>
>>  
>>
>> On Tue, Dec 9, 2008 at 9:50 PM, Paul French
>> mailto:paul.fre...@kirona.com>> wrote:
>>
>> This seems strange to me that the client stub cannot be made
>> thread safe.
>>
>>  
>>
>> After reading the below I have changed my client service to create
>> the client stub on each call to one of my service methods since
>> the client stub is not thread safe.
>>
>>  
>>
>> I have no idea how inefficient this is? I have noticed that every
>> time I create the client stub (for each and every call) I get the
>> message:
>>
>>  
>>
>> `[INFO] Deploying module: metadataExchange -
>> file:/C:/downloads/axis2/axis2-1.4.1/lib/mex-1.4.1.jar
>>
>> It suggests a lot of work is going on to simply service a single
>> web service call.
>>
>>
>> you get the above message, when creating a new
>> ConfigurationContext instance. Creating a CC instance is a heavy
>> operation, therefore you can instantiate a CC instance once and
>> use it for all subsequent calls.
>>
>> Sameera
>>  
>>
>>  
>>
>> The link below suggests some tricks you can do to make things
>> more efficient. What are these tricks?
>>
>>  
>>
>> Thanks
>>
>> Paul
>>
>>  
>>
>> 
>> --
>> --
>>
>> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com
>> ]
>>
>> *Sent:* 09 December 2008 04:26
>>
>>
>> *To:* axis-user@ws.apache.org 
>> *Subject:* Re: thread safe axis2 client stub
>>
>>  
>>
>> I was not aware of this. If the axis2 design not permits this
>> it is better not to use it.
>>
>> thanks,
>> Amila.
>>
>> On Mon, Dec 8, 2008 at 10:00 AM, Shehan Simen
>> mailto:ssi...@itree.com.au>> wrote:
>>
>> Also this link:
>>
>> 
>> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20st
>> ub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>>
>>  
>>
>>  
>>
>> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com
>> ]
>> *Sent:* 2008-12-08 15:26
>>
>>
>> *To:* axis-user@ws.apache.org 
>> *Subject:* Re: thread safe axis2 client stub
>>
>>  
>>
>> I have tested with Axis2 1.4 and it worked fine. can you
>> please send the mail thread you mentioned?
>>
>> thanks,
>> Amila.
>>
>> On Mon, Dec 8, 2008 at 9:48 AM, Shehan Simen
>> mailto:ssi..

RE: thread safe axis2 client stub

2008-12-21 Thread Paul French
Say I create a single client stub, I have not seen it mentioned that you
need to cleanup the transport after you are done with the client stub? Hence
why do you need to do it in the below case?

By the way, I do appreciate all the comments made so far on this issue. My
understanding has increased due to your comments.

We used the commons pooling approach in the end but only creating one
ConfigurationContext. This seems to work well. The only thing that worries
me now is Deepals last comment. Any insight into this?

Merry Xmas.

-Original Message-
From: Deepal jayasinghe [mailto:deep...@gmail.com] 
Sent: 21 December 2008 15:00
To: axis-user@ws.apache.org
Subject: Re: thread safe axis2 client stub

Yes, creating ConfigurationContext is very expensive since it involve
reading various files. So as Thilina mentioned create a ConfigurationContext
and use the created ConfigurationContext for subsequent call. Simply when
you create the stub pass the same configuration context.

However when you use this approach, do not forget to cleanup the transport.
You can do that by getting the service client from the stub, and calling its
cleanup transport method.

Deepal
> AFAIK creating a stub is not expensive, but creating the 
> AxisConfiguration & ConfigurationContext is very expensive. You can 
> create one AxisConfiguration & ConfigurationContext and share it 
> across any number of clients. No need to create them per thread basis..
>
> thanks,
> Thilina
>
> On Mon, Dec 15, 2008 at 12:51 AM, Shehan Simen  > wrote:
>
> Hi Samera,
>
> So do we have to create a ConfigurationContext for each thread?
> Is'nt it too much for each thread?
>
>  
>
> Regards,
>
> Shehan
>
>  
>
> *From:* Sameera Jayasoma [mailto:sameera.madus...@gmail.com
> ]
> *Sent:* 2008-12-15 15:06
>
> *To:* axis-user@ws.apache.org 
> *Subject:* Re: thread safe axis2 client stub
>
>  
>
>  
>
> On Tue, Dec 9, 2008 at 9:50 PM, Paul French
> mailto:paul.fre...@kirona.com>> wrote:
>
> This seems strange to me that the client stub cannot be made
> thread safe.
>
>  
>
> After reading the below I have changed my client service to create
> the client stub on each call to one of my service methods since
> the client stub is not thread safe.
>
>  
>
> I have no idea how inefficient this is? I have noticed that every
> time I create the client stub (for each and every call) I get the
> message:
>
>  
>
> `[INFO] Deploying module: metadataExchange -
> file:/C:/downloads/axis2/axis2-1.4.1/lib/mex-1.4.1.jar
>
> It suggests a lot of work is going on to simply service a single
> web service call.
>
>
> you get the above message, when creating a new
> ConfigurationContext instance. Creating a CC instance is a heavy
> operation, therefore you can instantiate a CC instance once and
> use it for all subsequent calls.
>
> Sameera
>  
>
>  
>
> The link below suggests some tricks you can do to make things
> more efficient. What are these tricks?
>
>  
>
> Thanks
>
> Paul
>
>  
>
> 
> --
> --
>
> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com
> ]
>
> *Sent:* 09 December 2008 04:26
>
>
> *To:* axis-user@ws.apache.org 
> *Subject:* Re: thread safe axis2 client stub
>
>  
>
> I was not aware of this. If the axis2 design not permits this
> it is better not to use it.
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 10:00 AM, Shehan Simen
> mailto:ssi...@itree.com.au>> wrote:
>
> Also this link:
>
> 
> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20st
> ub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>
>  
>
>  
>
> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com
> ]
> *Sent:* 2008-12-08 15:26
>
>
> *To:* axis-user@ws.apache.org 
> *Subject:* Re: thread safe axis2 client stub
>
>  
>
> I have tested with Axis2 1.4 and it worked fine. can you
> please send the mail thread you mentioned?
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:48 AM, Shehan Simen
> mailto:ssi...@itree.com.au>> wrote:
>
> Hi Amila,
>
> Thank you for your response. But I found in some discussion,
> it is saying that the client stub is not thread safe. Is this
> problem fixed now? In which version I can find it then?
>
>  
>
> Regards,
>
> Shehan
>
> 

Re: thread safe axis2 client stub

2008-12-21 Thread Afkham Azeez
No, you can use a single ConfigurationContext across multiple threads.
However, if multiple thread are going to simultaneously going to change the
same properties in the Config ctx, you will need to handle the
synchronization yourself. This is true for server side code as well.

HTH
Azeez

On Mon, Dec 22, 2008 at 12:12 AM, Afkham Azeez  wrote:

> No, you can use a single ConfigurationContext across thread. However, if
> multiple thread are going to simultaneously going to change the same
> properties in the Config ctx, you will need to handle the synchronization
> yourself. This is true for server side code as well.
>
> HTH
> Azeez
>
>
> On Mon, Dec 15, 2008 at 11:21 AM, Shehan Simen wrote:
>
>>  Hi Samera,
>>
>> So do we have to create a ConfigurationContext for each thread? Is'nt it
>> too much for each thread?
>>
>>
>>
>> Regards,
>>
>> Shehan
>>
>>
>>
>> *From:* Sameera Jayasoma [mailto:sameera.madus...@gmail.com]
>> *Sent:* 2008-12-15 15:06
>>
>> *To:* axis-user@ws.apache.org
>> *Subject:* Re: thread safe axis2 client stub
>>
>>
>>
>>
>>
>> On Tue, Dec 9, 2008 at 9:50 PM, Paul French 
>> wrote:
>>
>> This seems strange to me that the client stub cannot be made thread safe.
>>
>>
>>
>> After reading the below I have changed my client service to create the
>> client stub on each call to one of my service methods since the client stub
>> is not thread safe.
>>
>>
>>
>> I have no idea how inefficient this is? I have noticed that every time I
>> create the client stub (for each and every call) I get the message:
>>
>>
>>
>> `[INFO] Deploying module: metadataExchange -
>> file:/C:/downloads/axis2/axis2-1.4.1/lib/mex-1.4.1.jar
>>
>> It suggests a lot of work is going on to simply service a single web
>> service call.
>>
>>
>> you get the above message, when creating a new ConfigurationContext
>> instance. Creating a CC instance is a heavy operation, therefore you can
>> instantiate a CC instance once and use it for all subsequent calls.
>>
>> Sameera
>>
>>
>>
>>
>> The link below suggests some tricks you can do to make things more
>> efficient. What are these tricks?
>>
>>
>>
>> Thanks
>>
>> Paul
>>
>>
>>  --
>>
>> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
>>
>> *Sent:* 09 December 2008 04:26
>>
>>
>> *To:* axis-user@ws.apache.org
>> *Subject:* Re: thread safe axis2 client stub
>>
>>
>>
>> I was not aware of this. If the axis2 design not permits this it is better
>> not to use it.
>>
>> thanks,
>> Amila.
>>
>> On Mon, Dec 8, 2008 at 10:00 AM, Shehan Simen 
>> wrote:
>>
>> Also this link:
>>
>>
>> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>>
>>
>>
>>
>>
>> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
>> *Sent:* 2008-12-08 15:26
>>
>>
>> *To:* axis-user@ws.apache.org
>> *Subject:* Re: thread safe axis2 client stub
>>
>>
>>
>> I have tested with Axis2 1.4 and it worked fine. can you please send the
>> mail thread you mentioned?
>>
>> thanks,
>> Amila.
>>
>> On Mon, Dec 8, 2008 at 9:48 AM, Shehan Simen  wrote:
>>
>> Hi Amila,
>>
>> Thank you for your response. But I found in some discussion, it is saying
>> that the client stub is not thread safe. Is this problem fixed now? In which
>> version I can find it then?
>>
>>
>>
>> Regards,
>>
>> Shehan
>>
>>
>>
>> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
>> *Sent:* 2008-12-08 15:13
>> *To:* axis-user@ws.apache.org
>> *Subject:* Re: thread safe axis2 client stub
>>
>>
>>
>> yes
>>
>> thanks,
>> Amila.
>>
>> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen  wrote:
>>
>> Hi,
>>
>> I am going to invoke a web service via a client stub generated by axis2.
>>
>> I want to have a single instance of the stub across my application.
>>
>> So when I initiate the stub (when I call the constructor), I don't like to
>> call it again throughout my application.
>>
>> Is it thread safe?
>>
>>
>>
>> Regards,
>>
>> Shehan
>>
>>
>>
>>
>> --
>> Amila Suriarachchi
>> WSO2 Inc.
>> blog: http://amilachinthaka.blogspot.com/
>>
>>
>>
>>
>> --
>> Amila Suriarachchi
>> WSO2 Inc.
>> blog: http://amilachinthaka.blogspot.com/
>>
>>
>>
>>
>> --
>> Amila Suriarachchi
>> WSO2 Inc.
>> blog: http://amilachinthaka.blogspot.com/
>>
>>
>>
>>
>> --
>> Sameera
>> http://sameera-jayasoma.blogspot.com/
>> http://www.flickr.com/photos/sameera-jayasoma
>>
>
>
>
> --
> Thanks
> Afkham Azeez
>
> Blog: http://afkham.org
> Developer Portal: http://www.wso2.org
> WSAS Blog: http://wso2wsas.blogspot.com
> Company: http://wso2.com
> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760
>



-- 
Thanks
Afkham Azeez

Blog: http://afkham.org
Developer Portal: http://www.wso2.org
WSAS Blog: http://wso2wsas.blogspot.com
Company: http://wso2.com
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760


Re: thread safe axis2 client stub

2008-12-21 Thread Afkham Azeez
No, you can use a single ConfigurationContext across thread. However, if
multiple thread are going to simultaneously going to change the same
properties in the Config ctx, you will need to handle the synchronization
yourself. This is true for server side code as well.

HTH
Azeez

On Mon, Dec 15, 2008 at 11:21 AM, Shehan Simen  wrote:

>  Hi Samera,
>
> So do we have to create a ConfigurationContext for each thread? Is'nt it
> too much for each thread?
>
>
>
> Regards,
>
> Shehan
>
>
>
> *From:* Sameera Jayasoma [mailto:sameera.madus...@gmail.com]
> *Sent:* 2008-12-15 15:06
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
>
>
> On Tue, Dec 9, 2008 at 9:50 PM, Paul French 
> wrote:
>
> This seems strange to me that the client stub cannot be made thread safe.
>
>
>
> After reading the below I have changed my client service to create the
> client stub on each call to one of my service methods since the client stub
> is not thread safe.
>
>
>
> I have no idea how inefficient this is? I have noticed that every time I
> create the client stub (for each and every call) I get the message:
>
>
>
> `[INFO] Deploying module: metadataExchange -
> file:/C:/downloads/axis2/axis2-1.4.1/lib/mex-1.4.1.jar
>
> It suggests a lot of work is going on to simply service a single web
> service call.
>
>
> you get the above message, when creating a new ConfigurationContext
> instance. Creating a CC instance is a heavy operation, therefore you can
> instantiate a CC instance once and use it for all subsequent calls.
>
> Sameera
>
>
>
>
> The link below suggests some tricks you can do to make things more
> efficient. What are these tricks?
>
>
>
> Thanks
>
> Paul
>
>
>  --
>
> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
>
> *Sent:* 09 December 2008 04:26
>
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
> I was not aware of this. If the axis2 design not permits this it is better
> not to use it.
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 10:00 AM, Shehan Simen  wrote:
>
> Also this link:
>
>
> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>
>
>
>
>
> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
> *Sent:* 2008-12-08 15:26
>
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
> I have tested with Axis2 1.4 and it worked fine. can you please send the
> mail thread you mentioned?
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:48 AM, Shehan Simen  wrote:
>
> Hi Amila,
>
> Thank you for your response. But I found in some discussion, it is saying
> that the client stub is not thread safe. Is this problem fixed now? In which
> version I can find it then?
>
>
>
> Regards,
>
> Shehan
>
>
>
> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
> *Sent:* 2008-12-08 15:13
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
> yes
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen  wrote:
>
> Hi,
>
> I am going to invoke a web service via a client stub generated by axis2.
>
> I want to have a single instance of the stub across my application.
>
> So when I initiate the stub (when I call the constructor), I don't like to
> call it again throughout my application.
>
> Is it thread safe?
>
>
>
> Regards,
>
> Shehan
>
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>
>
>
>
> --
> Sameera
> http://sameera-jayasoma.blogspot.com/
> http://www.flickr.com/photos/sameera-jayasoma
>



-- 
Thanks
Afkham Azeez

Blog: http://afkham.org
Developer Portal: http://www.wso2.org
WSAS Blog: http://wso2wsas.blogspot.com
Company: http://wso2.com
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760


Re: thread safe axis2 client stub

2008-12-21 Thread Afkham Azeez
AFAIK this was a conscious design decision. We do not do any locking or
synchronization in the stub and it is the responsibility of the of the
person who uses the stub to implement thread safety in whatever way that he
thinks is appropriate. Hence, one way you may design your solution is to
write a client class that wraps an Axis2 client stub & synchronize the
relevant places in the code within that client class. This is quite similar
to the difference between Hashtable & HashMaps. The developer can optimize
the code for better performance if he takes care of making the code thread
safe.

Creating a stub is not a very expensive operation provided that you reuse
the ConfigurationContext created once. You may also come up with a pooling
solution. Hence there is quite a lot of flexibility & you could optimize
your code for performance as you wish.

HTH
Azeez

On Wed, Dec 10, 2008 at 6:54 AM, Shehan Simen  wrote:

>  Yes, I am expecting an answer from someone who develop the axis2. It is
> very inefficient to create a stub for each call.
>
>
>
> Regards,
>
> Shehan
>
>
>
> *From:* Paul French [mailto:paul.fre...@kirona.com]
> *Sent:* 2008-12-10 03:29
> *To:* axis-user@ws.apache.org; 'David Ojeda'
> *Subject:* RE: thread safe axis2 client stub
>
>
>
>
> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>
>
>
>
>  --
>
> *From:* David Ojeda [mailto:dojeda-l...@integra.la]
> *Sent:* 09 December 2008 16:16
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
> I am also interested in this matter. I would like to hear Deepal's opinion,
> since he was the one who said that it is not thread safe.
>
> Paul:
>
> You said:
>
> > The link below suggests some tricks you can do to make things more
>
> > efficient. What are these tricks?
>
> What link?
>
> Cheers,
>
> David
>
> On Tuesday 09 December 2008 11:50:31 Paul French wrote:
>
> > This seems strange to me that the client stub cannot be made thread safe.
>
> >
>
> > After reading the below I have changed my client service to create the
>
> > client stub on each call to one of my service methods since the client
> stub
>
> > is not thread safe.
>
> >
>
> > I have no idea how inefficient this is? I have noticed that every time I
>
> > create the client stub (for each and every call) I get the message:
>
> >
>
> > `[INFO] Deploying module: metadataExchange -
>
> > file:/C:/downloads/axis2/axis2-1.4.1/lib/mex-1.4.1.jar
>
> >
>
> > It suggests a lot of work is going on to simply service a single web
>
> > service call.
>
> >
>
> > The link below suggests some tricks you can do to make things more
>
> > efficient. What are these tricks?
>
> >
>
> > Thanks
>
> > Paul
>
> >
>
> > _
>
> >
>
> > From: Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
>
> > Sent: 09 December 2008 04:26
>
> > To: axis-user@ws.apache.org
>
> > Subject: Re: thread safe axis2 client stub
>
> >
>
> >
>
> > I was not aware of this. If the axis2 design not permits this it is
> better
>
> > not to use it.
>
> >
>
> > thanks,
>
> > Amila.
>
> >
>
> >
>
> > On Mon, Dec 8, 2008 at 10:00 AM, Shehan Simen 
> wrote:
>
> >
>
> >
>
> > Also this link:
>
> >
>
> >
> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20
>
> >t hread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > From: Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
>
> > Sent: 2008-12-08 15:26
>
> >
>
> >
>
> > To: axis-user@ws.apache.org
>
> > Subject: Re: thread safe axis2 client stub
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > I have tested with Axis2 1.4 and it worked fine. can you please send the
>
> > mail thread you mentioned?
>
> >
>
> > thanks,
>
> > Amila.
>
> >
>
> > On Mon, Dec 8, 2008 at 9:48 AM, Shehan Simen 
> wrote:
>
> >
>
> > Hi Amila,
>
> >
>
> > Thank you for your response. But I found in some discussion, it is saying
>
> > that the client stub is not thread safe. Is this problem fixed now? In
>
> > which version I can find it then?
>
> >
>
> >
>
> >
>
> > Regards,
>
> >
>
> > Shehan
>
> >
>
> >
>
> >
>
> > From: Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
>
> > Sent: 2008-12-08 15:13
>
> > To: axis-user@ws.apache.org
>
> > Subject: Re: thread safe axis2 client stub
>
> >
>
> >
>
> >
>
> > yes
>
> >
>
> > thanks,
>
> > Amila.
>
> >
>
> > On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen 
> wrote:
>
> >
>
> > Hi,
>
> >
>
> > I am going to invoke a web service via a client stub generated by axis2.
>
> >
>
> > I want to have a single instance of the stub across my application.
>
> >
>
> > So when I initiate the stub (when I call the constructor), I don't like
> to
>
> > call it again throughout my application.
>
> >
>
> > Is it thread safe?
>
> >
>
> >
>
> >
>
> > Regards,
>
> >
>
> > Shehan
>
> >
>
> >
>
> >
>
> >
>
> > --
>
> > Amila Suriarachchi
>
> > WSO2 Inc.
>
> > blog: http://amilachinthaka.blogspot.com/
>
> >
>

Re: thread safe axis2 client stub

2008-12-21 Thread Deepal jayasinghe
Yes, creating ConfigurationContext is very expensive since it involve
reading various files. So as Thilina mentioned create a
ConfigurationContext and use the created ConfigurationContext for
subsequent call. Simply when you create the stub pass the same
configuration context.

However when you use this approach, do not forget to cleanup the
transport. You can do that by getting the service client from the stub,
and calling its cleanup transport method.

Deepal
> AFAIK creating a stub is not expensive, but creating the
> AxisConfiguration & ConfigurationContext is very expensive. You can
> create one AxisConfiguration & ConfigurationContext and share it
> across any number of clients. No need to create them per thread basis..
>
> thanks,
> Thilina
>
> On Mon, Dec 15, 2008 at 12:51 AM, Shehan Simen  > wrote:
>
> Hi Samera,
>
> So do we have to create a ConfigurationContext for each thread?
> Is'nt it too much for each thread?
>
>  
>
> Regards,
>
> Shehan
>
>  
>
> *From:* Sameera Jayasoma [mailto:sameera.madus...@gmail.com
> ]
> *Sent:* 2008-12-15 15:06
>
> *To:* axis-user@ws.apache.org 
> *Subject:* Re: thread safe axis2 client stub
>
>  
>
>  
>
> On Tue, Dec 9, 2008 at 9:50 PM, Paul French
> mailto:paul.fre...@kirona.com>> wrote:
>
> This seems strange to me that the client stub cannot be made
> thread safe.
>
>  
>
> After reading the below I have changed my client service to create
> the client stub on each call to one of my service methods since
> the client stub is not thread safe.
>
>  
>
> I have no idea how inefficient this is? I have noticed that every
> time I create the client stub (for each and every call) I get the
> message:
>
>  
>
> `[INFO] Deploying module: metadataExchange -
> file:/C:/downloads/axis2/axis2-1.4.1/lib/mex-1.4.1.jar
>
> It suggests a lot of work is going on to simply service a single
> web service call.
>
>
> you get the above message, when creating a new
> ConfigurationContext instance. Creating a CC instance is a heavy
> operation, therefore you can instantiate a CC instance once and
> use it for all subsequent calls.
>
> Sameera
>  
>
>  
>
> The link below suggests some tricks you can do to make things
> more efficient. What are these tricks?
>
>  
>
> Thanks
>
> Paul
>
>  
>
> 
> 
>
> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com
> ]
>
> *Sent:* 09 December 2008 04:26
>
>
> *To:* axis-user@ws.apache.org 
> *Subject:* Re: thread safe axis2 client stub
>
>  
>
> I was not aware of this. If the axis2 design not permits this
> it is better not to use it.
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 10:00 AM, Shehan Simen
> mailto:ssi...@itree.com.au>> wrote:
>
> Also this link:
>
> 
> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>
>  
>
>  
>
> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com
> ]
> *Sent:* 2008-12-08 15:26
>
>
> *To:* axis-user@ws.apache.org 
> *Subject:* Re: thread safe axis2 client stub
>
>  
>
> I have tested with Axis2 1.4 and it worked fine. can you
> please send the mail thread you mentioned?
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:48 AM, Shehan Simen
> mailto:ssi...@itree.com.au>> wrote:
>
> Hi Amila,
>
> Thank you for your response. But I found in some discussion,
> it is saying that the client stub is not thread safe. Is this
> problem fixed now? In which version I can find it then?
>
>  
>
> Regards,
>
> Shehan
>
>  
>
> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com
> ]
> *Sent:* 2008-12-08 15:13
> *To:* axis-user@ws.apache.org 
> *Subject:* Re: thread safe axis2 client stub
>
>  
>
> yes
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen
> mailto:ssi...@itree.com.au>> wrote:
>
> Hi,
>
> I am going to invoke a web service via a client stub generated
> by axis2.
>
> I want to have a single instance of the stub across my
> application.
>
> So when I initiate the stub (when I call the construc

Re: thread safe axis2 client stub

2008-12-21 Thread Thilina Gunarathne
AFAIK creating a stub is not expensive, but creating the AxisConfiguration &
ConfigurationContext is very expensive. You can create one AxisConfiguration
& ConfigurationContext and share it across any number of clients. No need to
create them per thread basis..

thanks,
Thilina

On Mon, Dec 15, 2008 at 12:51 AM, Shehan Simen  wrote:

>  Hi Samera,
>
> So do we have to create a ConfigurationContext for each thread? Is'nt it
> too much for each thread?
>
>
>
> Regards,
>
> Shehan
>
>
>
> *From:* Sameera Jayasoma [mailto:sameera.madus...@gmail.com]
> *Sent:* 2008-12-15 15:06
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
>
>
> On Tue, Dec 9, 2008 at 9:50 PM, Paul French 
> wrote:
>
> This seems strange to me that the client stub cannot be made thread safe.
>
>
>
> After reading the below I have changed my client service to create the
> client stub on each call to one of my service methods since the client stub
> is not thread safe.
>
>
>
> I have no idea how inefficient this is? I have noticed that every time I
> create the client stub (for each and every call) I get the message:
>
>
>
> `[INFO] Deploying module: metadataExchange -
> file:/C:/downloads/axis2/axis2-1.4.1/lib/mex-1.4.1.jar
>
> It suggests a lot of work is going on to simply service a single web
> service call.
>
>
> you get the above message, when creating a new ConfigurationContext
> instance. Creating a CC instance is a heavy operation, therefore you can
> instantiate a CC instance once and use it for all subsequent calls.
>
> Sameera
>
>
>
>
> The link below suggests some tricks you can do to make things more
> efficient. What are these tricks?
>
>
>
> Thanks
>
> Paul
>
>
>  --
>
> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
>
> *Sent:* 09 December 2008 04:26
>
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
> I was not aware of this. If the axis2 design not permits this it is better
> not to use it.
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 10:00 AM, Shehan Simen  wrote:
>
> Also this link:
>
>
> http://markmail.org/message/iif5rdpgqahk4u5t#query:axis2%20client%20stub%20thread%20safe+page:2+mid:eenup3ck5ib6fzqq+state:results
>
>
>
>
>
> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
> *Sent:* 2008-12-08 15:26
>
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
> I have tested with Axis2 1.4 and it worked fine. can you please send the
> mail thread you mentioned?
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:48 AM, Shehan Simen  wrote:
>
> Hi Amila,
>
> Thank you for your response. But I found in some discussion, it is saying
> that the client stub is not thread safe. Is this problem fixed now? In which
> version I can find it then?
>
>
>
> Regards,
>
> Shehan
>
>
>
> *From:* Amila Suriarachchi [mailto:amilasuriarach...@gmail.com]
> *Sent:* 2008-12-08 15:13
> *To:* axis-user@ws.apache.org
> *Subject:* Re: thread safe axis2 client stub
>
>
>
> yes
>
> thanks,
> Amila.
>
> On Mon, Dec 8, 2008 at 9:31 AM, Shehan Simen  wrote:
>
> Hi,
>
> I am going to invoke a web service via a client stub generated by axis2.
>
> I want to have a single instance of the stub across my application.
>
> So when I initiate the stub (when I call the constructor), I don't like to
> call it again throughout my application.
>
> Is it thread safe?
>
>
>
> Regards,
>
> Shehan
>
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>
>
>
>
> --
> Sameera
> http://sameera-jayasoma.blogspot.com/
> http://www.flickr.com/photos/sameera-jayasoma
>



-- 
Thilina Gunarathne  - http://thilinag.blogspot.com