1

Preciso fazer uma requisição SOAP com o Grupo preenchido :

 <EncerraAgendamentoAuditoria xmlns="http://tempuri.org/">
  <lstrIDProcessoUnico>string</lstrIDProcessoUnico>
  <lintIDAgenda>int</lintIDAgenda>
  <lstrResponsavel>string</lstrResponsavel>
  <lstrStatusFinal>string</lstrStatusFinal>
  <lstrMotivoStatusFinal>string</lstrMotivoStatusFinal>
  <Grupo>
    <NomeGrupo>string</NomeGrupo>
    <Campos>
      <Item>
        <Campo>string</Campo>
        <Valor>string</Valor>
        <Ordem>int</Ordem>
      </Item>
      <Item>
        <Campo>string</Campo>
        <Valor>string</Valor>
        <Ordem>int</Ordem>
      </Item>
    </Campos>
    <Campos>
      <Item>
        <Campo>string</Campo>
        <Valor>string</Valor>
        <Ordem>int</Ordem>
      </Item>
      <Item>
        <Campo>string</Campo>
        <Valor>string</Valor>
        <Ordem>int</Ordem>
      </Item>
    </Campos>
    <Arquivos>
      <Documento>
        <IDArquivo>string</IDArquivo>
        <NomeArquivo>string</NomeArquivo>
        <DataAnexo>string</DataAnexo>
        <TipoArquivo>string</TipoArquivo>
        <UrlDownload>string</UrlDownload>
      </Documento>
      <Documento>
        <IDArquivo>string</IDArquivo>
        <NomeArquivo>string</NomeArquivo>
        <DataAnexo>string</DataAnexo>
        <TipoArquivo>string</TipoArquivo>
        <UrlDownload>string</UrlDownload>
      </Documento>
    </Arquivos> //restante

O problema é que quando monta o envelope da requisição, no Objeto Grupo ele apenas considera a String "NomeGrupo", sendo assim, não considerando o campo "Campos" e nem o campo "Arquivos". O envelope fica assim:

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <EncerraAgendamentoAuditoria xmlns="http://tempuri.org/">
   <lstrIDProcessoUnico>344234324</lstrIDProcessoUnico>
   <lintIDAgenda>43243242432</lintIDAgenda>
   <lstrResponsavel>AUTOMATE</lstrResponsavel>
   <lstrStatusFinal>CUMPRIDO</lstrStatusFinal>
   <lstrMotivoStatusFinal>ROB&#xD4;PENDENTE</lstrMotivoStatusFinal>
   <Grupo>
    <NomeGrupo>ROBO</NomeGrupo>
   </Grupo>//restante

Classe Grupo:

package org.tempuri;

public class Grupo  implements java.io.Serializable {
    private java.lang.String nomeGrupo;

private org.tempuri.Campos campos;

private org.tempuri.DocumentoArquivo[] arquivos;

public Grupo() {
}

public Grupo(
       java.lang.String nomeGrupo,
       org.tempuri.Campos campos,
       org.tempuri.DocumentoArquivo[] arquivos) {
       this.nomeGrupo = nomeGrupo;
       this.campos = campos;
       this.arquivos = arquivos;
}


/**
 * Gets the nomeGrupo value for this Grupo.
 * 
 * @return nomeGrupo
 */
public java.lang.String getNomeGrupo() {
    return nomeGrupo;
}


/**
 * Sets the nomeGrupo value for this Grupo.
 * 
 * @param nomeGrupo
 */
public void setNomeGrupo(java.lang.String nomeGrupo) {
    this.nomeGrupo = nomeGrupo;
}


/**
 * Gets the campos value for this Grupo.
 * 
 * @return campos
 */
public org.tempuri.Campos getCampos() {
    return campos;
}


/**
 * Sets the campos value for this Grupo.
 * 
 * @param campos
 */
public void setCampos(org.tempuri.Campos campos) {
    this.campos = campos;
}

public org.tempuri.Campos getCampos(int i) {
    return this.campos;
}

public void setCampos(int i, org.tempuri.Campos _value) {
    this.campos = _value;
}


/**
 * Gets the arquivos value for this Grupo.
 * 
 * @return arquivos
 */
public org.tempuri.DocumentoArquivo[] getArquivos() {
    return arquivos;
}


/**
 * Sets the arquivos value for this Grupo.
 * 
 * @param arquivos
 */
public void setArquivos(org.tempuri.DocumentoArquivo[] arquivos) {
    this.arquivos = arquivos;
}

public org.tempuri.DocumentoArquivo[] getArquivos(int i) {
    return this.arquivos;
}

public void setArquivos(int i, org.tempuri.DocumentoArquivo[] _value) {
    this.arquivos = _value;
}


private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
    if (__hashCodeCalc) {
        return 0;
    }
    __hashCodeCalc = true;
    int _hashCode = 1;
    if (getNomeGrupo() != null) {
        _hashCode += getNomeGrupo().hashCode();
    }
    if (getCampos() != null) {
        for (int i=0;
             i<java.lang.reflect.Array.getLength(getCampos());
             i++) {
            java.lang.Object obj = java.lang.reflect.Array.get(getCampos(), i);
            if (obj != null &&
                !obj.getClass().isArray()) {
                _hashCode += obj.hashCode();
            }
        }
    }
    if (getArquivos() != null) {
        for (int i=0;
             i<java.lang.reflect.Array.getLength(getArquivos());
             i++) {
            java.lang.Object obj = java.lang.reflect.Array.get(getArquivos(), i);
            if (obj != null &&
                !obj.getClass().isArray()) {
                _hashCode += obj.hashCode();
            }
        }
    }
    __hashCodeCalc = false;
    return _hashCode;
}

// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
    new org.apache.axis.description.TypeDesc(Grupo.class, true);

static {
    typeDesc.setXmlType(new javax.xml.namespace.QName("http://tempuri.org/", "Grupo"));
    org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
    elemField.setFieldName("nomeGrupo");
    elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "NomeGrupo"));
    elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
    elemField.setMinOccurs(0);
    elemField.setNillable(false);
    typeDesc.addFieldDesc(elemField);
    elemField = new org.apache.axis.description.ElementDesc();
    elemField.setFieldName("campos");
    elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "Campos"));
    elemField.setXmlType(new javax.xml.namespace.QName("http://tempuri.org/", "Campos"));
    elemField.setMinOccurs(0);
    elemField.setNillable(false);
    elemField.setMaxOccursUnbounded(true);
    typeDesc.addFieldDesc(elemField);
    elemField = new org.apache.axis.description.ElementDesc();
    elemField.setFieldName("arquivos");
    elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "Arquivos"));
    elemField.setXmlType(new javax.xml.namespace.QName("http://tempuri.org/", "Arquivos"));
    elemField.setMinOccurs(0);
    elemField.setNillable(false);
    elemField.setMaxOccursUnbounded(true);
    typeDesc.addFieldDesc(elemField);
}

/**
 * Return type metadata object
 */
public static org.apache.axis.description.TypeDesc getTypeDesc() {
    return typeDesc;
}

/**
 * Get Custom Serializer
 */
public static org.apache.axis.encoding.Serializer getSerializer(
       java.lang.String mechType, 
       java.lang.Class _javaType,  
       javax.xml.namespace.QName _xmlType) {
    return 
      new  org.apache.axis.encoding.ser.BeanSerializer(
        _javaType, _xmlType, typeDesc);
}

/**
 * Get Custom Deserializer
 */
public static org.apache.axis.encoding.Deserializer getDeserializer(
       java.lang.String mechType, 
       java.lang.Class _javaType,  
       javax.xml.namespace.QName _xmlType) {
    return 
      new  org.apache.axis.encoding.ser.BeanDeserializer(
        _javaType, _xmlType, typeDesc);
}

}

Classe Campos:

public class Campos  implements java.io.Serializable {

private org.tempuri.Item[] items;


public Campos() {
}

public Campos(Item[] items) {
    this.items = items;
}

public Item[] getItems() {
    return items;
}

public void setItems(Item[] items) {
    this.items = items;
}


// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(Grupo.class, true);

static {
    typeDesc.setXmlType(new javax.xml.namespace.QName("http://tempuri.org/", "Campos"));
    org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
    elemField.setFieldName("items");
    elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "Item"));
    elemField.setXmlType(new javax.xml.namespace.QName("http://tempuri.org/", "Item"));
    elemField.setMinOccurs(0);
    elemField.setNillable(false);
    elemField.setMaxOccursUnbounded(true);
    typeDesc.addFieldDesc(elemField);
}

/**
 * Return type metadata object
 */
public static org.apache.axis.description.TypeDesc getTypeDesc() {
    return typeDesc;
}

/**
 * Get Custom Serializer
 */
public static org.apache.axis.encoding.Serializer getSerializer(
        java.lang.String mechType,
        java.lang.Class _javaType,
        javax.xml.namespace.QName _xmlType) {
    return
            new org.apache.axis.encoding.ser.BeanSerializer(
                    _javaType, _xmlType, typeDesc);
}

/**
 * Get Custom Deserializer
 */
public static org.apache.axis.encoding.Deserializer getDeserializer(
        java.lang.String mechType,
        java.lang.Class _javaType,
        javax.xml.namespace.QName _xmlType) {
    return
            new org.apache.axis.encoding.ser.BeanDeserializer(
                    _javaType, _xmlType, typeDesc);
}

Classe DocumentoArquivo:

/**


* DocumentoArquivo.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package org.tempuri;

public class DocumentoArquivo  implements java.io.Serializable {
    private java.lang.String IDArquivo;
private java.lang.String nomeArquivo;

private java.lang.String dataAnexo;

private java.lang.String tipoArquivo;

private java.lang.String urlDownload;

public DocumentoArquivo() {
}

public DocumentoArquivo(
       java.lang.String IDArquivo,
       java.lang.String nomeArquivo,
       java.lang.String dataAnexo,
       java.lang.String tipoArquivo,
       java.lang.String urlDownload) {
       this.IDArquivo = IDArquivo;
       this.nomeArquivo = nomeArquivo;
       this.dataAnexo = dataAnexo;
       this.tipoArquivo = tipoArquivo;
       this.urlDownload = urlDownload;
}


/**
 * Gets the IDArquivo value for this DocumentoArquivo.
 * 
 * @return IDArquivo
 */
public java.lang.String getIDArquivo() {
    return IDArquivo;
}


/**
 * Sets the IDArquivo value for this DocumentoArquivo.
 * 
 * @param IDArquivo
 */
public void setIDArquivo(java.lang.String IDArquivo) {
    this.IDArquivo = IDArquivo;
}


/**
 * Gets the nomeArquivo value for this DocumentoArquivo.
 * 
 * @return nomeArquivo
 */
public java.lang.String getNomeArquivo() {
    return nomeArquivo;
}


/**
 * Sets the nomeArquivo value for this DocumentoArquivo.
 * 
 * @param nomeArquivo
 */
public void setNomeArquivo(java.lang.String nomeArquivo) {
    this.nomeArquivo = nomeArquivo;
}


/**
 * Gets the dataAnexo value for this DocumentoArquivo.
 * 
 * @return dataAnexo
 */
public java.lang.String getDataAnexo() {
    return dataAnexo;
}


/**
 * Sets the dataAnexo value for this DocumentoArquivo.
 * 
 * @param dataAnexo
 */
public void setDataAnexo(java.lang.String dataAnexo) {
    this.dataAnexo = dataAnexo;
}


/**
 * Gets the tipoArquivo value for this DocumentoArquivo.
 * 
 * @return tipoArquivo
 */
public java.lang.String getTipoArquivo() {
    return tipoArquivo;
}


/**
 * Sets the tipoArquivo value for this DocumentoArquivo.
 * 
 * @param tipoArquivo
 */
public void setTipoArquivo(java.lang.String tipoArquivo) {
    this.tipoArquivo = tipoArquivo;
}


/**
 * Gets the urlDownload value for this DocumentoArquivo.
 * 
 * @return urlDownload
 */
public java.lang.String getUrlDownload() {
    return urlDownload;
}


/**
 * Sets the urlDownload value for this DocumentoArquivo.
 * 
 * @param urlDownload
 */
public void setUrlDownload(java.lang.String urlDownload) {
    this.urlDownload = urlDownload;
}

private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
    if (!(obj instanceof DocumentoArquivo)) return false;
    DocumentoArquivo other = (DocumentoArquivo) obj;
    if (obj == null) return false;
    if (this == obj) return true;
    if (__equalsCalc != null) {
        return (__equalsCalc == obj);
    }
    __equalsCalc = obj;
    boolean _equals;
    _equals = true && 
        ((this.IDArquivo==null && other.getIDArquivo()==null) || 
         (this.IDArquivo!=null &&
          this.IDArquivo.equals(other.getIDArquivo()))) &&
        ((this.nomeArquivo==null && other.getNomeArquivo()==null) || 
         (this.nomeArquivo!=null &&
          this.nomeArquivo.equals(other.getNomeArquivo()))) &&
        ((this.dataAnexo==null && other.getDataAnexo()==null) || 
         (this.dataAnexo!=null &&
          this.dataAnexo.equals(other.getDataAnexo()))) &&
        ((this.tipoArquivo==null && other.getTipoArquivo()==null) || 
         (this.tipoArquivo!=null &&
          this.tipoArquivo.equals(other.getTipoArquivo()))) &&
        ((this.urlDownload==null && other.getUrlDownload()==null) || 
         (this.urlDownload!=null &&
          this.urlDownload.equals(other.getUrlDownload())));
    __equalsCalc = null;
    return _equals;
}

private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
    if (__hashCodeCalc) {
        return 0;
    }
    __hashCodeCalc = true;
    int _hashCode = 1;
    if (getIDArquivo() != null) {
        _hashCode += getIDArquivo().hashCode();
    }
    if (getNomeArquivo() != null) {
        _hashCode += getNomeArquivo().hashCode();
    }
    if (getDataAnexo() != null) {
        _hashCode += getDataAnexo().hashCode();
    }
    if (getTipoArquivo() != null) {
        _hashCode += getTipoArquivo().hashCode();
    }
    if (getUrlDownload() != null) {
        _hashCode += getUrlDownload().hashCode();
    }
    __hashCodeCalc = false;
    return _hashCode;
}

// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
    new org.apache.axis.description.TypeDesc(DocumentoArquivo.class, true);

static {
    typeDesc.setXmlType(new javax.xml.namespace.QName("http://tempuri.org/", "DocumentoArquivo"));
    org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
    elemField.setFieldName("IDArquivo");
    elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "IDArquivo"));
    elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
    elemField.setMinOccurs(0);
    elemField.setNillable(false);
    typeDesc.addFieldDesc(elemField);
    elemField = new org.apache.axis.description.ElementDesc();
    elemField.setFieldName("nomeArquivo");
    elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "NomeArquivo"));
    elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
    elemField.setMinOccurs(0);
    elemField.setNillable(false);
    typeDesc.addFieldDesc(elemField);
    elemField = new org.apache.axis.description.ElementDesc();
    elemField.setFieldName("dataAnexo");
    elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "DataAnexo"));
    elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
    elemField.setMinOccurs(0);
    elemField.setNillable(false);
    typeDesc.addFieldDesc(elemField);
    elemField = new org.apache.axis.description.ElementDesc();
    elemField.setFieldName("tipoArquivo");
    elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "TipoArquivo"));
    elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
    elemField.setMinOccurs(0);
    elemField.setNillable(false);
    typeDesc.addFieldDesc(elemField);
    elemField = new org.apache.axis.description.ElementDesc();
    elemField.setFieldName("urlDownload");
    elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "UrlDownload"));
    elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
    elemField.setMinOccurs(0);
    elemField.setNillable(false);
    typeDesc.addFieldDesc(elemField);
}

/**
 * Return type metadata object
 */
public static org.apache.axis.description.TypeDesc getTypeDesc() {
    return typeDesc;
}

/**
 * Get Custom Serializer
 */
public static org.apache.axis.encoding.Serializer getSerializer(
       java.lang.String mechType, 
       java.lang.Class _javaType,  
       javax.xml.namespace.QName _xmlType) {
    return 
      new  org.apache.axis.encoding.ser.BeanSerializer(
        _javaType, _xmlType, typeDesc);
}

/**
 * Get Custom Deserializer
 */
public static org.apache.axis.encoding.Deserializer getDeserializer(
       java.lang.String mechType, 
       java.lang.Class _javaType,  
       javax.xml.namespace.QName _xmlType) {
    return 
      new  org.apache.axis.encoding.ser.BeanDeserializer(
        _javaType, _xmlType, typeDesc);
}

Obs.:: como o campo "Campos" aceita N Itens, então criei apenas um objeto Campos, ao invés de ser um vetor.

0

Você deve fazer log-in para responder a esta pergunta.

Pesquise outras perguntas com a tag .