![](/img/trans.png)
[英]How to read the SOAP raw rquest and response messages in axis2 webservices
[英]SOAP webservices : Axis2 1.6.2
我已經使用此鏈接使用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>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="count" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </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>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="count" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
`
我使用此鏈接創建的項目未生成任何此類文件和任何使用注釋的文件。
你能解釋一下區別嗎?
您的朋友似乎使用了JAXB數據綁定,而您顯然沒有。
AXIS2數據綁定有幾種不同的選項(ADB,Axiom,Jaxb等)。
您可能想查看官方的Apache Axis2教程,以更深入地了解http://axis.apache.org/axis2/java/core/docs/userguide-creatingclients.html#adb
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.