Eu já vi várias vezes este tópico que vc me mandou. Ele já me foi muito util para conseguir importar as classes com o wsimport. Porém o erro que eu estou passando é o seguinte:
Meu serviço está retornando um objeto deste tipo NfeStatusServicoNF2Result (gerado pelo wsimport):
package br.inf.portalfiscal.nfe.wsdl.nfestatusservico2;
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.XmlAnyElement;
import javax.xml.bind.annotation.XmlMixed;
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>
* <any/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"content"
})
@XmlRootElement(name = "nfeStatusServicoNF2Result")
public class NfeStatusServicoNF2Result {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
/**
* Gets the value of the content property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
* {@link Object }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
return this.content;
}
}
Dentro do atributo content, tem um objeto do tipo RetConsStatServ. Porém este objeto só está vindo com o atributo (campo versao) preechido, todos os outros campos estão vindo null.
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.02.16 at 09:30:33 AM GMT-03:00
//
package br.inf.portalfiscal.nfe.status;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.datatype.XMLGregorianCalendar;
/**
* Tipo Resultado da Consulta do Status do Serviço
*
* <p>Java class for TRetConsStatServ complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="TRetConsStatServ">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="tpAmb" type="{http://www.portalfiscal.inf.br/nfe}TAmb"/>
* <element name="verAplic" type="{http://www.portalfiscal.inf.br/nfe}TVerAplic"/>
* <element name="cStat" type="{http://www.portalfiscal.inf.br/nfe}TStat"/>
* <element name="xMotivo" type="{http://www.portalfiscal.inf.br/nfe}TMotivo"/>
* <element name="cUF" type="{http://www.portalfiscal.inf.br/nfe}TCodUfIBGE"/>
* <element name="dhRecbto" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
* <element name="tMed" type="{http://www.portalfiscal.inf.br/nfe}TMed" minOccurs="0"/>
* <element name="dhRetorno" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
* <element name="xObs" type="{http://www.portalfiscal.inf.br/nfe}TMotivo" minOccurs="0"/>
* </sequence>
* <attribute name="versao" use="required" type="{http://www.portalfiscal.inf.br/nfe}TVerConsStatServ" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlRootElement(name= "retConsStatServ", namespace = "http://www.portalfiscal.inf.br/nfe")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "retConsStatServ", propOrder = {
"tpAmb",
"verAplic",
"cStat",
"xMotivo",
"cuf",
"dhRecbto",
"tMed",
"dhRetorno",
"xObs"
})
public class RetConsStatServ {
@XmlElement(required = true)
protected String tpAmb;
@XmlElement(required = true)
protected String verAplic;
@XmlElement(required = true)
protected String cStat;
@XmlElement(required = true)
protected String xMotivo;
@XmlElement(name = "cUF", required = true)
protected String cuf;
@XmlElement(required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar dhRecbto;
protected String tMed;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar dhRetorno;
protected String xObs;
@XmlAttribute(required = true)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String versao;
/**
* Gets the value of the tpAmb property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTpAmb() {
return tpAmb;
}
/**
* Sets the value of the tpAmb property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTpAmb(String value) {
this.tpAmb = value;
}
/**
* Gets the value of the verAplic property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVerAplic() {
return verAplic;
}
/**
* Sets the value of the verAplic property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVerAplic(String value) {
this.verAplic = value;
}
/**
* Gets the value of the cStat property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCStat() {
return cStat;
}
/**
* Sets the value of the cStat property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCStat(String value) {
this.cStat = value;
}
/**
* Gets the value of the xMotivo property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getXMotivo() {
return xMotivo;
}
/**
* Sets the value of the xMotivo property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setXMotivo(String value) {
this.xMotivo = value;
}
/**
* Gets the value of the cuf property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCUF() {
return cuf;
}
/**
* Sets the value of the cuf property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCUF(String value) {
this.cuf = value;
}
/**
* Gets the value of the dhRecbto property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getDhRecbto() {
return dhRecbto;
}
/**
* Sets the value of the dhRecbto property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setDhRecbto(XMLGregorianCalendar value) {
this.dhRecbto = value;
}
/**
* Gets the value of the tMed property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTMed() {
return tMed;
}
/**
* Sets the value of the tMed property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTMed(String value) {
this.tMed = value;
}
/**
* Gets the value of the dhRetorno property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getDhRetorno() {
return dhRetorno;
}
/**
* Sets the value of the dhRetorno property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setDhRetorno(XMLGregorianCalendar value) {
this.dhRetorno = value;
}
/**
* Gets the value of the xObs property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getXObs() {
return xObs;
}
/**
* Sets the value of the xObs property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setXObs(String value) {
this.xObs = value;
}
/**
* Gets the value of the versao property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersao() {
return versao;
}
/**
* Sets the value of the versao property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersao(String value) {
this.versao = value;
}
}
Eu fiz os testes ativando o dump da transação e assim eu sei que o xml está chegando corretamente pra mim.
Alguem já passou por este problema? Ou alguem tem alguma noção do que pode ser o problema?