【问题标题】:SOAP webservices : Axis2 1.6.2SOAP 网络服务:Axis2 1.6.2
【发布时间】:2014-06-06 09:10:51
【问题描述】:

我已经使用link 创建了带有 Axis2 引擎(服务器和客户端)的 SOAP Web 服务 它工作正常。客户端的 Eclipse 插件(使用 WSDL 的代码生成)创建了存根、回调处理程序、公开的方法类等。到目前为止一切正常。

我的一个朋友给出了一些项目,其中还包含使用axis2的客户端。这个项目我可以看到一些文件,如下所示:

`
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;


/**
 * <p>Java class for anonymous complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType>
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="count" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "count"
})
@XmlRootElement(name = "deleteMultipleResponse")
public class DeleteMultipleResponse {

    protected String count;

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

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

}
`

我可以在下面看到多个文件以及注释的使用。

` /**
     * <p>Java class for anonymous complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType>
     *   &lt;complexContent>
     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       &lt;sequence>
     *         &lt;element name="count" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *       &lt;/sequence>
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
`

我使用这个link 创建的项目没有生成任何此类文件和任何使用注释的文件。

你能解释一下区别吗?

【问题讨论】:

    标签: java web-services soap axis2


    【解决方案1】:

    您的朋友似乎使用 JAXB 数据绑定,而您显然没有。

    AXIS2 数据绑定(ADB、Axiom、Jaxb 等)有多种不同的可用选项

    您可能想查看官方的 Apache Axis2 教程以获得更深入的了解 http://axis.apache.org/axis2/java/core/docs/userguide-creatingclients.html#adb

    【讨论】:

    • 是 JAXB 还是 jibx。当我尝试在 Eclipse 中使用 Axis2 代码生成插件从 WSDL 创建客户端代码时,我在数据绑定名称中获得了 g 4 个选项,即 adb、xmlbeans、jibx、无。你在说这个jibx??
    猜你喜欢
    • 2012-09-06
    • 1970-01-01
    • 2017-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多