`
conkeyn
  • 浏览: 1522991 次
  • 性别: Icon_minigender_1
  • 来自: 厦门
社区版块
存档分类
最新评论

Axis 1.4 将WSDL文件逆向后String数组只变成String

 
阅读更多

        这些天在对一个项目扩展功能时使用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);
    }
 

 

分享到:
评论

相关推荐

    在axis1.4中传递复杂类型数组参数(ArrayMapping)

    在 Axis1.4 中,如果服务需要接收复杂类型数组,WSDL 文件需要明确地描述这种数组的类型,这通常涉及修改 `&lt;types&gt;` 部分,添加 XSD 定义。 5. **Java 类的注解和配置**: Axis1.4 使用 JAX-RPC(Java API for XML...

    axis1.4jar包以及WSDL和服务端代码互转方法

    反之,如果你有一个WSDL文件,可以使用Axis1.4将其转换为Java服务端代码。同样,确保Eclipse中已经引入了Axis1.4库。运行wsdl2java工具,但这次需要提供WSDL文件的URL或本地路径。这将生成一系列Java类,包括服务...

    axis1.4生成客户端

    - **步骤2:启动Axis** - 运行Axis1.4的wsdl2java工具,输入WSDL文件的URL或本地路径,该工具会自动生成Java客户端代码。 - **步骤3:构建客户端代码** - 编译生成的Java源代码,然后在你的项目中引入这些类,这些...

    axis1.4完整包下载

    2. **Axis1.4工具**:这些是命令行工具,如wsdl2java和java2wsdl,用于将Java类转换为WSDL或反之亦然,便于服务的生成和发布。 3. **示例和文档**:提供了一些示例项目和详细的API文档,帮助开发者了解如何使用Axis...

    axis1.4生成访问客户端代码

    axis1.4生成访问客户端代码

    springboot+axis1.4

    5. **暴露端点**:在Axis1.4中,你需要通过`wsdl2java`工具生成服务的WSDL(Web Service Description Language)文件,然后将这个WSDL文件的位置暴露为一个HTTP端点。Spring Boot可以通过`@Bean`注解创建一个`...

    axis1.4帮助文档

    5. **客户端生成**:同样,Axis1.4可以从WSDL文件自动生成Java客户端代码,这使得开发者可以快速创建与Web服务交互的客户端应用程序。 6. **模块和Policy**:Axis1.4支持模块化架构,允许添加额外的功能或扩展。...

    AXIS1.4webservice服务端和客户端例子

    2. **使用wsdl2java工具**: AXIS1.4提供了一个名为`wsdl2java`的命令行工具,可以将WSDL(Web Service Description Language)文件转换为Java源代码。WSDL文件描述了Web服务的接口,包括方法名、参数和返回类型。 3...

    axis1.4和axis2相关jar文件

    在Java世界中,Apache Axis是用于构建Web服务和客户端应用程序的工具包,它允许开发者将Java类暴露为Web服务,并且能够消费其他Web服务。Axis分为两个主要版本:Axis1和Axis2,这两个版本在功能、性能和设计上都有所...

    apache axis1.4实例

    2. 生成服务接口:使用Axis1.4的wsdl2java工具,根据Java类生成WSDL文件和服务接口代码。 3. 部署服务:将生成的服务接口和实现类部署到Axis1.4服务器上,可以使用`wsdeploy`命令或者在管理控制台进行操作。 4. ...

    springboot使用axis1.4的demo

    在本文中,我们将深入探讨如何在Spring Boot项目中集成并使用Axis1.4来发布Web服务。Spring Boot以其简化配置和快速开发能力而受到广泛欢迎,而Axis1.4是Apache软件基金会的一个开源项目,主要用于生成和消费SOAP ...

    webservice axis1.4服务实例

    4. **部署服务**:使用`wsdl2java`生成的服务骨架类,将服务部署到Axis1.4服务器上,这通常涉及修改服务配置文件(如`services.xml`)。 5. **测试服务**:创建一个客户端测试程序,使用Axis1.4的`java2wsdl`工具...

    用axis1.4发布自己的wsdl服务详解

    编译后将生成的`.class`文件放置于`%TOMACAT_HOME%\webapps\axis\WEB-INF\classes\com\huawei\ws`目录下。 3. **创建部署配置文件** 在`Axis1_4`目录下创建`deploy.wsdd`文件,并按以下格式填写内容: ```xml ...

    【java项目整合Axis1.4webservice搭建实例】客户端代码

    将WSDL文件和编译后的类文件放入这个档案中。接着,通过Axis1.4的管理界面或命令行工具部署服务。 **步骤四:创建Web服务客户端** 1. **生成客户端代码**:使用Axis1.4的`wsdl2java`工具生成客户端代码: ``` ...

    Axis1.4快速发布服务以及客服端详解(根据wsdl)

    本教程将深入讲解如何使用Axis1.4来快速发布Web服务以及构建对应的客户端,这一切都将基于WSDL(Web服务描述语言)文件。 一、Axis1.4快速发布Web服务 1. 安装与配置:首先,确保你已经下载并安装了Axis1.4。解压...

    axis1.4及webService开发教程

    下载并解压Axis1.4的ZIP文件,将bin目录添加到系统PATH中。 2. **创建Web服务**:编写Java类,定义服务接口和实现。 Axis1.4会根据这些类自动生成Web服务所需的部署描述文件(wsdd)和JavaServer Pages(JSP)。 3...

    【java项目整合Axis1.4webservice搭建实例】服务端代码

    4. **部署服务**:将生成的服务类和WSDL文件放入Axis1.4的部署目录下,如`WEB-INF/services`。然后启动Axis1.4的HTTP服务器,服务就部署成功了。 5. **测试服务**:可以使用Axis1.4提供的测试工具或者自定义客户端...

    apache axis1.4 官网备份

    2. **自动代码生成**:通过WSDL(Web Services Description Language)文件,Axis1.4可以自动生成Java客户端和服务端代码,极大地简化了开发流程。 3. **扩展性**:支持JAX-RPC(Java API for XML-RPC)和JAXM(Java...

    Springboot集成axis1.4的demo

    以下将详细讲解如何在Spring Boot应用中集成Axis1.4以及使用wsdd文件发布Web服务。 首先,了解 Axis1.4:Axis 是一个开源的Java Web服务框架,它允许开发者快速地创建和部署Web服务。Axis1.4是该框架的一个较老版本...

    使用axis将wsdl文件转换为java代码

    只需将服务实现类打包成`.aar`(Axis Archive)文件,然后通过管理控制台或命令行工具部署到`Axis2`服务器。 - **模块化**:`Axis2`支持模块化,可以根据需要加载或卸载特定的功能模块。 - **多协议支持**:除了...

Global site tag (gtag.js) - Google Analytics