- 浏览: 2487410 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
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 2590xfire后续问题补充 问题一:xfire的方法中,需要知道 ... -
AXIS实现WebService
2010-01-06 11:51 3927AXIS实现WebService webservice里面对 ... -
xfire的webservice安全机制之签名
2010-01-05 23:31 1348xfire的webservice安全机制之签名 服务端配置修 ... -
xfire的webservice安全机制之签名
2010-01-05 23:29 1581xfire的webservice安全机制之签名 服务端配置修 ... -
xfire的webservice安全机制之用户校验
2010-01-05 23:29 2074xfire的webservice安全机制之用户校验 xfir ... -
xfire的webservice安全机制之加密(三)
2010-01-05 23:29 1227如何用KEYTOOL工具生成私匙和公匙 1、通过别名和密码创 ... -
xfire的webservice安全机制之加密(二)
2010-01-05 23:28 2788xfire的webservice安全机制 下面是客户端调用的 ... -
xfire的webservice安全机制之加密(一)
2010-01-05 23:28 2845xfire的webservice安全机制 在原来使用xfir ... -
spring下的webservice之xfire
2010-01-05 23:25 2001http://xfire.codehaus.org/ xfi ... -
Xfire在Weblogic10.3上发布的问题
2010-01-05 10:37 6275Xfire在Weblogic10.3上发布的问题 最近项目的 ... -
mule2.2.x架构(八)部署到WEB项目
2010-01-05 10:36 1929mule2.2.x架构(八)部署到WEB项目 所有的示例文档 ... -
xfire的Client的WSDL调用
2010-01-05 10:36 3106xfire的Client的WSDL调用 也只是想测试一下,如 ... -
mule2.2.x架构(七)示例学习LoanBroker
2010-01-05 10:36 1668mule2.2.x架构(七)示例学习LoanBroker 所 ... -
xfire的client的JAVA调用方式
2010-01-05 10:35 3495xfire的client的JAVA调用方式 平时我们调用xf ... -
mule2.2.x架构(六)示例学习scripting
2010-01-05 10:35 1439mule2.2.x架构(六)示例学习scripting 所有 ... -
mule2.2.x架构(五)示例学习errorHandle
2010-01-05 10:34 1629mule2.2.x架构(五)示例学习errorHandle ... -
mule2.2.x架构(四)示例学习StockQuote
2010-01-05 10:34 1842mule2.2.x架构(四)示例学习StockQuote 所 ... -
mule2.2.x架构(三)示例学习hello
2010-01-05 10:34 1832mule2.2.x架构(三)示例学习hello 所有的示例文 ... -
mule2.2.x架构(二)示例学习echo
2010-01-05 10:33 1736mule2.2.x架构(二)示例学习echo 所有的示例文档 ... -
mule2.2.x架构(一)环境搭建
2010-01-05 10:31 2250mule2.2.x架构(一)环境搭建 MULE首页 http ...
相关推荐
axis2 soap技术 wsdl技术 java 的技术
比较简单的SOAP Axis三种发布、调用方式简单的实例,代码和文档都在,不包含AXIS包,需要自行下载。
AXIS2结合IDEA快速生成JAVA类,如果需要将SOAP报文装成JAVA对象,下载,IDEA中配置
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/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 ...
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-idea-plugin-1.7.9
axis2-1.6.1-bin.zip Axis2是下一代 Apache Axis。Axis2 虽然由 Axis 1.x 处理程序模型提供支持,但它具有更强的灵活性并可扩展到新的体系结构。...Apache Axis2 是Axis的后续版本,是新一代的SOAP引擎。
Axis2的OMElement SOAP XML报文节点首字母小写转大写(注意,是节点,不是节点元素的值) java
Web Service是现在最适合实现SOAP的技术,而Axis2是实现Web Service的一种技术框架(架构)
axis2例子 webservice axis2 示例axis2例子 webservice axis2 示例axis2例子 webservice axis2 示例axis2例子 webservice axis2 示例axis2例子 webservice axis2 示例
SOAP调用Axis服务的Client SOAP调用Axis服务的Client SOAP调用Axis服务的Client
SOAP与AXIS2入门教程附带实例,通过实例带您入门
axis2 webservice 服务端jar包: -->axis2-kernel-1.6.1.jar -->axis2-spring-1.6.1.jar -->axis2-transport-http-1.6.1.jar -->XmlSchema-1.4.7.jar -->wsdl4j-1.6.2.jar -->axiom-api-1.2.12.jar -->axiom...
axis2-1.6.2.zip, windows axis2工具,根据 WSDL生成java文件。 1、axis2客户端下载地址:http://mirror.esocc.com/apache//axis/axis2/java/core/1.6.2/axis2-1.6.2-bin.zip; 2、下载解压在D:\Work_Program_...
给写好 Axis 2 的服务, 另外加上这个servlet, 以便可以用一个 url (输入json 格式的数据) 在浏览器中来调用Axis 2 的服务, 以便得到 json 格式的结果. ...
整理的关于soap axis tomcat搭建的webservice,希望对大家有帮助!
axis2-adb-1.5.4.jar axis2-adb-codegen-1.5.4.jar axis2-codegen-1.5.4.jar axis2-corba-1.5.4.jar axis2-fastinfoset-1.5.4.jar axis2-java2wsdl-1.5.4.jar axis2-jaxbri-1.5.4.jar axis2-jaxws-1.5.4.jar axis2-...
一种基于Axis2的SOAP安全传输模型的研究
axis2-1.7.8.zip客户端。2、下载解压在D:\Work_Program_Files目录;在D:\Work_Program_Files\axis2-1.6.2\bin目录有一个wsdl2java.bat文件; 3、设置环境变量,加入AXIS2_HOME=Axis2客户端安装目录,path中追加;%...