java - SOAP Web 服务 : Axis2 1. 6.2

标签 java web-services soap apache-axis

我已经使用 Axis2 引擎(服务器和客户端)创建了 SOAP Web 服务 link 它运行良好。客户端的 Eclipse 插件(使用 WSDL 的代码生成)创建了 stub 、回调处理程序、公开的方法类等。到目前为止一切都很好。

我的一个 friend 给出了一些项目,其中也包含使用 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创建的项目不会生成任何此类文件和任何使用注释的文件。

您能解释一下其中的区别吗?

最佳答案

您的 friend 似乎使用 JAXB 数据绑定(bind),而您显然没有使用。

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

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

关于java - SOAP Web 服务 : Axis2 1. 6.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24078142/

相关文章:

java - 使用混合 POJOS 处理集合,每个 POJO 使用不同的处理程序

java - 如何从 Web 服务方法返回多个属性

java - 使用 PHP Soap 服务器和 Java 客户端的 Web 服务

java - 内联 css 不适用于使用 java 的电子邮件中的 HTML

java - 更改 Eclipse 的重构工具行为

c# - 连接的服务组件 Microsoft WCF Web 服务引用提供程序失败。(HRESULT : 0x80131500) the project format is incorrect

c# - 如何在 jquery easy ui CRUD DataGrid 中绑定(bind) Web 服务

java - 如何在apache tomcat中配置域名

java - Android 从设备设置安装自签名证书 SSL VS 以编程方式安装

java - PDFBox 是否允许从 AcroForm 中删除一个字段?