Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SOAPConnection.call() method consumes more CPU  RSS feed

 
Ravi Sengodan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SoapConnection.call() method consumes more cpu, can anybody help me to optimize the code and reduce the CPU usage for this blocking call?

Please refer the following code

private static SOAPConnectionFactory soapFactory = null;
soapFactory = SOAPConnectionFactory.newInstance();
SOAPMessage responseMessage = null;
SOAPConnection con = soapFactory.createConnection();
responseMessage = con.call(message, endpoint);

Thanks in advance,
Ravi
 
ankur Gautam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi am having a similar issue in web application

where i am making soap call to Sap for retriving data .......
soap call takes lots of CPU memory ...hw can i optimize the process
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
The first approach I would consider is to use generated artifacts, instead of using SAAJ to call the web service.
If this is not possible, then I would investigate exactly where the program consumes most CPU. I fear that it will be somewhere in the SAAJ implementation, which I assume that you do not want to hack.
Another approach would be to replace the SAAJ client with a general HTTP client, such as the Jetty or Apache HTTPClient. The Jetty client supports issuing of asynchronous requests with a callback mechanism for notifying the caller about received responses etc. This approach will probably require some coding effort.
Best wishes!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!