axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anecito, Anthony (HQP)" <Tony.Anec...@rhi.com>
Subject RE: Slow instantiation of the Service class in client
Date Tue, 11 Mar 2003 21:04:59 GMT
Hi Guys,
 
I had the same problem in Windows 2000 runing on a 500MHz P3 or a 1.1GHz
K6AMD. I saw it happen in either a Sun rpc service client or an Axis one.
The call object instantiation was very quick. The best I could do was pool
the service object so I did not have to worry about serialization in the
architecture slowing things down. I am using an Applet and people told me
that using that combined with the "Big" download of Axis jars to support the
client API of Axis was the problem. I solved my problem by going to a much
lighter and very much faster implementation of client-side SOAP. My service
time is now "0sec" on the same hardware and I actually can smile again.
 
I would be interested if you find out the issue. Perhaps Brian has a
stand-alone application and Jason a mobile code type application?
 
Best Regards,
-Tony

-----Original Message-----
From: Brian Ko [mailto:brian.ko@kirus.com]
Sent: Tuesday, March 11, 2003 12:20 PM
To: 'axis-user@ws.apache.org'
Subject: RE: Slow instantiation of the Service class in client


I am a newbie in Axis. But I am also working on message style service. 
I tested your program (without service installed) in window 2000 environment
but the response was much quicker than 8 seconds. That may mean that the
slowness is from your service, not the client. If you can share your service
class code and wsdd file, I am willing to test it here.
 
Brian Ko 

Brian.Ko@kirus.com <mailto:Brian.Ko@kirus.com> 

-----Original Message-----
From: Trieu, Jason T - CNF [mailto:Trieu.Jason@cnf.com]
Sent: Tuesday, March 11, 2003 12:02 PM
To: 'axis-user@ws.apache.org'
Subject: Slow instantiation of the Service class in client



I am developing a test message-style AXIS client & server and notice that
the client takes about 8 seconds for the client to instantiate the Service
class on an IBM RS6000 AIX4.3 machine.  Is this quite normal or am I doing
something wrong?  I used the provided sample code for message-style clients
to create mine.  Below is the code.  Appreciate any insight in this.

----------------------------------------------------------------------------
-----------------------------------------------

package ping.client; 

import javax.xml.parsers.*; 
import org.w3c.dom.*; 
import org.apache.axis.client.*; 
import org.apache.axis.message.*; 
import org.apache.axis.utils.*; 
import java.io.*; 
import java.text.*; 
import java.net.URL; 
import java.util.*; 

public class pingClient { 
   

    public void sendIt(String args[]) throws Exception { 

        String endpointURL = "  <http://>
http://"+args[0]+":8080/axis/services/pingService"; 


        // Create Call object (via Service) to call server 

        // ****** This statement takes 8 seconds to complete ************* 
        Service  sv = new Service(); 


        Call call = (Call) sv.createCall(); 
        call.setTargetEndpointAddress(new URL(endpointURL)); 


        // Create a SOAP body elements to send to server 
        SOAPBodyElement[] Selems = new SOAPBodyElement[2]; 

        // Build DOM Document via Factory and builder 
        DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance(); 
        DocumentBuilder builder = fact.newDocumentBuilder(); 

        // Now create DOM doc to use for creating DOM elements 
        Document DOMdoc = builder.newDocument(); 

        // Create SOAP element using DOM doc 
        Element ping = DOMdoc.createElementNS("cnf:dms","PING"); 
        org.w3c.dom.Text pingdata = DOMdoc.createTextNode("are you there?");

        ping.appendChild(pingdata); 
        Selems[0] = new SOAPBodyElement(ping); 

        // Create SOAP element using XMLUtils 
        Selems[1] = new SOAPBodyElement(XMLUtils.StringToElement("cnf:dms", 
                                                    "PONG","let me know")); 


        // Call the sever 
        Vector resp = (Vector) call.invoke(Selems); 

        // Get SOAP elemements and DOM elements 

        SOAPBodyElement retSOAPel = null; 
        Element retDOMel = null; 

        for (int i = 0; i<resp.size();i++) { 
            retSOAPel = (SOAPBodyElement) resp.get(i); 
            retDOMel = retSOAPel.getAsDOM(); 
            System.out.println("Element "+i+":
"+XMLUtils.ElementToString(retDOMel)); 
        } 


    } 

    public static void main(String[] args) throws Exception { 

        if (args.length < 1) { 
            System.out.println("Bad Host"); 
            System.exit(1); 
        } 

        (new pingClient()).sendIt(args); 
    } 


} // End of class 




Mime
View raw message