Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 38832 invoked from network); 2 Apr 2008 15:02:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Apr 2008 15:02:54 -0000 Received: (qmail 51571 invoked by uid 500); 2 Apr 2008 15:02:45 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 51342 invoked by uid 500); 2 Apr 2008 15:02:44 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 51331 invoked by uid 99); 2 Apr 2008 15:02:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 08:02:44 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of danielabarreiroclaro@gmail.com designates 64.233.184.230 as permitted sender) Received: from [64.233.184.230] (HELO wr-out-0506.google.com) (64.233.184.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 15:02:03 +0000 Received: by wr-out-0506.google.com with SMTP id 68so1745871wra.7 for ; Wed, 02 Apr 2008 08:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; bh=83OISaWQgpytUaBXGixW+cxjD+nvkrPHUTpo+143XXI=; b=Q8M87iCTl8zWnoN03O3kC5Qc29tXw7q5gdr1i7LOiVs28zEprq0SE0vabQgUsuTira1Bhk4BKkZ3jqXYg3WXmchCkSOQ3x/EsdGmMDJNCAa2FSU1je6lHmlVddIoDoRJbLpkN/RhYAfezR5OMkgAABGplroq5HlJocBtyL4RPSo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=PRN0aSMPdYtohYp7Z/crFNHZp8l02yAlqsBRj20ioYErJzP/D0pSKHjq0Pj+XnRB2mayquBAcsdut0iQVcnY1dOkZMWFoRFFEmlf1bJeMfmcJMbAcCOBxEAQlIgQc2PEo1JRcdyzyAd/wb5DjC8u2dFrFZyUCr0R5bta4xx86Jo= Received: by 10.141.172.6 with SMTP id z6mr5017972rvo.136.1207148533228; Wed, 02 Apr 2008 08:02:13 -0700 (PDT) Received: by 10.141.33.5 with HTTP; Wed, 2 Apr 2008 08:02:13 -0700 (PDT) Message-ID: Date: Wed, 2 Apr 2008 12:02:13 -0300 From: "Daniela Claro" Sender: danielabarreiroclaro@gmail.com To: axis-user@ws.apache.org Subject: Re: WS Performance In-Reply-To: <817522051E65D511A2740001028074C403E81EE0@EX1> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1408_7326718.1207148533216" References: <817522051E65D511A2740001028074C403E81EE0@EX1> X-Google-Sender-Auth: 754158dfe00f87ce X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_1408_7326718.1207148533216 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Alick, First of all, thank you ! Clarifying some points: 1. I am using directly the IP address in order to not have problems with DNS, such as: url[0] =3D"http://192.168.1.161:8080/webservices/EscalierBeton.jws"; url[1] =3D"http://192.168.1.161:8080/webservices/FournitureBetonENT2.jws"= ; url[2] =3D"http://192.168.1.161:8080/webservices/FournitureBois.jws"; url[3] =3D"http://192.168.1.161:8080/webservices/FournitureFerENT.jws"; 2. I tried using java.net.URL site =3D new URL(url[n]); URLConnection siteCon =3D site.openConnection(); instead of using Sockets, I retrieved the content of the page, and everything works fine. BufferedReader in =3D new BufferedReader(new InputStreamReader(siteCon.getInputStream())); String inputLine; while((inputLine =3D in.readLine())!=3D null) System.out.println(inputLine); in.close(); I think that the problem in when executing SOAP request within AXIS. How can I test SOAP connections without using AXIS, only to test the networ= k latency? Thank you again. 2008/4/1, Alick Buckley : > > Hi, > > Just to confirm what you are doing. > > Machine 1 ( Axis SOAP client ) ---------> TCP/IP HTTP SOAP > -------------> Machine 2 ( SOAP Server ) > > Your example endpont address uses localhost > > http://localhost:8080/webservices/EscalierBeton.jws > > I assume the cross machine test is: > > http://machine2:8080/webservices/EscalierBeton.jws > > 1. You could have a slow DNS lookup to resolve the domain name to IP > address > > If you are using Windows on Machine 1 you could add the domain name to th= e > hosts file for a test > > Example: C:\WINNT\system32\drivers\etc\hosts > > > 2. You could write a simple Java program that creates a Socket connect to > the Machine 2 and POSTs a prepared SOAP message. ( This is eliminate the > Axis client ) > > Socket socket =3D new Socket ( machine2:8080 ) > > OutputStream o =3D socket.getOutputStream > o.write ( HTTP protocol ) > o.write ( SOAP content ) > > InputStream input =3D socket.getInputStream > > read input > > socket.close () > > > > > > > > > -----Original Message----- > *From:* Daniela Claro [mailto:danielabarreiroclaro@gmail.com] > *Sent:* Wednesday, 2 April 2008 12:03 AM > *To:* axis-user@ws.apache.org > *Subject:* WS Performance > > Hi all, > I am using Axis to develop Web services, but until right now I was using > all WS locally. It took about 22milleseconds to execute. Very fast. > However > I put them in a LAN, within two machines, and the same Web service took > about 4000 miliseconds to execute. I was astonished! What am I doing > wrong? > > I put in annexe my Test class in java so you can see what I am actually > doing to run all of them. All four Web services has only one method that > returns OK as a String when it is executed, nothing more than this. > > Thus I would like to know what shall I do to make my WS more faster. I am > using axis 1.3. > > Thank you so much, > Daniela > > > public class TestPerformanceExecutionAxisWS{ > > > public static void main(String args[]){ > String url[] =3D new String[4]; > url[0] =3D"http://localhost:8080/webservices/EscalierBeton.jws"; > url[1] =3D"http://localhost:8080/webservices/FournitureBetonENT2.jws"; > url[2] =3D"http://localhost:8080/webservices/FournitureBois.jws"; > url[3] =3D"http://localhost:8080/webservices/FournitureFerENT.jws"; > > String method =3D "executeWS"; > > int n=3D0; > long startTime =3D System.currentTimeMillis(); > long averageWS=3D0; > for (int i =3D 0; i<400;i++){ > try{ > > long startWS =3D System.currentTimeMillis(); > ExecuteWSviaAxis oExecuteWS =3D new ExecuteWSviaAxis(url[n],method); > n++; > if (n=3D=3D3) n=3D0; > String result =3D oExecuteWS.executeWS(); > long finalWS =3D System.currentTimeMillis(); > long totalWS =3D finalWS-startWS; > averageWS =3D averageWS+totalWS; > > }catch(Exception e){ > e.printStackTrace(); > } > > } > long finalTime =3D System.currentTimeMillis(); > long totalTime =3D finalTime - startTime; > System.out.println("***************************"); > System.out.println("TOTAL TIME:"+totalTime); > System.out.println("AVERAGE TIME:"+averageWS/400); > } > } > > > > /** > *ExecuteWSviaAxis > */ > > > import org.apache.axis.client.Call; > import org.apache.axis.client.Service; > import org.apache.axis.encoding.XMLType; > import org.apache.axis.utils.Options; > > import javax.xml.rpc.ParameterMode; > > public class ExecuteWSviaAxis { > String endpoint; > String method; > > public ExecuteWSviaAxis(String urlService, String method){ > this.endpoint =3D urlService; > this.method =3D method; > } > > public String executeWS() throws Exception{ > String result=3D""; > > try{ > Service service =3D new Service(); > Call call =3D (Call) service.createCall(); > > call.setTargetEndpointAddress( new java.net.URL(endpoint) ); > call.setOperationName( method ); > > call.setReturnType( XMLType.XSD_STRING ); > > System.out.println("***********"); > System.out.println("*********** Starting Web service with AXIS > ******************"); > System.out.println("*********** Service endpoint:"+endpoint); > result =3D (String) call.invoke(new Object [] {}); > System.out.println("*********** Finishing Web service with AXIS > ******************"); > System.out.println("***********"); > > System.out.println("ResultadoServiceAxis:" + result); > > }catch(Exception e){ > System.out.println("ERRO AXIS Method:prepareServiceToExecution > inside MPExecution:"); > > } > > > return result; > > } > } > > --=20 -- Prof=AA Dr=AA Daniela Barreiro Claro Pesquisadora no LASID/DCC/UFBA Salvador - Bahia - Brasil ------=_Part_1408_7326718.1207148533216 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi Alick,
 First of all, thank you ! Clarifying some points:
1. I am using directly the IP address in order to not have problems wi= th DNS, such as:
 
2. I tried using
    java.net.URL site =3D new URL(url[n]);
 &nb= sp;  URLConnection siteCon =3D site.openConnection();
 
instead of using Sockets,  I retrieved the content of the page, a= nd everything works fine.
 
BufferedReader in =3D new BufferedReader(new InputStreamReader(siteCon= .getInputStream()));
    String inputLine;
 =    
    while((inputLine =3D in.readL= ine())!=3D null) 
     System.out.println(= inputLine);  
  
    in.close();
 
I think that the problem in when executing SOAP request within AXIS. <= /div>
 
How can I test SOAP connections without using AXIS, only to test the n= etwork latency?
 
Thank you again.
 


 
2008/4/1, Alick Buckley <Alick.Buckley@lansa.com.au>:
Hi,
=  
Just to confir= m what you are doing.
=  
  &n= bsp; Machine 1 ( Axis SOAP client ) ---------> TCP/IP HTTP SOAP --------= -----> Machine 2 ( SOAP Server )
=  
Your example e= ndpont address uses localhost
 
=  
I assume the c= ross machine test is:
=  
=  
1. You could h= ave a slow DNS lookup to resolve the domain name to IP address
=  
If you are usi= ng Windows on Machine 1 you could add the domain name to the hosts file for= a test
=  
Example: C:\WI= NNT\system32\drivers\etc\hosts
=  
=  
2. You could w= rite a simple Java program that creates a Socket connect to the Machine 2 a= nd POSTs a prepared SOAP message. ( This is eliminate the Axis client )
=  
    Socket socket =3D new Socket ( machine2:8080 )
=  
    OutputStream o =3D socket.getOutputStream
    o.write ( HTTP protocol )
    o.write ( SOAP content )
=  
    InputStream input =3D socket.getInputStream
=  
    read input
=  
    socket.close ()
=  
=  
=  
=  
=  
=  
=  
-----Origi= nal Message-----
From: Daniela Claro [mailto:danielabarreiroclaro@gmail.com]
Sent: Wednesday, 2 April 2008 12:03 AM
To: axis-user@ws.apache.org
Subject: = WS Performance

Hi all,
I am using Axis to develop Web services, but un= til right now I was using
all WS locally. It took about 22milleseconds t= o execute. Very fast. However
I put them in a LAN, within two machines, = and the same Web service took
about 4000 miliseconds to execute. I was astonished! What am I doing wrong?=

I put in annexe my Test class in java so you can see what I am actu= ally
doing to run all of them. All four Web services has only one method= that
returns OK as a String when it is executed, nothing more than this.

= Thus I would like to know what shall I do to make my WS more faster. I amusing axis 1.3.

Thank you so much,
Daniela


public cl= ass TestPerformanceExecutionAxisWS{


public static void main(String args[]){
String url[] =3D new Str= ing[4];
url[0] =3D"http://localhost:8080/webservices/EscalierBeton.jws&quo= t;;
url[1] =3D"http://localhost:8080/webservices/FournitureBetonENT2.jws&q= uot;;
url[2] =3D"http://localhost:8080/webservices/FournitureBois.jws";
ur= l[3] =3D"http://localhost:8080/webservices/FournitureFerENT.jws";

String method     =3D "executeWS";
int n=3D0;
long startTime =3D System.currentTimeMillis();
long avera= geWS=3D0;
for (int i =3D 0; i<400;i++){
  try{

&n= bsp;  long startWS =3D System.currentTimeMillis();
   ExecuteWSviaAxis oExecuteWS =3D new ExecuteWSviaAxis(url[n],me= thod);
   n++;
   if (n=3D=3D3) n=3D0;
 &= nbsp; String result =3D oExecuteWS.executeWS();
   long finalW= S =3D System.currentTimeMillis();
   long totalWS =3D finalWS-= startWS;
   averageWS =3D averageWS+totalWS;

  }catch(Exc= eption e){
   e.printStackTrace();
  }

}long finalTime =3D System.currentTimeMillis();
long totalTime =3D fina= lTime - startTime;
System.out.println("***************************&= quot;);
System.out.println("TOTAL TIME:"+totalTime);
System.out.printl= n("AVERAGE TIME:"+averageWS/400);
}
}



/***ExecuteWSviaAxis
*/


import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.X= MLType;
import org.apache.axis.utils.Options;

import javax.xml.rp= c.ParameterMode;

public class ExecuteWSviaAxis  {
Strin= g endpoint;
String method;

public ExecuteWSviaAxis(String urlService, String met= hod){
this.endpoint =3D urlService;
this.method =3D method;
}
<= br>   public String executeWS() throws Exception{
  =   String result=3D"";

    try{
       Se= rvice  service =3D new Service();
    &nbs= p;  Call     call    =3D (Call= ) service.createCall();

       call.se= tTargetEndpointAddress( new java.net.URL(endpoint) );
   =     call.setOperationName( method );

       call.setReturnType( XMLType.XSD_ST= RING );

       System.out.println(&quo= t;***********");
       System.out.pr= intln("*********** Starting Web service with AXIS
*****************= *");
       System.out.println("*********** S= ervice endpoint:"+endpoint);
       r= esult =3D (String) call.invoke(new Object [] {});
   &nbs= p;   System.out.println("*********** Finishing Web service w= ith AXIS
******************");
    System.out.println("***********");
       System.out.println("ResultadoSer= viceAxis:" + result);

    &nb= sp; }catch(Exception e){
       =  System.out.println("ERRO AXIS Method:prepareServiceToExecution inside MPExecution:");

      }

      return result;

 &n= bsp;}
}



--
--
Prof=AA Dr=AA Daniela Barreiro Claro
Pesquisadora= no LASID/DCC/UFBA
Salvador - Bahia - Brasil=20 ------=_Part_1408_7326718.1207148533216--