易截截图软件、单文件、免安装、纯绿色、仅160KB

java web service 开发 具体实例

以一个工作中编写的安全域信息同步为例进行描述;
安全域信息同步其实就是一个XML文件的传输,WEB SERVICE 本质上就是通过XML进行数据的传输.
传输的XML格式如下:
  <?xml version="1.0" encoding="UTF-8" ?>
- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <SOAP-ENV:Body>
- <simota:SynSecurityDomain xmlns:simota="http://www.chinamobile.com">
  <simota:SeqNum>1111</simota:SeqNum>
  <simota:SessionID>1111</simota:SessionID>
  <simota:SynType>01</simota:SynType>
- <simota:SecurityDomain>
  <simota:AppAID>123456789</simota:AppAID>
  <simota:InstallParams>222222</simota:InstallParams>
  <simota:MinAppSize>33</simota:MinAppSize>
  <simota:ManageMaxSize>44</simota:ManageMaxSize>
  <simota:ManageMinSize>55</simota:ManageMinSize>
  <simota:DomainType>66</simota:DomainType>
  <simota:DeleteRule>77</simota:DeleteRule>
  <simota:SIN>8</simota:SIN>
  <simota:TAR>99</simota:TAR>
  </simota:SecurityDomain>
  </simota:SynSecurityDomain>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>
 
 
根据该XML需要编写响应的解析类来接收XML文件传输过来的数据:
解析类如下:
package com.watchdata.raadtinterface.common.syn;
 
import org.jdom.Element;
import org.jdom.Namespace;
import org.apache.commons.logging.*;
import com.watchdata.raadtinterface.common.*;
 
public class SynSecurityDomainRequest
    implements BaseMsg {
  public SynSecurityDomainRequest() {
  }
 
  private String seqNum;
  private String sessionID;
  private String synType;
  private SecurityDomainBean securityDomain;
 
  /**
   *


相关文档:

java中的URLEncoder和URLDecoder类

[转]http://www.java3z.com/cwbwebhome/article/article2/2414.html?id=1101
/*
     网页中的表单使用POST方法提交时,数据内容的类型是 application/x-www-form-urlencoded,这种类型会:
1.字符"a"-"z","A"-"Z","0"-"9",".","-","*",和"_" 都不会被编码;
2.将空格转换为加号 (+) ;
3.� ......

java随机排列数组

有时我们需要随机的排列数组中的元素,随机排列数组,目前常用的有两种方法,第一种就是元素A[i]对应一个优先级P[i],根据优先级作为键值来从新排序数组;第二种方法就是A[i]随机的跟A[i]到A[n]中的任意个元素进行交换,n为数组的长度,下面是用java实现一个简单实现.
import java.util.Date;
import java.util.Random;
/*
......

java面试题汇集

JAVA相关基础知识
1、面向对象的特征有哪些方面   
1.抽象:
抽象就是忽略一个主题中与当前目标无关的那些方面,以便更充分地注意与当前目标有关的方面。抽象并不打算了解全部问题,而只是选择其中的一部分,暂时不用部分细节。抽象包括两个方面,一是过程抽象,二是数据抽象。
2.继承:
继承是一种联� ......

Java进制转换

关键字: java 进制转换
十进制转成十六进制:
Integer.toHexString(int i)
十进制转成八进制
Integer.toOctalString(int i)
十进制转成二进制
Integer.toBinaryString(int i)
十六进制转成十进制
Integer.valueOf("FFFF",16).toString()
八进制转成十进制
Integer.valueOf("876",8).toString()
二进� ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号