JAXB-找不到Java类的消息体编写器
我正试图询问一个rest服务,我需要输入一些数据 我要用来打电话的代码如下:JAXB-找不到Java类的消息体编写器,java,jaxb,jersey,Java,Jaxb,Jersey,我正试图询问一个rest服务,我需要输入一些数据 我要用来打电话的代码如下: WebResource resource = this.client.resource(url); DocumentIndexFields myDocumentIndexFields = (DocumentIndexFields) resource.type(MediaType.APPLICATION_XML_TYPE).put(DocumentIndexFields.class, documentIndexField
WebResource resource = this.client.resource(url);
DocumentIndexFields myDocumentIndexFields = (DocumentIndexFields) resource.type(MediaType.APPLICATION_XML_TYPE).put(DocumentIndexFields.class, documentIndexFields);
package myPackage;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for DocumentIndexFields complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="DocumentIndexFields">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Field" type="{http://dev.docuware.com/schema/public/services/platform}DocumentIndexField" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DocumentIndexFields", propOrder = {
"field"
})
@XmlSeeAlso({
UpdateIndexFieldsInfo.class
})
public class DocumentIndexFields {
@XmlElement(name = "Field")
protected List<DocumentIndexField> field;
public List<DocumentIndexField> getField() {
if (field == null) {
field = new ArrayList<DocumentIndexField>();
}
return this.field;
}
}
我的资源表示如下:
WebResource resource = this.client.resource(url);
DocumentIndexFields myDocumentIndexFields = (DocumentIndexFields) resource.type(MediaType.APPLICATION_XML_TYPE).put(DocumentIndexFields.class, documentIndexFields);
package myPackage;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for DocumentIndexFields complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="DocumentIndexFields">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Field" type="{http://dev.docuware.com/schema/public/services/platform}DocumentIndexField" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DocumentIndexFields", propOrder = {
"field"
})
@XmlSeeAlso({
UpdateIndexFieldsInfo.class
})
public class DocumentIndexFields {
@XmlElement(name = "Field")
protected List<DocumentIndexField> field;
public List<DocumentIndexField> getField() {
if (field == null) {
field = new ArrayList<DocumentIndexField>();
}
return this.field;
}
}
当我执行调用时,会出现以下错误:
我错在哪里?
谢谢请发布完整的堆栈跟踪。您可以发布接收请求的web服务吗?它似乎没有一个很遗憾的地址,我没有访问Web服务的权限