- 浏览: 2551941 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
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 with HTTPS
1. sample configuration on tomcat7.0
server.xml
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="d:\tool\apache-tomcat-7.0.16\tomcat.jks"
keystorePass="xxxxxx"/>
2. configuration in axis2.xml
<transportSender name="https"
class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
<parameter name="PROTOCOL">HTTP/1.1</parameter>
<parameter name="Transfer-Encoding">chunked</parameter>
<parameter name="port">443</parameter>
</transportSender>
That is all for the server side.
3. Client side
We can call the https SOAP server with our client like this:
@Test
public void weatherService()
{
RPCServiceClient serviceClient = null;
try
{
//http://www.httpdebugger.com/download.html
String HTTPS_URL = "https://server/easyaxis/services/WeatherService";
String HTTP_URL = "http://server:8080/easyaxis/services/WeatherService";
serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference(HTTP_URL);
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);
//SSL
System.setProperty("javax.net.ssl.trustStore","d:\\tool\\apache-tomcat-7.0.16\\tomcat.jks");
System.setProperty("javax.net.ssl.trustStorePassword","D1gby!");
// 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[] {};
@SuppressWarnings("rawtypes")
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);
}
}
}
4. Moniters
First of all, we can use the HttpAnalyzer to watch the data, but it only work for the HTTP, not HTTPS.
Then I tried the SOAP monitor. That works.
references:
http://shivendra-tripathi.blogspot.com/2010/11/enabling-ssl-for-axis2-service-and.html
http://axis.apache.org/axis2/java/core/docs/http-transport.html#httpsupport
http://www.opensubscriber.com/message/axis-dev@ws.apache.org/8077606.html
http://techtidbitsbyshiv.blogspot.com/2010/11/axis2java-client-code-for-basic.html
1. sample configuration on tomcat7.0
server.xml
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="d:\tool\apache-tomcat-7.0.16\tomcat.jks"
keystorePass="xxxxxx"/>
2. configuration in axis2.xml
<transportSender name="https"
class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
<parameter name="PROTOCOL">HTTP/1.1</parameter>
<parameter name="Transfer-Encoding">chunked</parameter>
<parameter name="port">443</parameter>
</transportSender>
That is all for the server side.
3. Client side
We can call the https SOAP server with our client like this:
@Test
public void weatherService()
{
RPCServiceClient serviceClient = null;
try
{
//http://www.httpdebugger.com/download.html
String HTTPS_URL = "https://server/easyaxis/services/WeatherService";
String HTTP_URL = "http://server:8080/easyaxis/services/WeatherService";
serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference(HTTP_URL);
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);
//SSL
System.setProperty("javax.net.ssl.trustStore","d:\\tool\\apache-tomcat-7.0.16\\tomcat.jks");
System.setProperty("javax.net.ssl.trustStorePassword","D1gby!");
// 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[] {};
@SuppressWarnings("rawtypes")
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);
}
}
}
4. Moniters
First of all, we can use the HttpAnalyzer to watch the data, but it only work for the HTTP, not HTTPS.
Then I tried the SOAP monitor. That works.
references:
http://shivendra-tripathi.blogspot.com/2010/11/enabling-ssl-for-axis2-service-and.html
http://axis.apache.org/axis2/java/core/docs/http-transport.html#httpsupport
http://www.opensubscriber.com/message/axis-dev@ws.apache.org/8077606.html
http://techtidbitsbyshiv.blogspot.com/2010/11/axis2java-client-code-for-basic.html
发表评论
-
xfire后续问题补充
2010-01-06 14:34 2631xfire后续问题补充 问题一:xfire的方法中,需要知道 ... -
AXIS实现WebService
2010-01-06 11:51 3958AXIS实现WebService webservice里面对 ... -
xfire的webservice安全机制之签名
2010-01-05 23:31 1380xfire的webservice安全机制之签名 服务端配置修 ... -
xfire的webservice安全机制之签名
2010-01-05 23:29 1613xfire的webservice安全机制之签名 服务端配置修 ... -
xfire的webservice安全机制之用户校验
2010-01-05 23:29 2111xfire的webservice安全机制之用户校验 xfir ... -
xfire的webservice安全机制之加密(三)
2010-01-05 23:29 1272如何用KEYTOOL工具生成私匙和公匙 1、通过别名和密码创 ... -
xfire的webservice安全机制之加密(二)
2010-01-05 23:28 2816xfire的webservice安全机制 下面是客户端调用的 ... -
xfire的webservice安全机制之加密(一)
2010-01-05 23:28 2892xfire的webservice安全机制 在原来使用xfir ... -
spring下的webservice之xfire
2010-01-05 23:25 2038http://xfire.codehaus.org/ xfi ... -
Xfire在Weblogic10.3上发布的问题
2010-01-05 10:37 6325Xfire在Weblogic10.3上发布的问题 最近项目的 ... -
mule2.2.x架构(八)部署到WEB项目
2010-01-05 10:36 1967mule2.2.x架构(八)部署到WEB项目 所有的示例文档 ... -
xfire的Client的WSDL调用
2010-01-05 10:36 3157xfire的Client的WSDL调用 也只是想测试一下,如 ... -
mule2.2.x架构(七)示例学习LoanBroker
2010-01-05 10:36 1709mule2.2.x架构(七)示例学习LoanBroker 所 ... -
xfire的client的JAVA调用方式
2010-01-05 10:35 3553xfire的client的JAVA调用方式 平时我们调用xf ... -
mule2.2.x架构(六)示例学习scripting
2010-01-05 10:35 1474mule2.2.x架构(六)示例学习scripting 所有 ... -
mule2.2.x架构(五)示例学习errorHandle
2010-01-05 10:34 1679mule2.2.x架构(五)示例学习errorHandle ... -
mule2.2.x架构(四)示例学习StockQuote
2010-01-05 10:34 1872mule2.2.x架构(四)示例学习StockQuote 所 ... -
mule2.2.x架构(三)示例学习hello
2010-01-05 10:34 1875mule2.2.x架构(三)示例学习hello 所有的示例文 ... -
mule2.2.x架构(二)示例学习echo
2010-01-05 10:33 1775mule2.2.x架构(二)示例学习echo 所有的示例文档 ... -
mule2.2.x架构(一)环境搭建
2010-01-05 10:31 2279mule2.2.x架构(一)环境搭建 MULE首页 http ...
相关推荐
- 多协议支持:除了基本的SOAP 1.1和1.2,Axis2还支持REST、MTOM(Message Transmission Optimization Mechanism)和SwA(Soap with Attachments)等传输方式。 - 高效的消息处理:使用了基于内存的数据结构,Axis2...
它还支持MTOM(Message Transmission Optimization Mechanism)和SwA(Soap with Attachments),有效优化了带有二进制数据的Web服务传输。 在开发过程中, Axis1.x和Axis2.x的使用方式也有所不同。Axis1.x通常通过...
### 使用Apache Axis2开发Web服务的关键知识点 #### 一、Apache Axis2简介 Apache Axis2是用于构建和服务Web服务的强大框架。它支持多种标准,包括SOAP、WSDL、MTOM等,并提供了丰富的功能来实现安全性和高效的...
4. **高级功能**:包括MTOM(Message Transmission Optimization Mechanism)和SWA(Soap with Attachments)支持,用于高效传输二进制数据。 5. **部署灵活性**:Axis2支持多种部署方式,如WAR文件、AXIS2.xml配置...
Apache Axis2是一个高度可扩展且功能强大的Web服务引擎,它基于Java构建,用于开发、部署和管理SOAP和RESTful Web服务。 1. **Apache Axis2**:Apache Axis2是Apache软件基金会的Web服务项目,它是第二代Axis的升级...
Axis2是Apache软件基金会开发的一款基于Java的Web服务框架,它是Apache SOAP(Simple Object Access Protocol)项目的下一代产品,专门用于构建高性能、可扩展的Web服务。这个“axis2学习资料”压缩包很可能是包含了...
- **多协议支持**:除了SOAP,Axis2还支持REST、MTOM(Message Transmission Optimization Mechanism)和SwA(SOAP with Attachments)等通信协议。 - **部署方式**:Axis2的WAR文件同样可以在Servlet容器中部署,...
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 ...
2. **模块化架构**:Axis2采用了模块化设计,使得用户可以根据需要选择和配置不同的模块,如MTOM(Message Transmission Optimization Mechanism)、SwA(SOAP with Attachments)和REST支持。 3. **性能优化**:...
Axis2是Apache软件基金会开发的一个Web服务框架,用于构建高性能、高效率的SOAP(Simple Object Access Protocol)服务器和客户端。这个“最新axis2实例.rar”压缩包提供了最新的Axis2实例,便于开发者学习和实践...
5. **MTOM与SwA优化**: MTOM(Message Transmission Optimization Mechanism)和SwA(SOAP with Attachments)是Axis2中用于优化大文件传输的技术。它们能将大文件内容作为链接传递,而不是嵌入到SOAP消息中,从而...
在这个名为"AXIS2快速学习资料"的压缩包中,包含两份宝贵的资源:一份是中文的Word文档,标题为"Axis2--Java访问Axis2接口.doc",另一份是英文的PDF,标题为"Axis2--Dev_Web_Services_With_Apache_Axis2.pdf"。...
./configure --prefix=/zhaojian/axis2c/ --with-axis2=${AXIS2C_HOME}/include/axis2-1.6.0 make make install ``` #### 三、生成C语言客户端代码 生成客户端代码之前,首先需要一个WSDL文件,该文件定义了...
2. 可扩展性:AXIS2支持多种协议和数据格式,包括SOAP、REST、MTOM(Message Transmission Optimization Mechanism)、SwA(Soap with Attachments)等。 3. 易于使用:AXIS2提供了一套直观的API,使得开发和部署Web...
Java和Axis2是开发Web服务客户端的重要工具,用于调用基于SOAP协议的Web服务。本文将深入探讨如何利用Java和Axis2库来实现这一功能,同时结合提供的代码示例进行详细解析。 首先,Web服务是一种通过网络进行通信的...
此外,Axis2支持MTOM(Message Transmission Optimization Mechanism)和SwA(Soap with Attachments),提高处理大型附件的效率。 8. **互操作性**:由于对Web服务标准的全面支持,Axis2与其他Web服务框架(如.NET...
相比于Axis1,Axis2引入了模块化架构,支持更多的协议和数据格式,如RESTful Web服务、MTOM(Message Transmission Optimization Mechanism)和SwA(Soap with Attachments)。 在实际开发中,使用这些文件可能涉及...
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 ...
Axis1和Axis2是两个非常重要的Java Web服务框架,它们主要用于构建和部署SOAP(Simple Object Access Protocol)服务。本文将详细介绍这两个框架以及与之相关的知识点。 **Axis1** 是Apache软件基金会开发的一个...
4. **模块化架构**:Axis2的核心是一个模块化的架构,允许用户根据需求选择安装和配置不同的模块,如MTOM(Message Transmission Optimization Mechanism)、SwA(Soap with Attachments)等,以优化性能或处理不同...