Boa noite pessoal.
Estou tentando consumir o serviço updatedocument, estou usando o metodo que aprendi na academy porem não esta funcionando, esta dando o erro: Cannot read property find of undefined no console do navegador, meu codigo:
$(document).ready(function(){
//$("#testet2").click(function(){
alert("Doc Func!!");
var _xml;
_xml +="<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:ws='http://ws.dm.ecm.technology.totvs.com/'>";
_xml +="<soapenv:Header/>";
_xml +="<soapenv:Body>";
_xml +="<ws:updateDocument>";
_xml +="<username>webservice</username>";
_xml +="<password>1234</password>";
_xml +="<companyId>1</companyId>";
_xml +="<Document>";
_xml +="<item>";
_xml +="<activeVersion>false</activeVersion>";
_xml +="<approved>true</approved>";
_xml +="<colleagueId>allanlima</colleagueId>";//nome
_xml +="<documentDescription>A_2018_2545_teste_2547</documentDescription>";//docDescription
_xml +="<documentId>2901</documentId>";//idDocument
_xml +="<expires>true</expires>";
_xml +="<parentDocumentId>2877</parentDocumentId>";//parentId
_xml +="<privateDocument>false</privateDocument>";
_xml +="<publisherId>allanlima</publisherId>";//publisherId
_xml +="<deleted>false</deleted>";
_xml +="<documentTypeId>1</documentTypeId>";
_xml +="<version>1000</version>";
_xml +="<versionOption>2</versionOption>";
_xml +="<validationStartDate>2018-11-05</validationStartDate>";//DataCriacao
_xml +="<expirationDate>2019-11-05</expirationDate>";//expirationDate
_xml +="</Document>";
_xml +="</item>";
_xml +="<Attachments>";
_xml +="<item>";
_xml +="<attach>false</attach>";
_xml +="<editing>false</editing>";
_xml +="<fileName>Desert.jpg</fileName>";
_xml +="<principal>true</principal>";
_xml +="</item>";
_xml +="</Attachments>";
_xml +="<security>";
_xml +="</security>";
_xml +="<Approvers> " ;
_xml +="</Approvers>";
_xml +="<RelatedDocuments> " ;
_xml +="</RelatedDocuments>";
_xml +="</ws:updateDocument>";
_xml +="</soapenv:Body>";
_xml +="</soapenv:Envelope>";
parser = new DOMParser();
xmlDoc = parser.parseFromString(_xml,"text/xml")
var wsUrl = "/webdesk/ECMDocumentService?wsdl";
FLUIGC.ajax({
type: "POST",
dataType: "xml",
url: wsUrl,
data: xmlDoc,
processData: false,
contentType: "text/xml; charset=\"utf-8\"",
success:function(data){
alert("success function");
FLUIGC.toast({
title: 'Processo iniciado!',
message: 'Update concluido',
type: 'info'
});
}
});
});
Print Erro:
Log Navegador: