• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Web Services Performance Problem

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to use web services in our project in websphere server, In this we are using swing as client to connect the EJB, which is running thru web services. we are able to connect EJB and get the response from websphere server using web services. The below code is in EJB as business method
public Vector getData(){
Vector v = new Vector();
for(int i=0;i<20000;i++)
v.add("String");
return v;
}
I use SOAP RPC encoding and in the client side i use SOAP.jar to connect the web service and get the response.
but it takes around 8 seconds to get the response.
at the same time, i used below code in EJB as business method
public Vector getData(){
Vector v = new Vector();
for(int i=0;i<20000;i++)
v.add(new DataObject("String"));
return v;
}
public class DataObject{
String str = null;
public DataObject(String data){
str = data;
}
public String getData(){
return str;
}
public void setData(String data){
this.data = data;
}
}
here, i create object for my own DataObject class.
now i connect to this EJB, it takes double the amount of time to get the response.
Please help me, Is there any other way to increase the performance of web services?
Thanks,
Raja
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
20000 objects is a LOT to encode in XML and then decode on the client side. If I had to send 20000 strings, I would send them as an attachment - thus minimizing the amount of encoding and decoding. Adding attachment specifications to SOAP was one of the key decisions that widened the acceptance of Web Service.
Bill
 
raja jayaraman
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply.
Could you please tell me how to use Adding attachments in SOAP?
is there any website about the same, if it is, please give me the link.
Thanks,
Raja
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read chapter 13 of the Java Web Services Tutorial.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately, that chapter won't help him in he's in WebSphere and using SOAP.jar, which leads me to believe he's on WebSphere 4.0.x (and thus Apache SOAP). Raja, could you please tell us what version of WebSphere you're working with, and whether or not you are using WebSphere studio?
Kyle
 
raja jayaraman
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kyle and Lasse,
Thanks for your reply, Kyle i am using Websphere version 5.0 and Websphere Studio5.0. Please help me, how to do the attachment in SOAP using websphere.
Thanks,
Raja.
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, this article might help you out a bit -- but I'll warn you I've not tried it in the full 5.0 version.
However, my REAL recommendation is that you move PRONTO to WAS 5.02 and WSAD 5.1, which totally resolves the attachment issue by becoming JAX-RPC and SAAJ compliant (not to mention WAY faster).
Kyle
 
raja jayaraman
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kyle,
Thanks very much for your help.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic