RE: wsdl2java

2008-03-14 Thread Chandolu, Yuva
Using Service and Call you are making your code portable between any JAX
RPC based implementation of Web Services. That means, if you switch away
from Axis to some other JAX RPC implementation of Web Services, your
client code works (should work) without any code changes.

 

Using Stubs your client code is tied to Axis implementation (JAX RPC, of
course) because you are using Axis generated stubs classes.

 

Thanks

Yuva

 

 

 



From: Seetha Rama Krishna [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 14, 2008 4:48 AM
To: axis-user@ws.apache.org
Subject: Fwd: wsdl2java

 


Hi,
 can any one tell me  the difference for the below mail

Seetha Rama Krishna <[EMAIL PROTECTED]> wrote:

Date: Thu, 13 Mar 2008 19:03:46 + (GMT)
From: Seetha Rama Krishna <[EMAIL PROTECTED]>
Subject: wsdl2java
To: axis-user@ws.apache.org

Hi,

 What is the difference b/w client program that is generated by
using wsdl2java(i.e. generating stubs for WSDL) and writting the client
program using axis API like service.call etc..Will there any
performance difference b/w them?? If so how can we decide, which one to
adapt??

 

 

Thanks,

ram



Why delete messages? Unlimited storage is just a click away.
 





Thanks & Regards,
Krishna

  



Get the freedom to save as many mails as you wish. Click here to know
how.
 



RE: Question regarding attachments with Axis and DataHandler

2008-03-13 Thread Chandolu, Yuva
Thanks Andrea,

That gives me a hope. I would try to go in that direction and contact
you if I need any help.

-Yuva



-Original Message-
From: Andreas Veithen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2008 3:23 PM
To: axis-user@ws.apache.org
Subject: Re: Question regarding attachments with Axis and DataHandler

Yuva,

I didn't have the time yesterday to elaborate on a possible solution  
to your problem. I implemented a solution for a similar problem in JAX- 
WS some time ago, but the approach will be the same in Axis2.

What you need to do is to implement your own  
javax.activation.DataSource. The difficulty is that you can't just  
call Blob#getBinaryStream in your code, wrap it in a DataSource object  
and return it to Axis. This won't work because when Axis starts to  
read the input stream, the JDBC connection that was used to get the  
Blob has already been closed (at least if you handle your database  
connections properly with javax.sql.DataSource). The first part of the  
solution is to get the database connection, execute the query and call  
Blob#getBinaryStream inside your DataSource#getInputStream method. The  
second part of the solution is to make sure that when Axis calls  
InputStream#close, you also close the database connection. Therefore,  
in your DataSource#getInputStream method you can't just return the  
input stream from Blob#getBinaryStream, but you need to wrap it to  
intercept the call to the close method (see the "Proxy" design pattern).

I would do it like that, but it requires some coding skills. There are  
two other approaches I see:

* Write the blob to a temporary file, but this is much less efficient.  
Also, instead of the problem with database connections, you will have  
to take care to clean up the temporary files.
* Execute the query in your code, call Blob#getBinaryStream and wrap  
it in a DataSource object, but without closing the database connection  
at that moment. You will then need to retake control to close the  
connection after Axis has processed the response, by using a servlet  
filter or maybe an Axis handler. This solution would be conceptually  
similar to Spring/Hibernate's OpenSessionInViewFilter, but is more  
complicated to implement.

Regards,

Andreas


On 12 Mar 2008, at 18:56, Chandolu, Yuva wrote:

> Is there a work around/any other solution for this then? If
> ByteArrayDataSource reads whole file into memory my service would run
> out of memory if lots of client access the service at the same time.
>
>
>
> -Original Message-
> From: Andreas Veithen [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 11, 2008 5:41 PM
> To: axis-user@ws.apache.org
> Subject: Re: Question regarding attachments with Axis and DataHandler
>
> Yuva,
>
> The implementation of the ByteArrayDataSource constructor you are
> using looks as follows:
>
> public ByteArrayDataSource(InputStream is, String type) throws
> IOException {
> ByteArrayOutputStream os = new ByteArrayOutputStream();
> byte[] buf = new byte[8192];
> int len;
> while ((len = is.read(buf)) > 0)
> os.write(buf, 0, len);
> this.data = os.toByteArray();
> this.type = type;
> }
>
> As you can see, it will indeed read the entire Blob into a
> ByteArrayOutputStream and then copy it to a byte array. It is
> therefore not surprising that you run out of memory.
>
> Andreas
>
>
> On 11 Mar 2008, at 21:42, Chandolu, Yuva wrote:
>
>> Hi,
>>
>> I am trying to replace one servlet serving huge files by a
>> webservice. When request comes in, the servlet opens InputStream to
>> the file blob in database, read from the input stream and write to
>> the http output stream. When client starts pulling the data it comes
>> straight from the input stream of the servlet (pure streaming). In
>> which case the Servlet can handle 100s of clients because the
>> Servlet threads are not trying to load the whole file into memory on
>> the server side and just sending down the data when it is read from
>> the client side.
>>
>> Now I am trying to replace the servlet code by a web service. I am
>> using DataHanlder for attachements. We have big files in database
>> (each 10MB or more). When the client call my service
>> downloadfile(fileName) I need to pull it from the database and
>> create a datahandler and return to the client. My concern is what
>> will happen if 100 clients request the all big files (say each 10 MB
>> in size) using downloadFile() service. My question here is how the
>> datahandler works, will it read all the file contents from file blob
>> from database and store in memory before we return it to the client?
>> Looks like it is because my tomcat is running out of memory

RE: Question regarding attachments with Axis and DataHandler

2008-03-12 Thread Chandolu, Yuva
I get the error java.io.IOException: End of stream encountered before
final boundary marker on the client side if I use DataHandler
(InputStream, String) on the service side.

 

 



From: Chandolu, Yuva 
Sent: Wednesday, March 12, 2008 2:04 PM
To: axis-user@ws.apache.org
Subject: RE: Question regarding attachments with Axis and DataHandler

 

I tried that and get the following error

 

java.io.IOException: End of stream encountered before final boundary
marker.

 

-Yuva

 



From: Narayan Dhillon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2008 1:51 PM
To: axis-user@ws.apache.org
Subject: RE: Question regarding attachments with Axis and DataHandler

 

You could create DataHandler directly from InputStream using DataHandler
(InputStream, String) constructor.

 

-Original Message-
From: Chandolu, Yuva [mailto:[EMAIL PROTECTED] 
Sent: 12 March 2008 17:56
To: axis-user@ws.apache.org
Subject: RE: Question regarding attachments with Axis and DataHandler

 

Is there a work around/any other solution for this then? If

ByteArrayDataSource reads whole file into memory my service would run

out of memory if lots of client access the service at the same time.

 

 

 

-Original Message-

From: Andreas Veithen [mailto:[EMAIL PROTECTED] 

Sent: Tuesday, March 11, 2008 5:41 PM

To: axis-user@ws.apache.org

Subject: Re: Question regarding attachments with Axis and DataHandler

 

Yuva,

 

The implementation of the ByteArrayDataSource constructor you are  

using looks as follows:

 

public ByteArrayDataSource(InputStream is, String type) throws  

IOException {

 ByteArrayOutputStream os = new ByteArrayOutputStream();

 byte[] buf = new byte[8192];

 int len;

 while ((len = is.read(buf)) > 0)

 os.write(buf, 0, len);

 this.data = os.toByteArray();

 this.type = type;

}

 

As you can see, it will indeed read the entire Blob into a  

ByteArrayOutputStream and then copy it to a byte array. It is  

therefore not surprising that you run out of memory.

 

Andreas

 

 

On 11 Mar 2008, at 21:42, Chandolu, Yuva wrote:

 

> Hi,

> 

> I am trying to replace one servlet serving huge files by a  

> webservice. When request comes in, the servlet opens InputStream to  

> the file blob in database, read from the input stream and write to  

> the http output stream. When client starts pulling the data it comes  

> straight from the input stream of the servlet (pure streaming). In  

> which case the Servlet can handle 100s of clients because the  

> Servlet threads are not trying to load the whole file into memory on  

> the server side and just sending down the data when it is read from  

> the client side.

> 

> Now I am trying to replace the servlet code by a web service. I am  

> using DataHanlder for attachements. We have big files in database  

> (each 10MB or more). When the client call my service  

> downloadfile(fileName) I need to pull it from the database and  

> create a datahandler and return to the client. My concern is what  

> will happen if 100 clients request the all big files (say each 10 MB  

> in size) using downloadFile() service. My question here is how the  

> datahandler works, will it read all the file contents from file blob  

> from database and store in memory before we return it to the client?  

> Looks like it is because my tomcat is running out of memory when I  

> tried 20 client threads in parallel requesting for big files. How  

> can I solve the problem?

> 

> Following is my code snippet

> 

> Blob file_blob = rs.getBlob(1);

> ByteArrayDataSource bds = new  

> ByteArrayDataSource(file_blob.getBinaryStream(), "application/octet- 

> stream");

> DataHandler data_handler = new DataHandler(bds);

> 

> return data_handler;

> 

> Thanks in advance

> Yuva

 

 

-

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]

 


*
This email is issued by a VocaLink group company. It is confidential and
intended for the exclusive use of the addressee only. You should not
disclose its contents to any other person. If you are not the addressee
(or responsible for delivery of the message to the addressee), please
notify the originator immediately by return message and destroy the
original message. The contents of this email will have no contractual
effect unless it is otherwise agreed between a specific VocaLink group
company and the recipient.

The VocaLink group companies include, among others: Voc

RE: Question regarding attachments with Axis and DataHandler

2008-03-12 Thread Chandolu, Yuva
I tried that and get the following error

 

java.io.IOException: End of stream encountered before final boundary
marker.

 

-Yuva

 



From: Narayan Dhillon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2008 1:51 PM
To: axis-user@ws.apache.org
Subject: RE: Question regarding attachments with Axis and DataHandler

 

You could create DataHandler directly from InputStream using DataHandler
(InputStream, String) constructor.

 

-Original Message-
From: Chandolu, Yuva [mailto:[EMAIL PROTECTED] 
Sent: 12 March 2008 17:56
To: axis-user@ws.apache.org
Subject: RE: Question regarding attachments with Axis and DataHandler

 

Is there a work around/any other solution for this then? If

ByteArrayDataSource reads whole file into memory my service would run

out of memory if lots of client access the service at the same time.

 

 

 

-Original Message-

From: Andreas Veithen [mailto:[EMAIL PROTECTED] 

Sent: Tuesday, March 11, 2008 5:41 PM

To: axis-user@ws.apache.org

Subject: Re: Question regarding attachments with Axis and DataHandler

 

Yuva,

 

The implementation of the ByteArrayDataSource constructor you are  

using looks as follows:

 

public ByteArrayDataSource(InputStream is, String type) throws  

IOException {

 ByteArrayOutputStream os = new ByteArrayOutputStream();

 byte[] buf = new byte[8192];

 int len;

 while ((len = is.read(buf)) > 0)

 os.write(buf, 0, len);

 this.data = os.toByteArray();

 this.type = type;

}

 

As you can see, it will indeed read the entire Blob into a  

ByteArrayOutputStream and then copy it to a byte array. It is  

therefore not surprising that you run out of memory.

 

Andreas

 

 

On 11 Mar 2008, at 21:42, Chandolu, Yuva wrote:

 

> Hi,

> 

> I am trying to replace one servlet serving huge files by a  

> webservice. When request comes in, the servlet opens InputStream to  

> the file blob in database, read from the input stream and write to  

> the http output stream. When client starts pulling the data it comes  

> straight from the input stream of the servlet (pure streaming). In  

> which case the Servlet can handle 100s of clients because the  

> Servlet threads are not trying to load the whole file into memory on  

> the server side and just sending down the data when it is read from  

> the client side.

> 

> Now I am trying to replace the servlet code by a web service. I am  

> using DataHanlder for attachements. We have big files in database  

> (each 10MB or more). When the client call my service  

> downloadfile(fileName) I need to pull it from the database and  

> create a datahandler and return to the client. My concern is what  

> will happen if 100 clients request the all big files (say each 10 MB  

> in size) using downloadFile() service. My question here is how the  

> datahandler works, will it read all the file contents from file blob  

> from database and store in memory before we return it to the client?  

> Looks like it is because my tomcat is running out of memory when I  

> tried 20 client threads in parallel requesting for big files. How  

> can I solve the problem?

> 

> Following is my code snippet

> 

> Blob file_blob = rs.getBlob(1);

> ByteArrayDataSource bds = new  

> ByteArrayDataSource(file_blob.getBinaryStream(), "application/octet- 

> stream");

> DataHandler data_handler = new DataHandler(bds);

> 

> return data_handler;

> 

> Thanks in advance

> Yuva

 

 

-

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]

 


*
This email is issued by a VocaLink group company. It is confidential and
intended for the exclusive use of the addressee only. You should not
disclose its contents to any other person. If you are not the addressee
(or responsible for delivery of the message to the addressee), please
notify the originator immediately by return message and destroy the
original message. The contents of this email will have no contractual
effect unless it is otherwise agreed between a specific VocaLink group
company and the recipient.

The VocaLink group companies include, among others: VocaLink Limited
(Company No 06119048, VAT No. 907 9619 87) which is registered in
England and Wales at registered office Drake House, Homestead Road,
Rickmansworth, WD3 1FX. United Kingdom, Voca Limited (Company no
1023742, VAT No. 907 9619 87) which is registered in England and Wales
at registered office Drake House, Three Rivers Court, Homestead Road,
Rickmansworth, Hertfordshire

RE: Question regarding attachments with Axis and DataHandler

2008-03-12 Thread Chandolu, Yuva
Is there a work around/any other solution for this then? If
ByteArrayDataSource reads whole file into memory my service would run
out of memory if lots of client access the service at the same time.



-Original Message-
From: Andreas Veithen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 11, 2008 5:41 PM
To: axis-user@ws.apache.org
Subject: Re: Question regarding attachments with Axis and DataHandler

Yuva,

The implementation of the ByteArrayDataSource constructor you are  
using looks as follows:

public ByteArrayDataSource(InputStream is, String type) throws  
IOException {
 ByteArrayOutputStream os = new ByteArrayOutputStream();
 byte[] buf = new byte[8192];
 int len;
 while ((len = is.read(buf)) > 0)
 os.write(buf, 0, len);
 this.data = os.toByteArray();
 this.type = type;
}

As you can see, it will indeed read the entire Blob into a  
ByteArrayOutputStream and then copy it to a byte array. It is  
therefore not surprising that you run out of memory.

Andreas


On 11 Mar 2008, at 21:42, Chandolu, Yuva wrote:

> Hi,
>
> I am trying to replace one servlet serving huge files by a  
> webservice. When request comes in, the servlet opens InputStream to  
> the file blob in database, read from the input stream and write to  
> the http output stream. When client starts pulling the data it comes  
> straight from the input stream of the servlet (pure streaming). In  
> which case the Servlet can handle 100s of clients because the  
> Servlet threads are not trying to load the whole file into memory on  
> the server side and just sending down the data when it is read from  
> the client side.
>
> Now I am trying to replace the servlet code by a web service. I am  
> using DataHanlder for attachements. We have big files in database  
> (each 10MB or more). When the client call my service  
> downloadfile(fileName) I need to pull it from the database and  
> create a datahandler and return to the client. My concern is what  
> will happen if 100 clients request the all big files (say each 10 MB  
> in size) using downloadFile() service. My question here is how the  
> datahandler works, will it read all the file contents from file blob  
> from database and store in memory before we return it to the client?  
> Looks like it is because my tomcat is running out of memory when I  
> tried 20 client threads in parallel requesting for big files. How  
> can I solve the problem?
>
> Following is my code snippet
>
> Blob file_blob = rs.getBlob(1);
> ByteArrayDataSource bds = new  
> ByteArrayDataSource(file_blob.getBinaryStream(), "application/octet- 
> stream");
> DataHandler data_handler = new DataHandler(bds);
>
> return data_handler;
>
> Thanks in advance
> Yuva


-
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: Question regarding attachments with Axis and DataHandler

2008-03-12 Thread Chandolu, Yuva
Hi Andreas,

Is there any other way to get around this? Please let me know if you
have any other solution for this.

Thanks
Yuva



-Original Message-
From: Andreas Veithen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 11, 2008 5:41 PM
To: axis-user@ws.apache.org
Subject: Re: Question regarding attachments with Axis and DataHandler

Yuva,

The implementation of the ByteArrayDataSource constructor you are  
using looks as follows:

public ByteArrayDataSource(InputStream is, String type) throws  
IOException {
 ByteArrayOutputStream os = new ByteArrayOutputStream();
 byte[] buf = new byte[8192];
 int len;
 while ((len = is.read(buf)) > 0)
 os.write(buf, 0, len);
 this.data = os.toByteArray();
 this.type = type;
}

As you can see, it will indeed read the entire Blob into a  
ByteArrayOutputStream and then copy it to a byte array. It is  
therefore not surprising that you run out of memory.

Andreas


On 11 Mar 2008, at 21:42, Chandolu, Yuva wrote:

> Hi,
>
> I am trying to replace one servlet serving huge files by a  
> webservice. When request comes in, the servlet opens InputStream to  
> the file blob in database, read from the input stream and write to  
> the http output stream. When client starts pulling the data it comes  
> straight from the input stream of the servlet (pure streaming). In  
> which case the Servlet can handle 100s of clients because the  
> Servlet threads are not trying to load the whole file into memory on  
> the server side and just sending down the data when it is read from  
> the client side.
>
> Now I am trying to replace the servlet code by a web service. I am  
> using DataHanlder for attachements. We have big files in database  
> (each 10MB or more). When the client call my service  
> downloadfile(fileName) I need to pull it from the database and  
> create a datahandler and return to the client. My concern is what  
> will happen if 100 clients request the all big files (say each 10 MB  
> in size) using downloadFile() service. My question here is how the  
> datahandler works, will it read all the file contents from file blob  
> from database and store in memory before we return it to the client?  
> Looks like it is because my tomcat is running out of memory when I  
> tried 20 client threads in parallel requesting for big files. How  
> can I solve the problem?
>
> Following is my code snippet
>
> Blob file_blob = rs.getBlob(1);
> ByteArrayDataSource bds = new  
> ByteArrayDataSource(file_blob.getBinaryStream(), "application/octet- 
> stream");
> DataHandler data_handler = new DataHandler(bds);
>
> return data_handler;
>
> Thanks in advance
> Yuva


-
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]



Question regarding attachments with Axis and DataHandler

2008-03-11 Thread Chandolu, Yuva
Hi,

I am trying to replace one servlet serving huge files by a webservice.
When request comes in, the servlet opens InputStream to the file blob in
database, read from the input stream and write to the http output
stream. When client starts pulling the data it comes straight from the
input stream of the servlet (pure streaming). In which case the Servlet
can handle 100s of clients because the Servlet threads are not trying to
load the whole file into memory on the server side and just sending down
the data when it is read from the client side.

 

Now I am trying to replace the servlet code by a web service. I am using
DataHanlder for attachements. We have big files in database (each 10MB
or more). When the client call my service downloadfile(fileName) I need
to pull it from the database and create a datahandler and return to the
client. My concern is what will happen if 100 clients request the all
big files (say each 10 MB in size) using downloadFile() service. My
question here is how the datahandler works, will it read all the file
contents from file blob from database and store in memory before we
return it to the client? Looks like it is because my tomcat is running
out of memory when I tried 20 client threads in parallel requesting for
big files. How can I solve the problem?

Following is my code snippet

 

Blob file_blob = rs.getBlob(1);

ByteArrayDataSource bds = new
ByteArrayDataSource(file_blob.getBinaryStream(),
"application/octet-stream");

DataHandler data_handler = new DataHandler(bds);

 

return data_handler;

Thanks in advance
Yuva



How to set SimpleSessionHandler session timeout in Axis 1.4

2008-01-10 Thread Chandolu, Yuva
Hi,

 

I have a web service that uses SimpleSessionHandler to maintain
sessions. I had the following lines in my service description in
server-config.wsdd.

 

  

   

   

  

  

   

   

  

 

 

I also created the client-wsdd like following lines in it.

 





  



 



  





 

 

Session handling is working fine. I get the
MessageContext.getCurrentContext and get session from it and storing
session stuff in the session. My problem is how do I set the session
time out? Can some please let me know?. Is it some thing can be
specified in the web.xml? or server-config.wsdd? What is default timeout
it uses (axis servlet's timeout in web.xml)?

 

Thanks

Yuva