- 浏览: 2542045 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
SOAP得Axis2的使用(三)Improve the performance and Fix issues
首页
http://ws.apache.org/axis2/
ISSUE:
2010-12-07 14:23:01,623 ERROR [STDERR] (http-0.0.0.0-80-62) org.apache.axis2.AxisFault: Timeout waiting for connection
2010-12-07 14:23:01,624 ERROR [STDERR] (http-0.0.0.0-80-62) at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
2010-12-07 14:23:01,624 ERROR [STDERR] (http-0.0.0.0-80-62) at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:203)
SOLUTION:
I read the document from the official website. According to the comments, we have these 2 messages:
1. We need stay the axis2 version with 1.5, because axis2 version 1.5.1/1.5.2 has this issue. (Now we are using 1.5, that is right.)
https://issues.apache.org/jira/browse/AXIS2-4752
2. We need to call the method client.cleanupTransport() at the end. (It is right in MW2.1, but wrong in MW2)
IMPROVEMENT:
I will to add these 3 parameters to the AXIS2 client option:
options.setProperty(HTTPConstants.SO_TIMEOUT, 1800000);
options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, 1800000);
options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
The REUSE_HTTP_CLIENT option is recommended from the official document to improve the performance. I do a performance test using junitperf to simulate 50 users calling the server side. And I use wireshark to capture the data.
1. If the REUSE_HTTP_CLIENT is true, we will open less connection ports and get the results with good performance.
The snapshot is in right_50.jpg.
2. If the REUSE_HTTP_CLIENT is false or none, we will open many connection ports.
The snapshot is in wrong_50.jpg.
我的测试用例修改为:
public void weatherService(){
RPCServiceClient serviceClient = null;
try{
serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference("http://192.168.1.149:8080/easyaxis/services/WeatherService");
options.setTimeOutInMilliSeconds(1800000); // 10000 seconds
options.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
options.setProperty(HTTPConstants.SO_TIMEOUT, 1800000);
options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, 1800000);
options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
// client.getOptions().setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, Boolean.TRUE);
options.setExceptionToBeThrownOnSOAPFault(true);
options.setTo(targetEPR);
// Setting the weather
QName opSetWeather = new QName("http://services.weather.axis2.sillycat.com", "setWeather");
Weather w = new Weather();
w.setTemperature((float) 39.3);
w.setForecast("Cloudy with showers");
w.setRain(true);
w.setHowMuchRain((float) 4.5);
Object[] opSetWeatherArgs = new Object[] { w };
serviceClient.invokeRobust(opSetWeather, opSetWeatherArgs);
// Getting the weather
QName opGetWeather = new QName("http://services.weather.axis2.sillycat.com", "getWeather");
Object[] opGetWeatherArgs = new Object[] {};
Class[] returnTypes = new Class[] { Weather.class };
Object[] response = serviceClient.invokeBlocking(opGetWeather, opGetWeatherArgs, returnTypes);
Weather result = (Weather) response[0];
if (result == null)
{
System.out.println("Weather didn't initialize!");
return;
}
// Displaying the result
System.out.println("Temperature : " + result.getTemperature());
System.out.println("Forecast : " + result.getForecast());
System.out.println("Rain : " + result.isRain());
System.out.println("How much rain (in inches) : " + result.getHowMuchRain());
}
catch (Exception e)
{
System.out.println("error:" + e);
}
finally
{
try
{
// clear up
serviceClient.cleanupTransport();
}
catch (Exception e)
{
System.out.println("error:" + e);
}
}
}
首页
http://ws.apache.org/axis2/
ISSUE:
2010-12-07 14:23:01,623 ERROR [STDERR] (http-0.0.0.0-80-62) org.apache.axis2.AxisFault: Timeout waiting for connection
2010-12-07 14:23:01,624 ERROR [STDERR] (http-0.0.0.0-80-62) at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
2010-12-07 14:23:01,624 ERROR [STDERR] (http-0.0.0.0-80-62) at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:203)
SOLUTION:
I read the document from the official website. According to the comments, we have these 2 messages:
1. We need stay the axis2 version with 1.5, because axis2 version 1.5.1/1.5.2 has this issue. (Now we are using 1.5, that is right.)
https://issues.apache.org/jira/browse/AXIS2-4752
2. We need to call the method client.cleanupTransport() at the end. (It is right in MW2.1, but wrong in MW2)
IMPROVEMENT:
I will to add these 3 parameters to the AXIS2 client option:
options.setProperty(HTTPConstants.SO_TIMEOUT, 1800000);
options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, 1800000);
options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
The REUSE_HTTP_CLIENT option is recommended from the official document to improve the performance. I do a performance test using junitperf to simulate 50 users calling the server side. And I use wireshark to capture the data.
1. If the REUSE_HTTP_CLIENT is true, we will open less connection ports and get the results with good performance.
The snapshot is in right_50.jpg.
2. If the REUSE_HTTP_CLIENT is false or none, we will open many connection ports.
The snapshot is in wrong_50.jpg.
我的测试用例修改为:
public void weatherService(){
RPCServiceClient serviceClient = null;
try{
serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference("http://192.168.1.149:8080/easyaxis/services/WeatherService");
options.setTimeOutInMilliSeconds(1800000); // 10000 seconds
options.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
options.setProperty(HTTPConstants.SO_TIMEOUT, 1800000);
options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, 1800000);
options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
// client.getOptions().setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, Boolean.TRUE);
options.setExceptionToBeThrownOnSOAPFault(true);
options.setTo(targetEPR);
// Setting the weather
QName opSetWeather = new QName("http://services.weather.axis2.sillycat.com", "setWeather");
Weather w = new Weather();
w.setTemperature((float) 39.3);
w.setForecast("Cloudy with showers");
w.setRain(true);
w.setHowMuchRain((float) 4.5);
Object[] opSetWeatherArgs = new Object[] { w };
serviceClient.invokeRobust(opSetWeather, opSetWeatherArgs);
// Getting the weather
QName opGetWeather = new QName("http://services.weather.axis2.sillycat.com", "getWeather");
Object[] opGetWeatherArgs = new Object[] {};
Class[] returnTypes = new Class[] { Weather.class };
Object[] response = serviceClient.invokeBlocking(opGetWeather, opGetWeatherArgs, returnTypes);
Weather result = (Weather) response[0];
if (result == null)
{
System.out.println("Weather didn't initialize!");
return;
}
// Displaying the result
System.out.println("Temperature : " + result.getTemperature());
System.out.println("Forecast : " + result.getForecast());
System.out.println("Rain : " + result.isRain());
System.out.println("How much rain (in inches) : " + result.getHowMuchRain());
}
catch (Exception e)
{
System.out.println("error:" + e);
}
finally
{
try
{
// clear up
serviceClient.cleanupTransport();
}
catch (Exception e)
{
System.out.println("error:" + e);
}
}
}
发表评论
-
Update Site will come soon
2021-06-02 04:10 1672I am still keep notes my tech n ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 422Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 428Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 364Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 444VPN Server 2020(2)Docker on Cen ... -
Nginx Deal with OPTIONS in HTTP Protocol
2020-02-15 01:33 346Nginx Deal with OPTIONS in HTTP ... -
PDF to HTML 2020(1)pdftohtml Linux tool or PDFBox
2020-01-29 07:37 399PDF to HTML 2020(1)pdftohtml Li ... -
Elasticsearch Cluster 2019(2)Kibana Issue or Upgrade
2020-01-12 03:25 710Elasticsearch Cluster 2019(2)Ki ... -
Spark Streaming 2020(1)Investigation
2020-01-08 07:19 291Spark Streaming 2020(1)Investig ... -
Hadoop Docker 2019 Version 3.2.1
2019-12-10 07:39 288Hadoop Docker 2019 Version 3.2. ... -
MongoDB 2019(3)Security and Auth
2019-11-16 06:48 236MongoDB 2019(3)Security and Aut ... -
MongoDB 2019(1)Install 4.2.1 Single and Cluster
2019-11-11 05:07 286MongoDB 2019(1) Follow this ht ... -
Monitor Tool 2019(1)Monit Installation and Usage
2019-10-17 08:22 320Monitor Tool 2019(1)Monit Insta ... -
Ansible 2019(1)Introduction and Installation on Ubuntu and CentOS
2019-10-12 06:15 305Ansible 2019(1)Introduction and ... -
Timezone and Time on All Servers and Docker Containers
2019-10-10 11:18 328Timezone and Time on All Server ... -
Kafka Cluster 2019(6) 3 Nodes Cluster on CentOS7
2019-10-05 23:28 273Kafka Cluster 2019(6) 3 Nodes C ... -
K8S Helm(1)Understand YAML and Kubectl Pod and Deployment
2019-10-01 01:21 316K8S Helm(1)Understand YAML and ... -
Rancher and k8s 2019(5)Private Registry
2019-09-27 03:25 352Rancher and k8s 2019(5)Private ... -
Jenkins 2019 Cluster(1)Version 2.194
2019-09-12 02:53 438Jenkins 2019 Cluster(1)Version ... -
Redis Cluster 2019(3)Redis Cluster on CentOS
2019-08-17 04:07 365Redis Cluster 2019(3)Redis Clus ...
相关推荐
### Axis2 SOAP技术详解 #### 一、Axis2概述 Axis2是一款开源的Web服务框架,主要用于构建基于SOAP协议的服务端应用。它支持多种传输协议(如HTTP、JMS等)以及多种数据编码方式(如XML、JSON等)。Axis2在Java...
通过以上步骤,AXIS2和IDEA的结合使得SOAP服务的开发变得高效且直观。了解如何正确配置和使用AXIS2是Java开发者在处理SOAP通信时的关键技能,这有助于提高开发效率,并确保服务的稳定性和可靠性。
本实例主要探讨了使用Axis进行SOAP Web服务发布的三种方法以及如何进行调用。 1. **命令行发布(Axis Ant Task)** Axis提供了Ant任务来发布Web服务。首先,你需要在项目中集成Ant构建工具,并将Axis的库文件添加...
总结起来,SOAP与AXIS2是Web服务领域的重要组成部分,通过AXIS2,你可以轻松地创建、部署和使用SOAP服务。本教程将帮助初学者快速上手,通过实例实践,掌握AXIS2的基本用法,为后续的Web服务开发打下坚实基础。
axis,soap,rpc最新API axis,soap,rpc最新API axis,soap,rpc最新API axis,soap,rpc最新API axis,soap,rpc最新API axis,soap,rpc最新API
标题中的"axis2-idea-plugin-1.7.9.zip_axis2_axis2-idea-plugin_idea导入axis2_"提到了几个关键元素,分别是"axis2"、"idea-plugin"和"idea导入axis2",这暗示了这个压缩包是用于在IntelliJ IDEA这款集成开发环境...
如果我们在使用 Axis2 时抛出了 org.apache.axis2.AxisFault: The input stream for an incoming message is null 异常,就说明 services.xml 中没有加入 scope="transportsession"。解决方法是将 services.xml 配置...
2. **使用Axis创建SOAP客户端**: - **理解WSDL**:Web服务描述语言(WSDL)是SOAP服务的接口定义,包含了服务的地址、操作、消息格式等信息。首先,你需要找到服务的WSDL文件。 - **生成Stub类**:利用Axis提供的...
Axis2/C supports both SOAP 1.1 and SOAP 1.2. The soap processing model is built on the AXIOM XML object model. Axis2/C is capable of handling one-way messaging (In-Only) as well as request ...
【标题】中的“基于axis2实现的webservice简单实现(客户端+服务端)”表明了本文将探讨如何使用Apache Axis2框架来创建和消费Web服务。Apache Axis2是Apache软件基金会开发的一个Web服务引擎,它提供了高效且灵活的...
标题中的“Axis2三种配置文件”指的是在使用Apache Axis2,一个流行的开源Web服务引擎时,需要理解的三种核心配置文件。这些配置文件是Axis2框架的重要组成部分,它们定义了服务的行为、部署方式以及与其他组件的...
给写好 Axis 2 的服务, 另外加上这个servlet, 以便可以用一个 url (输入json 格式的数据) 在浏览器中来调用Axis 2 的服务, 以便得到 json 格式的结果. ...
2. **依赖的第三方库**:为了支持各种功能,Axis2依赖于许多第三方库,如log4j.jar(日志)、wsdl4j.jar(WSDL处理)等。 3. **示例和服务**:可能包含一些示例服务和配置文件,帮助用户快速理解和启动服务。 4. **...
The Apache Axis2/C is a SOAP engine implementation that can be used to provide and consume Web Services. Axis2/C is an effort to implement Axis2 architecture, in C. Please have a look at ...
标题“axis2-1.6.1”指的是Apache Axis2的1.6.1版本,这是一个流行的开源Web服务引擎,用于构建和部署Web服务。Apache Axis2是Axis1的下一代,设计为更灵活、可扩展且高效。在这个版本中,它提供了一系列改进和新...
本文将详细讲解如何使用Axis2来发布Web服务以及如何生成客户端代码来调用这些服务。 首先,让我们了解发布Web服务的过程: 1. **创建WebService**:在Axis2中,可以通过编写一个简单的Java类并暴露其方法作为Web...
1. 对于`axis2-1.5.1-bin.zip`,你需要解压文件,然后在命令行中使用提供的脚本启动Axis2服务。 2. 创建Web服务,可以使用Java代码或者WSDL(Web Service Description Language)文件。 3. 将Web服务打包为AAR(Axis...
标题 "Axis2-1.6.2" 指的是...综上所述,Axis2-1.6.2提供了强大的工具和框架,使得开发和维护SOAP Web服务变得更加便捷。通过深入理解和使用Axis2,开发者可以构建健壮、高效的分布式系统,促进不同系统的互操作性。
Axis2是Apache软件基金会开发的一个开源Web服务引擎,它提供了基于SOAP(Simple Object Access Protocol)的Web服务实现。本文将详细介绍Axis2的API及其在Web服务开发中的应用,同时也会探讨Axis2的帮助文档如何协助...
AXIS2是一个流行的开源Web服务框架,用于创建和部署SOAP(简单对象访问协议)和RESTful服务。这个压缩包文件包含AXIS2运行时所需的全部jar包,它们是开发和运行基于AXIS2的Web服务不可或缺的部分。这些jar包提供了...