- 浏览: 1529150 次
- 性别:
- 来自: 厦门
文章分类
- 全部博客 (516)
- Java (49)
- Java/Struts 2.0 (25)
- Java/Spring、Spring MVC (11)
- Java/Quartz (3)
- Java/Lucene (6)
- Java/Hibernate (19)
- Java/openJPA (7)
- Java/DWR (7)
- Java/Security、Spring Security/OAuth2 (6)
- Java/Threading (9)
- Java/XML (22)
- java/design pattern (4)
- Android (2)
- JavaScript (46)
- jquery (3)
- DB/MySQL (23)
- DB/Oracle (16)
- PHP (25)
- CSS (20)
- Linux (38)
- C/C++、DLL、Makefile、VC++ (31)
- 正则 (9)
- Eclipse (4)
- 安全、网络等概念 (25)
- 集群 (7)
- 网页 (5)
- 视频\音频 (1)
- HTML (6)
- 计算机数学/算法 (3)
- Virtualbox (1)
- LDAP (2)
- 数据挖掘 (6)
- 工具破解 (1)
- 其他 (13)
- Mail (1)
- 药材 (3)
- 游戏 (2)
- hadoop (13)
- 压力测试 (3)
- 设计模式 (3)
- java/Swing (2)
- 缓存/Memcache (0)
- 缓存/Redis (1)
- OSGI (2)
- OSGI/Gemini (0)
- 文档写作 (0)
- java/Servlet (3)
- MQ/RabbitMQ (2)
- MQ/RocketMQ (0)
- MQ/Kafka (1)
- maven (0)
- SYS/linux (1)
- cache/redis (1)
- DB/Mongodb (2)
- nginx (1)
- postman (1)
- 操作系统/ubuntu (1)
- golang (1)
- dubbo (1)
- 技术管理岗位 (0)
- mybatis-plus (0)
最新评论
-
pgx89112:
大神,请赐我一份这个示例的项目代码吧,万分感谢,1530259 ...
spring的rabbitmq配置 -
string2020:
不使用增强器 怎么弄?
OpenJPA的增强器 -
孟江波:
学习了,楼主,能否提供一份源代码啊,学习一下,十分感谢!!!4 ...
spring的rabbitmq配置 -
eachgray:
...
spring-data-redis配置事务 -
qljoeli:
学习了,楼主,能否提供一份源代码啊,学习一下,十分感谢!!!1 ...
spring的rabbitmq配置
这些天在对一个项目扩展功能时使用Axis 1.4 将WSDL文件逆向工程后产生的字符串数组却只变成字符串 。这个估计是Axis 1.4的bug。
以下贴出将要将要逆向工程的WSDL部份内容:
<?xml version="1.0" encoding="UTF-8"?> <definitions targetNamespace="service.sync.data.hisun.com" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="service.sync.data.hisun.com" xmlns:intf="service.sync.data.hisun.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://request.sync.data.hisun.com" xmlns:tns2="http://bean.sync.data.hisun.com" xmlns:tns3="http://response.sync.data.hisun.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!--WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)--> <wsdl:types> <schema targetNamespace="http://bean.sync.data.hisun.com" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://response.sync.data.hisun.com"/> <import namespace="http://request.sync.data.hisun.com"/> <import namespace="service.sync.data.hisun.com"/> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="Author"> <sequence> <element name="authorId" nillable="true" type="xsd:string"/> <element name="authorName" nillable="true" type="xsd:string"/> </sequence> </complexType> <complexType name="ContentProvision"> <sequence> <element name="downLoadUrl" nillable="true" type="xsd:string"/> <element name="onLineUrl" nillable="true" type="xsd:string"/> <element name="pkgSize" nillable="true" type="xsd:string"/> <element name="provisionId" nillable="true" type="xsd:string"/> <element name="terminalGroupId" nillable="true" type="xsd:string"/> </sequence> </complexType> <complexType name="Content"> <sequence> <element name="contentId" nillable="true" type="xsd:string"/> <element name="contentIndex" nillable="true" type="xsd:string"/> <element name="contentName" nillable="true" type="xsd:string"/> <element name="contentProvision" nillable="true" type="impl:ArrayOf_tns2_ContentProvision"/> </sequence> </complexType> <complexType name="Opus"> <sequence> <element name="area" nillable="true" type="xsd:string"/> <element name="author" nillable="true" type="tns2:Author"/> <element name="content" nillable="true" type="impl:ArrayOf_tns2_Content"/> <element name="contentType" nillable="true" type="xsd:string"/> <element name="dataSource" nillable="true" type="xsd:string"/> <element name="initChar" nillable="true" type="xsd:string"/> <element name="opusDesc" nillable="true" type="xsd:string"/> <element name="opusId" nillable="true" type="xsd:string"/> <element name="opusLargeUrl" nillable="true" type="xsd:string"/> <element name="opusName" nillable="true" type="xsd:string"/> <element name="opusUrl" nillable="true" type="xsd:string"/> <element name="status" nillable="true" type="xsd:string"/> <element name="supportedTerminalGroupIds" nillable="true" type="impl:ArrayOf_soapenc_string"/> <element name="theme_id" nillable="true" type="xsd:string"/> <element name="times" nillable="true" type="xsd:string"/> </sequence> </complexType> </schema> <schema targetNamespace="service.sync.data.hisun.com" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://response.sync.data.hisun.com"/> <import namespace="http://request.sync.data.hisun.com"/> <import namespace="http://bean.sync.data.hisun.com"/> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="ArrayOf_tns2_ContentProvision"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="tns2:ContentProvision[]"/> </restriction> </complexContent> </complexType> <complexType name="ArrayOf_tns2_Content"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="tns2:Content[]"/> </restriction> </complexContent> </complexType> <complexType name="ArrayOf_soapenc_string"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/> </restriction> </complexContent> </complexType> </schema> <schema targetNamespace="http://request.sync.data.hisun.com" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://response.sync.data.hisun.com"/> <import namespace="http://bean.sync.data.hisun.com"/> <import namespace="service.sync.data.hisun.com"/> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="SyncRequest"> <sequence> <element name="opus" nillable="true" type="tns2:Opus"/> </sequence> </complexType> <complexType name="NotifyOpusUnderLineRequest"> <sequence> <element name="contentId" nillable="true" type="xsd:string"/> <element name="operationType" nillable="true" type="xsd:string"/> <element name="opusId" nillable="true" type="xsd:string"/> </sequence> </complexType> <complexType name="UpdateContentAndProvisionRequest"> <sequence> <element name="content" nillable="true" type="tns2:Content"/> <element name="operationType" nillable="true" type="xsd:string"/> <element name="opusId" nillable="true" type="xsd:string"/> </sequence> </complexType> <complexType name="UpdateOpusBasicInfoRequest"> <sequence> <element name="opus" nillable="true" type="tns2:Opus"/> </sequence> </complexType> </schema> <schema targetNamespace="http://response.sync.data.hisun.com" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://request.sync.data.hisun.com"/> <import namespace="http://bean.sync.data.hisun.com"/> <import namespace="service.sync.data.hisun.com"/> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="SyncResponse"> <sequence> <element name="code" nillable="true" type="xsd:string"/> <element name="msg" nillable="true" type="xsd:string"/> </sequence> </complexType> </schema> </wsdl:types> <message name="SyncDataResponse"> <part name="SyncDataReturn" type="tns3:SyncResponse"/> </message> <message name="SyncDataRequest"> <part name="request" type="tns1:SyncRequest"/> </message> <portType name="DataSync"> <operation name="SyncData" parameterOrder="request"> <input message="impl:SyncDataRequest" name="SyncDataRequest"/> <output message="impl:SyncDataResponse" name="SyncDataResponse"/> </operation> </portType> <binding name="DataSyncServiceSoapBinding" type="impl:DataSync"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="SyncData"> <wsdlsoap:operation soapAction=""/> <input name="SyncDataRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://service.sync.data.hisun.com" use="encoded"/> </input> <output name="SyncDataResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="service.sync.data.hisun.com" use="encoded"/> </output> </operation> </binding> <service name="DataSyncService"> <port binding="impl:DataSyncServiceSoapBinding" name="DataSyncService"> <wsdlsoap:address location="xxx/DataSyncService"/> </port> </service> </definitions>
其中Opus中的“supportedTerminalGroupIds”属性是字符串数组类型:
<complexType name="Opus"> <sequence> <element name="area" nillable="true" type="xsd:string"/> <element name="author" nillable="true" type="tns2:Author"/> <element name="content" nillable="true" type="impl:ArrayOf_tns2_Content"/> <element name="contentType" nillable="true" type="xsd:string"/> <element name="dataSource" nillable="true" type="xsd:string"/> <element name="initChar" nillable="true" type="xsd:string"/> <element name="opusDesc" nillable="true" type="xsd:string"/> <element name="opusId" nillable="true" type="xsd:string"/> <element name="opusLargeUrl" nillable="true" type="xsd:string"/> <element name="opusName" nillable="true" type="xsd:string"/> <element name="opusUrl" nillable="true" type="xsd:string"/> <element name="status" nillable="true" type="xsd:string"/> <element name="supportedTerminalGroupIds" nillable="true" type="impl:ArrayOf_soapenc_string"/> <element name="theme_id" nillable="true" type="xsd:string"/> <element name="times" nillable="true" type="xsd:string"/> </sequence> </complexType>
类型为:
<complexType name="ArrayOf_soapenc_string"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/> </restriction> </complexContent> </complexType>
使用以下命令把WSDL逆向工程生成java代码:
java -classpath %CLASSPATH% org.apache.axis.wsdl.WSDL2Java --server-side -o D:\ddd file:/d:\DataSyncService.WSDL
然后将生成的代码复制到项目里头,启动TOMCAT ,并利用逆向工程的deploy.wsdd使用以下命令进行布署生成server-config.wsdd
java -classpath %CLASSPATH% org.apache.axis.client.AdminClient -l http://localhost:8080/axis/services/DataSyncService D:/workspace-java/axis1/web/WEB-INF/deploy.wsdd
最后重启TOMCAT.
在这些步骤当中我当时觉得没什么错误的地方。后来在PHP要将字符串数组传递过时一直都是字符串时才发现以下问题:
<element name="supportedTerminalGroupIds" nillable="true" type="impl:ArrayOf_soapenc_string"/>
变为了:
<element name="supportedTerminalGroupIds" nillable="true" type="xsd:string"/>
解决办法:将逆向工程中所生成的bean的一些与Axis的类型元数据的代码给删除掉就OK了。
如:
/** * Opus.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.hisun.data.sync.bean; public class Opus implements java.io.Serializable { private java.lang.String area; private com.hisun.data.sync.bean.Author author; private com.hisun.data.sync.bean.Content[] content; private java.lang.String contentType; private java.lang.String dataSource; private java.lang.String initChar; private java.lang.String opusDesc; private java.lang.String opusId; private java.lang.String opusLargeUrl; private java.lang.String opusName; private java.lang.String opusUrl; private java.lang.String status; private java.lang.String[] supportedTerminalGroupIds; private java.lang.String theme_id; private java.lang.String times; public Opus() { } public Opus(java.lang.String area, com.hisun.data.sync.bean.Author author, com.hisun.data.sync.bean.Content[] content, java.lang.String contentType, java.lang.String dataSource, java.lang.String initChar, java.lang.String opusDesc, java.lang.String opusId, java.lang.String opusLargeUrl, java.lang.String opusName, java.lang.String opusUrl, java.lang.String status, java.lang.String[] supportedTerminalGroupIds, java.lang.String theme_id, java.lang.String times) { this.area = area; this.author = author; this.content = content; this.contentType = contentType; this.dataSource = dataSource; this.initChar = initChar; this.opusDesc = opusDesc; this.opusId = opusId; this.opusLargeUrl = opusLargeUrl; this.opusName = opusName; this.opusUrl = opusUrl; this.status = status; this.supportedTerminalGroupIds = supportedTerminalGroupIds; this.theme_id = theme_id; this.times = times; } public java.lang.String getArea() { return area; } public void setArea(java.lang.String area) { this.area = area; } public com.hisun.data.sync.bean.Author getAuthor() { return author; } public void setAuthor(com.hisun.data.sync.bean.Author author) { this.author = author; } public com.hisun.data.sync.bean.Content[] getContent() { return content; } public void setContent(com.hisun.data.sync.bean.Content[] content) { this.content = content; } public java.lang.String getContentType() { return contentType; } public void setContentType(java.lang.String contentType) { this.contentType = contentType; } public java.lang.String getDataSource() { return dataSource; } public void setDataSource(java.lang.String dataSource) { this.dataSource = dataSource; } public java.lang.String getInitChar() { return initChar; } public void setInitChar(java.lang.String initChar) { this.initChar = initChar; } public java.lang.String getOpusDesc() { return opusDesc; } public void setOpusDesc(java.lang.String opusDesc) { this.opusDesc = opusDesc; } public java.lang.String getOpusId() { return opusId; } public void setOpusId(java.lang.String opusId) { this.opusId = opusId; } public java.lang.String getOpusLargeUrl() { return opusLargeUrl; } public void setOpusLargeUrl(java.lang.String opusLargeUrl) { this.opusLargeUrl = opusLargeUrl; } public java.lang.String getOpusName() { return opusName; } public void setOpusName(java.lang.String opusName) { this.opusName = opusName; } public java.lang.String getOpusUrl() { return opusUrl; } public void setOpusUrl(java.lang.String opusUrl) { this.opusUrl = opusUrl; } public java.lang.String getStatus() { return status; } public void setStatus(java.lang.String status) { this.status = status; } public java.lang.String[] getSupportedTerminalGroupIds() { return supportedTerminalGroupIds; } public void setSupportedTerminalGroupIds(java.lang.String[] supportedTerminalGroupIds) { this.supportedTerminalGroupIds = supportedTerminalGroupIds; } public java.lang.String getTheme_id() { return theme_id; } public void setTheme_id(java.lang.String theme_id) { this.theme_id = theme_id; } public java.lang.String getTimes() { return times; } public void setTimes(java.lang.String times) { this.times = times; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof Opus)) return false; Opus other = (Opus) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.area == null && other.getArea() == null) || (this.area != null && this.area.equals(other.getArea()))) && ((this.author == null && other.getAuthor() == null) || (this.author != null && this.author.equals(other.getAuthor()))) && ((this.content == null && other.getContent() == null) || (this.content != null && java.util.Arrays.equals(this.content, other.getContent()))) && ((this.contentType == null && other.getContentType() == null) || (this.contentType != null && this.contentType.equals(other.getContentType()))) && ((this.dataSource == null && other.getDataSource() == null) || (this.dataSource != null && this.dataSource.equals(other.getDataSource()))) && ((this.initChar == null && other.getInitChar() == null) || (this.initChar != null && this.initChar.equals(other.getInitChar()))) && ((this.opusDesc == null && other.getOpusDesc() == null) || (this.opusDesc != null && this.opusDesc.equals(other.getOpusDesc()))) && ((this.opusId == null && other.getOpusId() == null) || (this.opusId != null && this.opusId.equals(other.getOpusId()))) && ((this.opusLargeUrl == null && other.getOpusLargeUrl() == null) || (this.opusLargeUrl != null && this.opusLargeUrl.equals(other.getOpusLargeUrl()))) && ((this.opusName == null && other.getOpusName() == null) || (this.opusName != null && this.opusName.equals(other.getOpusName()))) && ((this.opusUrl == null && other.getOpusUrl() == null) || (this.opusUrl != null && this.opusUrl.equals(other.getOpusUrl()))) && ((this.status == null && other.getStatus() == null) || (this.status != null && this.status.equals(other.getStatus()))) && ((this.supportedTerminalGroupIds == null && other.getSupportedTerminalGroupIds() == null) || (this.supportedTerminalGroupIds != null && java.util.Arrays.equals(this.supportedTerminalGroupIds, other.getSupportedTerminalGroupIds()))) && ((this.theme_id == null && other.getTheme_id() == null) || (this.theme_id != null && this.theme_id.equals(other.getTheme_id()))) && ((this.times == null && other.getTimes() == null) || (this.times != null && this.times.equals(other.getTimes()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getArea() != null) { _hashCode += getArea().hashCode(); } if (getAuthor() != null) { _hashCode += getAuthor().hashCode(); } if (getContent() != null) { for (int i = 0; i < java.lang.reflect.Array.getLength(getContent()); i++) { java.lang.Object obj = java.lang.reflect.Array.get(getContent(), i); if (obj != null && !obj.getClass().isArray()) { _hashCode += obj.hashCode(); } } } if (getContentType() != null) { _hashCode += getContentType().hashCode(); } if (getDataSource() != null) { _hashCode += getDataSource().hashCode(); } if (getInitChar() != null) { _hashCode += getInitChar().hashCode(); } if (getOpusDesc() != null) { _hashCode += getOpusDesc().hashCode(); } if (getOpusId() != null) { _hashCode += getOpusId().hashCode(); } if (getOpusLargeUrl() != null) { _hashCode += getOpusLargeUrl().hashCode(); } if (getOpusName() != null) { _hashCode += getOpusName().hashCode(); } if (getOpusUrl() != null) { _hashCode += getOpusUrl().hashCode(); } if (getStatus() != null) { _hashCode += getStatus().hashCode(); } if (getSupportedTerminalGroupIds() != null) { for (int i = 0; i < java.lang.reflect.Array.getLength(getSupportedTerminalGroupIds()); i++) { java.lang.Object obj = java.lang.reflect.Array.get(getSupportedTerminalGroupIds(), i); if (obj != null && !obj.getClass().isArray()) { _hashCode += obj.hashCode(); } } } if (getTheme_id() != null) { _hashCode += getTheme_id().hashCode(); } if (getTimes() != null) { _hashCode += getTimes().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(Opus.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("http://bean.sync.data.hisun.com", "Opus")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("area"); elemField.setXmlName(new javax.xml.namespace.QName("", "area")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("author"); elemField.setXmlName(new javax.xml.namespace.QName("", "author")); elemField.setXmlType(new javax.xml.namespace.QName("http://bean.sync.data.hisun.com", "Author")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("content"); elemField.setXmlName(new javax.xml.namespace.QName("", "content")); elemField.setXmlType(new javax.xml.namespace.QName("http://bean.sync.data.hisun.com", "Content")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("contentType"); elemField.setXmlName(new javax.xml.namespace.QName("", "contentType")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("dataSource"); elemField.setXmlName(new javax.xml.namespace.QName("", "dataSource")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("initChar"); elemField.setXmlName(new javax.xml.namespace.QName("", "initChar")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("opusDesc"); elemField.setXmlName(new javax.xml.namespace.QName("", "opusDesc")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("opusId"); elemField.setXmlName(new javax.xml.namespace.QName("", "opusId")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("opusLargeUrl"); elemField.setXmlName(new javax.xml.namespace.QName("", "opusLargeUrl")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("opusName"); elemField.setXmlName(new javax.xml.namespace.QName("", "opusName")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("opusUrl"); elemField.setXmlName(new javax.xml.namespace.QName("", "opusUrl")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("status"); elemField.setXmlName(new javax.xml.namespace.QName("", "status")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("supportedTerminalGroupIds"); elemField.setXmlName(new javax.xml.namespace.QName("", "supportedTerminalGroupIds")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("theme_id"); elemField.setXmlName(new javax.xml.namespace.QName("", "theme_id")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("times"); elemField.setXmlName(new javax.xml.namespace.QName("", "times")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer(java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer(_javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer(java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer(_javaType, _xmlType, typeDesc); } }
删除掉 以下Axis的类型元数据代码:
// Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(Opus.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("http://bean.sync.data.hisun.com", "Opus")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("area"); elemField.setXmlName(new javax.xml.namespace.QName("", "area")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("author"); elemField.setXmlName(new javax.xml.namespace.QName("", "author")); elemField.setXmlType(new javax.xml.namespace.QName("http://bean.sync.data.hisun.com", "Author")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("content"); elemField.setXmlName(new javax.xml.namespace.QName("", "content")); elemField.setXmlType(new javax.xml.namespace.QName("http://bean.sync.data.hisun.com", "Content")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("contentType"); elemField.setXmlName(new javax.xml.namespace.QName("", "contentType")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("dataSource"); elemField.setXmlName(new javax.xml.namespace.QName("", "dataSource")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("initChar"); elemField.setXmlName(new javax.xml.namespace.QName("", "initChar")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("opusDesc"); elemField.setXmlName(new javax.xml.namespace.QName("", "opusDesc")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("opusId"); elemField.setXmlName(new javax.xml.namespace.QName("", "opusId")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("opusLargeUrl"); elemField.setXmlName(new javax.xml.namespace.QName("", "opusLargeUrl")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("opusName"); elemField.setXmlName(new javax.xml.namespace.QName("", "opusName")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("opusUrl"); elemField.setXmlName(new javax.xml.namespace.QName("", "opusUrl")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("status"); elemField.setXmlName(new javax.xml.namespace.QName("", "status")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("supportedTerminalGroupIds"); elemField.setXmlName(new javax.xml.namespace.QName("", "supportedTerminalGroupIds")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("theme_id"); elemField.setXmlName(new javax.xml.namespace.QName("", "theme_id")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("times"); elemField.setXmlName(new javax.xml.namespace.QName("", "times")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer(java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer(_javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer(java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer(_javaType, _xmlType, typeDesc); }
发表评论
-
xStream开发HTTP的XML内容
2013-07-03 09:58 10601、编写自定义XPPDriver代码: package ... -
AXIS2 开发示例
2013-06-28 17:10 1050实体类: package com.mport.entity ... -
HttpURLConnection or URLConnection post xml content to web server
2013-05-31 01:56 2065客户端示例1: package client; ... -
Axis2 体系结构
2012-06-19 12:34 1011前言 结构都是它本身所能产生效率的结果。任何一个成功 ... -
Axis 1.4 基于wss4j UsernameToken 的安全验证
2011-12-30 17:24 2470利用以下的wsdl文件生成客户端及服务端代码: < ... -
wss4j和axis2实现WS-Security(2)
2011-12-29 12:13 1091转自:http://hi.baidu.com/zhaopeng ... -
wss4j和axis2实现WS-Security(1)
2011-12-29 11:31 1202转自:http://hi.baidu.com/zhaopeng ... -
Using WS-Security with Axis (Java) v2006
2011-12-23 11:24 1562转自:http://www.arcwebservices.co ... -
[Java] Testing SOAP Headers with a Simple Axis Handler
2011-12-23 11:02 1166转自:http://weblogs.asp.net/jdanf ... -
实现Axis web service 的数字证书认证(CLIENT-CERT)
2011-12-09 12:28 3733本文参考自:J2EE Web服务开发系列之十二: 实现安全的 ... -
实现Axis web service 的基本方式认证(BASIC)
2011-12-09 10:41 2190本文参考自:J2EE Web服务开发系列之十二: 实现安全的A ... -
生成SOAP消息示例
2011-09-27 11:36 11283调用 web service 时生成soap消息的区别, ... -
Axis 1.4 上传二进制文件(base64Binary)
2011-04-22 16:32 2046服务端代码: package samples.userg ... -
Axis 1.4 WSDL2Java、Java2WSDL的使用
2011-04-21 16:52 3448d:>java -classpath % ... -
在axis1.4中传递复杂类型数组参数(ArrayMapping)
2011-04-21 11:50 3748Axis1.4环境配置: 配置一些工具在命 ... -
axis2 学习(rpc)
2011-04-15 16:03 2157刚开始学习时,可不必考虑某些包的功能。我当前是把所有的包都导进 ... -
xfire 学习
2011-04-14 13:45 831我 -
学习dom4j的jaxb实现(半成品)
2011-03-08 16:47 1288primer.xml <?xml version=&q ... -
使用dom4j修改xml元素
2011-02-21 15:47 12273预先编写一个xml文件book ... -
使用 dom4j编写一个简单输出到文件的例子
2011-02-21 15:03 1104代码编写是参考这篇文档: http://blog.csd ...
相关推荐
在 Axis1.4 中,如果服务需要接收复杂类型数组,WSDL 文件需要明确地描述这种数组的类型,这通常涉及修改 `<types>` 部分,添加 XSD 定义。 5. **Java 类的注解和配置**: Axis1.4 使用 JAX-RPC(Java API for XML...
反之,如果你有一个WSDL文件,可以使用Axis1.4将其转换为Java服务端代码。同样,确保Eclipse中已经引入了Axis1.4库。运行wsdl2java工具,但这次需要提供WSDL文件的URL或本地路径。这将生成一系列Java类,包括服务...
- **步骤2:启动Axis** - 运行Axis1.4的wsdl2java工具,输入WSDL文件的URL或本地路径,该工具会自动生成Java客户端代码。 - **步骤3:构建客户端代码** - 编译生成的Java源代码,然后在你的项目中引入这些类,这些...
2. **Axis1.4工具**:这些是命令行工具,如wsdl2java和java2wsdl,用于将Java类转换为WSDL或反之亦然,便于服务的生成和发布。 3. **示例和文档**:提供了一些示例项目和详细的API文档,帮助开发者了解如何使用Axis...
axis1.4生成访问客户端代码
5. **暴露端点**:在Axis1.4中,你需要通过`wsdl2java`工具生成服务的WSDL(Web Service Description Language)文件,然后将这个WSDL文件的位置暴露为一个HTTP端点。Spring Boot可以通过`@Bean`注解创建一个`...
只需将服务实现类打包成`.aar`(Axis Archive)文件,然后通过管理控制台或命令行工具部署到`Axis2`服务器。 - **模块化**:`Axis2`支持模块化,可以根据需要加载或卸载特定的功能模块。 - **多协议支持**:除了...
5. **客户端生成**:同样,Axis1.4可以从WSDL文件自动生成Java客户端代码,这使得开发者可以快速创建与Web服务交互的客户端应用程序。 6. **模块和Policy**:Axis1.4支持模块化架构,允许添加额外的功能或扩展。...
2. **使用wsdl2java工具**: AXIS1.4提供了一个名为`wsdl2java`的命令行工具,可以将WSDL(Web Service Description Language)文件转换为Java源代码。WSDL文件描述了Web服务的接口,包括方法名、参数和返回类型。 3...
在Java世界中,Apache Axis是用于构建Web服务和客户端应用程序的工具包,它允许开发者将Java类暴露为Web服务,并且能够消费其他Web服务。Axis分为两个主要版本:Axis1和Axis2,这两个版本在功能、性能和设计上都有所...
2. 生成服务接口:使用Axis1.4的wsdl2java工具,根据Java类生成WSDL文件和服务接口代码。 3. 部署服务:将生成的服务接口和实现类部署到Axis1.4服务器上,可以使用`wsdeploy`命令或者在管理控制台进行操作。 4. ...
在本文中,我们将深入探讨如何在Spring Boot项目中集成并使用Axis1.4来发布Web服务。Spring Boot以其简化配置和快速开发能力而受到广泛欢迎,而Axis1.4是Apache软件基金会的一个开源项目,主要用于生成和消费SOAP ...
4. **部署服务**:使用`wsdl2java`生成的服务骨架类,将服务部署到Axis1.4服务器上,这通常涉及修改服务配置文件(如`services.xml`)。 5. **测试服务**:创建一个客户端测试程序,使用Axis1.4的`java2wsdl`工具...
编译后将生成的`.class`文件放置于`%TOMACAT_HOME%\webapps\axis\WEB-INF\classes\com\huawei\ws`目录下。 3. **创建部署配置文件** 在`Axis1_4`目录下创建`deploy.wsdd`文件,并按以下格式填写内容: ```xml ...
将WSDL文件和编译后的类文件放入这个档案中。接着,通过Axis1.4的管理界面或命令行工具部署服务。 **步骤四:创建Web服务客户端** 1. **生成客户端代码**:使用Axis1.4的`wsdl2java`工具生成客户端代码: ``` ...
1. **axis.jar**:这是 Axis1.4 的核心库,包含了处理 SOAP 消息、生成 WSDL(Web Services Description Language)文件、执行服务调用等功能。它提供了基于 Java 的 Web 服务实现,让开发者可以轻松创建和调用 Web ...
本教程将深入讲解如何使用Axis1.4来快速发布Web服务以及构建对应的客户端,这一切都将基于WSDL(Web服务描述语言)文件。 一、Axis1.4快速发布Web服务 1. 安装与配置:首先,确保你已经下载并安装了Axis1.4。解压...
下载并解压Axis1.4的ZIP文件,将bin目录添加到系统PATH中。 2. **创建Web服务**:编写Java类,定义服务接口和实现。 Axis1.4会根据这些类自动生成Web服务所需的部署描述文件(wsdd)和JavaServer Pages(JSP)。 3...
4. **部署服务**:将生成的服务类和WSDL文件放入Axis1.4的部署目录下,如`WEB-INF/services`。然后启动Axis1.4的HTTP服务器,服务就部署成功了。 5. **测试服务**:可以使用Axis1.4提供的测试工具或者自定义客户端...
2. **自动代码生成**:通过WSDL(Web Services Description Language)文件,Axis1.4可以自动生成Java客户端和服务端代码,极大地简化了开发流程。 3. **扩展性**:支持JAX-RPC(Java API for XML-RPC)和JAXM(Java...