继承自JAX-WS生成的类的类未被编组

时间:2017-06-13 17:00:22

标签: web-services jaxb jax-ws

我使用wsimport从WSDL生成JAX-WS客户端代码。

我正在使用从wsimport生成的某个类继承的参数调用Web服务。

wsimport生成的类是 -

package com.mywebservice;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;


@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MOR", propOrder = {
    "value"
})
public class MOR {

    @XmlValue
    protected String value;
    @XmlAttribute(name = "type")
    protected String type;


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

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

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

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

        public synchronized boolean equals(Object paramObject)
  {
    /*equals implementation*/
  }

  public synchronized int hashCode()
  {

   /*hashCode implementation*/*/
  }

}

我在Web服务调用期间传递了以下类的实例

public class TaggedMOR extends MOR {

private MOR moRef = null;

private String creatorMethodName = null;

public TaggedMOR(MOR MOR) {
    moRef = MOR;
}

public TaggedMOR() {
}

public void setCreatorMethodName(String methodName) {
    creatorMethodName = methodName;
}

public String getCreatorMethodName() {
    return creatorMethodName;
}

public MOR getMoRef() {
    return moRef;
}

}

我启用了http传输转储,看到TaggedMOR没有在SOAP信封中编组。

我还创建了一个XMLJavaTypeAdapter,但也没有用。

请建议,我是新手。

0 个答案:

没有答案