Java 删除<;项目>;apache axis wsdl中数组复杂类型的标记

Java 删除<;项目>;apache axis wsdl中数组复杂类型的标记,java,spring,web-services,wsdl,axis,Java,Spring,Web Services,Wsdl,Axis,我正在尝试将我们的JavaSpring应用程序集成到客户机系统中。客户端系统需要调用我们的一个SOAP Web服务来提供数据。他们已经有了一个系统,我们将替换它。客户端还没有准备好对其进行任何更改,并要求我们使用与现在相同的格式提供Web服务。当我们尝试使用ApacheAxis1生成WSDL时,它给出了一个额外的标记,并重复该标记而不是实际的数组参数 他们提供了现有的WSDL,如下所示 <?xml version="1.0" encoding="utf-8"?> <wsdl:d

我正在尝试将我们的JavaSpring应用程序集成到客户机系统中。客户端系统需要调用我们的一个SOAP Web服务来提供数据。他们已经有了一个系统,我们将替换它。客户端还没有准备好对其进行任何更改,并要求我们使用与现在相同的格式提供Web服务。当我们尝试使用ApacheAxis1生成WSDL时,它给出了一个额外的
标记,并重复该标记而不是实际的数组参数

他们提供了现有的WSDL,如下所示

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s0="http://danateq.com/soap/link/eventgateway" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://eventIndication" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://eventIndication" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://danateq.com/soap/link/eventgateway">
      <s:import />
      <s:element name="EventIndication" type="s0:Input" />
      <s:complexType name="Input">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" ref="UserID" />
          <s:element minOccurs="0" maxOccurs="1" ref="UserIDType" />
          <s:element minOccurs="0" maxOccurs="1" ref="OrigPlatformID" />
          <s:element minOccurs="0" maxOccurs="1" ref="OrigPlatformNode" />
          <s:element minOccurs="0" maxOccurs="1" ref="EventID" />
          <s:element minOccurs="0" maxOccurs="unbounded" ref="Parameter" />
        </s:sequence>
      </s:complexType>
    </s:schema>
    <s:schema elementFormDefault="qualified">
      <s:element name="UserID" type="s:string" />
      <s:element name="UserIDType" type="s:string" />
      <s:element name="OrigPlatformID" type="s:string" />
      <s:element name="OrigPlatformNode" type="s:string" />
      <s:element name="EventID" type="s:string" />
      <s:element name="Parameter" type="tParameter" />
      <s:complexType name="tParameter">
        <s:sequence>
          <s:element minOccurs="1" maxOccurs="1" name="ParameterType" type="s:int" />
          <s:element minOccurs="0" maxOccurs="1" name="ParameterValue" type="s:string" />
        </s:sequence>
      </s:complexType>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="EventIndicationSoapIn">
    <wsdl:part name="EventIndication" element="s0:EventIndication" />
  </wsdl:message>
  <wsdl:message name="EventIndicationSoapOut" />
  <wsdl:portType name="PointsService2Soap">
    <wsdl:operation name="EventIndication">
      <wsdl:input message="tns:EventIndicationSoapIn" />
      <wsdl:output message="tns:EventIndicationSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="PointsService2Soap" type="tns:PointsService2Soap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="EventIndication">
      <soap:operation soapAction="http://EventIndication" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="PointsService2Soap12" type="tns:PointsService2Soap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="EventIndication">
      <soap12:operation soapAction="http://EventIndication" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="PointsService2">
    <wsdl:port name="PointsService2Soap" binding="tns:PointsService2Soap">
      <soap:address location="http://loyaltydev/Loyaltyws/PointsService2.asmx" />
    </wsdl:port>
    <wsdl:port name="PointsService2Soap12" binding="tns:PointsService2Soap12">
      <soap12:address location="http://loyaltydev/Loyaltyws/PointsService2.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
* * * *列表中允许以下类型的对象 *{@link TParameter} * * */ 公共TParameter[]getParameter(){ 返回参数; } } TParameter.java

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Input", namespace = "http://danateq.com/soap/link/eventgateway", propOrder = {
    "userID",
    "userIDType",
    "origPlatformID",
    "origPlatformNode",
    "eventID",
    "parameter"
})
public class Input {

    @XmlElement(name = "UserID")
    protected String userID;
    @XmlElement(name = "UserIDType")
    protected String userIDType;
    @XmlElement(name = "OrigPlatformID")
    protected String origPlatformID;
    @XmlElement(name = "OrigPlatformNode")
    protected String origPlatformNode;
    @XmlElement(name = "EventID")
    protected String eventID;
    @XmlElement(name = "Parameter")
    protected TParameter[] parameter;

    /**
     * Gets the value of the userID property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getUserID() {
        return userID;
    }

    /**
     * Sets the value of the userID property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setUserID(String value) {
        this.userID = value;
    }

    /**
     * Gets the value of the userIDType property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getUserIDType() {
        return userIDType;
    }

    /**
     * Sets the value of the userIDType property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setUserIDType(String value) {
        this.userIDType = value;
    }

    /**
     * Gets the value of the origPlatformID property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getOrigPlatformID() {
        return origPlatformID;
    }

    /**
     * Sets the value of the origPlatformID property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setOrigPlatformID(String value) {
        this.origPlatformID = value;
    }

    /**
     * Gets the value of the origPlatformNode property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getOrigPlatformNode() {
        return origPlatformNode;
    }

    /**
     * Sets the value of the origPlatformNode property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setOrigPlatformNode(String value) {
        this.origPlatformNode = value;
    }

    /**
     * Gets the value of the eventID property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getEventID() {
        return eventID;
    }

    /**
     * Sets the value of the eventID property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setEventID(String value) {
        this.eventID = value;
    }

    /**
     * Gets the value of the parameter property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the parameter property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getParameter().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link TParameter }
     * 
     * 
     */
    public TParameter[] getParameter() {
        return parameter;
    }
}
我尝试了不同的数组结构,
列表
,看看这是否能去掉
标记。似乎什么都不管用

如果有人能指导我正确定义,以便生成完全相同的请求格式,我将不胜感激。
提前感谢。

如果您正在使用eclipse并使用new->web service->web service工具自动生成WSDL的Java代码,那么在生成Java代码之前,请转到eclipse菜单窗口->首选项->axis发射器->勾选名为“对于包装的XML数组类型,首选构建bean而非直接数组”的复选框

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://webservices.api.inspirenetz.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://webservices.api.inspirenetz.com" xmlns:intf="http://webservices.api.inspirenetz.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 elementFormDefault="qualified" targetNamespace="http://webservices.api.inspirenetz.com" xmlns="http://www.w3.org/2001/XMLSchema">
   <complexType name="TParameter">
    <sequence>
     <element name="parameterType" type="xsd:int"/>
     <element name="parameterValue" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <complexType name="ArrayOfTParameter">
    <sequence>
     <element maxOccurs="unbounded" minOccurs="0" name="item" type="impl:TParameter"/>
    </sequence>
   </complexType>
   <complexType name="Input">
    <sequence>
     <element name="eventID" nillable="true" type="xsd:string"/>
     <element name="origPlatformID" nillable="true" type="xsd:string"/>
     <element name="origPlatformNode" nillable="true" type="xsd:string"/>
     <element name="parameter" nillable="true" type="impl:ArrayOfTParameter"/>
     <element name="userID" nillable="true" type="xsd:string"/>
     <element name="userIDType" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <element name="input" type="impl:Input"/>
   <element name="EventIndicationReturn" type="xsd:string"/>
  </schema>
 </wsdl:types>

   <wsdl:message name="EventIndicationResponse">

      <wsdl:part element="impl:EventIndicationReturn" name="EventIndicationReturn">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="EventIndicationRequest">

      <wsdl:part element="impl:input" name="input">

      </wsdl:part>

   </wsdl:message>

   <wsdl:portType name="FastdataWebService">

      <wsdl:operation name="EventIndication" parameterOrder="input">

         <wsdl:input message="impl:EventIndicationRequest" name="EventIndicationRequest">

       </wsdl:input>

         <wsdl:output message="impl:EventIndicationResponse" name="EventIndicationResponse">

       </wsdl:output>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="FastdataWebServiceSoapBinding" type="impl:FastdataWebService">

      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="EventIndication">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="EventIndicationRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="EventIndicationResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="FastdataWebServiceService">

      <wsdl:port binding="impl:FastdataWebServiceSoapBinding" name="FastdataWebService">

         <wsdlsoap:address location="http://localhost:8080/services/FastdataWebService"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.api.inspirenetz.com">
   <soapenv:Header/>
   <soapenv:Body>
      <web:input>
         <web:eventID>?</web:eventID>
         <web:origPlatformID>?</web:origPlatformID>
         <web:origPlatformNode>?</web:origPlatformNode>
         <web:parameter>
            <!--Zero or more repetitions:-->
            <web:item>
               <web:parameterType>?</web:parameterType>
               <web:parameterValue>?</web:parameterValue>
            </web:item>
         </web:parameter>
         <web:userID>?</web:userID>
         <web:userIDType>?</web:userIDType>
      </web:input>
   </soapenv:Body>
</soapenv:Envelope>
<!--Zero or more repetitions:-->
<Parameter>
    <ParameterType>?</ParameterType>
    <!--Optional:-->
    <ParameterValue>?</ParameterValue>
</Parameter>
<web:parameter>
    <!--Zero or more repetitions:-->
    <web:item>
       <web:parameterType>?</web:parameterType>
       <web:parameterValue>?</web:parameterValue>
    </web:item>
</web:parameter>
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Input", namespace = "http://danateq.com/soap/link/eventgateway", propOrder = {
    "userID",
    "userIDType",
    "origPlatformID",
    "origPlatformNode",
    "eventID",
    "parameter"
})
public class Input {

    @XmlElement(name = "UserID")
    protected String userID;
    @XmlElement(name = "UserIDType")
    protected String userIDType;
    @XmlElement(name = "OrigPlatformID")
    protected String origPlatformID;
    @XmlElement(name = "OrigPlatformNode")
    protected String origPlatformNode;
    @XmlElement(name = "EventID")
    protected String eventID;
    @XmlElement(name = "Parameter")
    protected TParameter[] parameter;

    /**
     * Gets the value of the userID property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getUserID() {
        return userID;
    }

    /**
     * Sets the value of the userID property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setUserID(String value) {
        this.userID = value;
    }

    /**
     * Gets the value of the userIDType property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getUserIDType() {
        return userIDType;
    }

    /**
     * Sets the value of the userIDType property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setUserIDType(String value) {
        this.userIDType = value;
    }

    /**
     * Gets the value of the origPlatformID property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getOrigPlatformID() {
        return origPlatformID;
    }

    /**
     * Sets the value of the origPlatformID property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setOrigPlatformID(String value) {
        this.origPlatformID = value;
    }

    /**
     * Gets the value of the origPlatformNode property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getOrigPlatformNode() {
        return origPlatformNode;
    }

    /**
     * Sets the value of the origPlatformNode property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setOrigPlatformNode(String value) {
        this.origPlatformNode = value;
    }

    /**
     * Gets the value of the eventID property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getEventID() {
        return eventID;
    }

    /**
     * Sets the value of the eventID property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setEventID(String value) {
        this.eventID = value;
    }

    /**
     * Gets the value of the parameter property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the parameter property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getParameter().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link TParameter }
     * 
     * 
     */
    public TParameter[] getParameter() {
        return parameter;
    }
}
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "tParameter", propOrder = {
    "parameterType",
    "parameterValue"
})
public class TParameter {

    @XmlElement(name = "ParameterType")
    protected int parameterType;
    @XmlElement(name = "ParameterValue")
    protected String parameterValue;

    /**
     * Gets the value of the parameterType property.
     * 
     */
    public int getParameterType() {
        return parameterType;
    }

    /**
     * Sets the value of the parameterType property.
     * 
     */
    public void setParameterType(int value) {
        this.parameterType = value;
    }

    /**
     * Gets the value of the parameterValue property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getParameterValue() {
        return parameterValue;
    }

    /**
     * Sets the value of the parameterValue property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setParameterValue(String value) {
        this.parameterValue = value;
    }

}