import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"username",
"name",
"sex",
"certificateType",
"certificateNo",
"email",
"mobilephone",
"telephone",
"fax",
"contactAddress",
"postcode",
"aicRegisterName",
"eCommerceWebsite",
"busiLicenseCode",
"organizationCode",
"taxpayerRegisterNo",
"registeredCapital",
"busiAddress",
"busiAddressCode",
"registrationTaxCode",
"legalPerName",
"bankAccountName"
})
@XmlRootElement(name = "MerchantRegisterRequestData")
public class MerchantRegisterRequestDO {
protected String username;
protected String name;
protected String sex;
protected String certificateType;
protected String certificateNo;
protected String email;
protected String mobilephone;。。。。
}
转换成xml:
StringWriter sw = new StringWriter();
JAXBContext context = null;
try {
context = JAXBContext.newInstance(MerchantRegisterRequestDO.class,
MerchantRegisterResponseDO.class);
context.createMarshaller().marshal(mrr, sw);
} catch (Exception e) {
}
XML转换成JavaBean
JAXBContext context = null;
try {
context = JAXBContext.newInstance(MerchantRegisterRequestDO.class,
MerchantRegisterResponseDO.class);
context.createMarshaller().marshal(mrr, sw);
} catch (Exception e) {
}
MerchantRegisterResponseDO mro = null;
try {
XmlUtil.getPrettyXml(sw.toString()));
// 调用认证中心接口
String result = yiji.merchantRegister(DESPlusWrapper.encrypt(sw
.toString()));
mro = (MerchantRegisterResponseDO) context.createUnmarshaller()
.unmarshal(new StringReader(result));
logger.debug("调用认证中心接口【用户注册】成功,返回结果:\nMerchantId:"
+ mro.getMerchantId() + ";StatusCode:"
+ mro.getStatusCode() + ";StatusDescription:"
+ mro.getStatusDescription());
} catch (Exception e) {
}
分享到:
相关推荐
**XMLBean**是一款类似于Hibernate这样的对象关系映射(Object Relational Mapping,ORM)工具的产品,它将复杂的XML读写操作简化为对JavaBean的操作,从而极大地简化了XML的读写过程,使得即使是不熟悉XML的开发者...
1. **xbean-2.2.0.jar**:Apache XBean是一个强大的JavaBean和XML绑定框架,它用于配置Xfire服务,提供XML解析和绑定功能。 2. **spring-1.2.6.jar**:Spring框架是Java应用开发的基础,Xfire与Spring的集成使得...
2.1.3 生成发票 2.2 引用完整性 2.2.1 通用完整性规则 2.2.2 特定于数据库的完整性规则 2.3 小结 第3章 SQL基础 3.1 SQL语言 3.2 SQL数据类型 3.3 数据定义语言 3.3.1 创建、取消、更改数据库和表 ...
2.1.3 生成发票 2.2 引用完整性 2.2.1 通用完整性规则 2.2.2 特定于数据库的完整性规则 2.3 小结 第3章 SQL基础 3.1 SQL语言 3.2 SQL数据类型 3.3 数据定义语言 3.3.1 创建、取消、更改数据库和表 ...
2.1.3 生成发票 2.2 引用完整性 2.2.1 通用完整性规则 2.2.2 特定于数据库的完整性规则 2.3 小结 第3章 SQL基础 3.1 SQL语言 3.2 SQL数据类型 3.3 数据定义语言 3.3.1 创建、取消、更改数据库和表 ...
2.1.3 生成发票 2.2 引用完整性 2.2.1 通用完整性规则 2.2.2 特定于数据库的完整性规则 2.3 小结 第3章 SQL基础 3.1 SQL语言 3.2 SQL数据类型 3.3 数据定义语言 3.3.1 创建、取消、更改数据库和表 ...
6. `mina-integration-xbean-2.0.7.jar`:这个模块用于整合Apache XBean,XBean是一个XML配置库,可将XML配置文件直接转换为Java对象,方便在MINA中配置服务和处理器。 7. `mina-transport-apr-2.0.7.jar`:Apache ...