- Criado por Fábio Augusto Amaral Melo Nunes, última alteração por Daniel Santos Campos em 18 set, 2018
Você está vendo a versão antiga da página. Ver a versão atual.
Comparar com o atual Ver Histórico da Página
« Anterior Versão 22 Próxima »
Introdução
O Web Service wsProcess é o responsável pela execução de processos do sistema
Como funciona
Estão expostos no wsProcess alguns serviços, onde para consumi-los é necessário enviar através de uma requisição um envelope SOAP, passando os parâmetros de cada serviço.
Serviços Disponíveis
Os parâmetros solicitado pelo ExecuteWithXmlParams são:
ProcessServerName tipo String
strXmlParams tipo String
Para pegar o parâmetro XML é necessário executar o processo através da biblioteca.
Acesse a biblioteca e execute o processo que deseja utilizar
No exemplo foi utilizado o processo de Cópia de Consultas SQL entre Coligadas
Selecionar para qual Coligada deseja copiar a consulta SQL e execute o processo.
Após o processo ter sido executado com sucesso siga para o passo 2
Agora é necessário pegar o ID do Job que foi gerado pelo processo
Acesse o menu "Ambiente | Gerenciamento de Jobs"
Após saber qual é o ID do Job siga para o Passo 3
Sabendo qual é o ID do Job é necessário utilizar a ferramenta TotvsWSClient.
Após executar o TotvsWsClient acesse a visão de processos
Informe o Job do processo e clique em carregar
Será exibido o registro equivalente ao ID Job informado
Dê dois cliques no registro e siga para o próximo passo
Após abrir o registro serão exibidos os dados do registro, Propriedades e o XML
Acesse a Aba XML, clique na opção de "Codificar como CDATA" e copie o XML, pois é ele que será passado como parâmetro do processo
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://www.totvs.com/"> <soapenv:Header/> <soapenv:Body> <tot:ExecuteWithXmlParams> <!--Optional:--> <tot:ProcessServerName>GlbProcCopyConsSQL</tot:ProcessServerName> <!--Optional:--> <tot:strXmlParams><?xml version="1.0" encoding="utf-16"?> <GlbParamsProcCopyColig xmlns:i="http://www.w3.org/2001/XMLSchema-instance" z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" xmlns="http://www.totvs.com.br/RM/"> <CanParallelize xmlns="http://www.totvs.com/">true</CanParallelize> <Context xmlns:d2p1="http://www.totvs.com.br/RM/" z:Id="i2" xmlns="http://www.totvs.com/"> <d2p1:_params xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODUNIDADEBIB</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">1</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CHAPAFUNCIONARIO</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">00001</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$EXERCICIOFISCAL</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">2</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODFILIAL</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">1</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$RHTIPOUSR</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">01</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODCOLIGADA</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">1</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$EDUTIPOUSR</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">F</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODLOCPRT</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">5</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODUSUARIO</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">mestre</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODUSUARIOSERVICO</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string"></d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODSISTEMA</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">G</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODTIPOCURSO</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">2</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODIGOEXTERNO</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">-1</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$IDPRJ</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">2</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> </d2p1:_params> <d2p1:Environment>DotNet</d2p1:Environment> </Context> <Initialized xmlns="http://www.totvs.com/">true</Initialized> <IsolateProcess xmlns="http://www.totvs.com/">false</IsolateProcess> <MaximumQuantityOfPrimaryKeysPerProcess xmlns="http://www.totvs.com/">1000</MaximumQuantityOfPrimaryKeysPerProcess> <MinimumQuantityOfPrimaryKeysPerProcess xmlns="http://www.totvs.com/">1</MinimumQuantityOfPrimaryKeysPerProcess> <PrimaryKeyList xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://www.totvs.com/"> <d2p1:ArrayOfanyType> <d2p1:anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:short">1</d2p1:anyType> <d2p1:anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">G</d2p1:anyType> <d2p1:anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Exemplo</d2p1:anyType> </d2p1:ArrayOfanyType> </PrimaryKeyList> <PrimaryKeyNames xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://www.totvs.com/"> <d2p1:string>CODCOLIGADA</d2p1:string> <d2p1:string>APLICACAO</d2p1:string> <d2p1:string>CODSENTENCA</d2p1:string> </PrimaryKeyNames> <QuantityOfSplits xmlns="http://www.totvs.com/">0</QuantityOfSplits> <ShouldParallelize xmlns="http://www.totvs.com/">false</ShouldParallelize> <IsReplaceExistingRecordsVisible>true</IsReplaceExistingRecordsVisible> <ReplaceExistingRecords>false</ReplaceExistingRecords> <TargetColigadas xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:int>6</d2p1:int> </TargetColigadas> </GlbParamsProcCopyColig></tot:strXmlParams> </tot:ExecuteWithXmlParams> </soapenv:Body> </soapenv:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <ExecuteWithXmlParamsResponse xmlns="http://www.totvs.com/"> <ExecuteWithXmlParamsResult>1</ExecuteWithXmlParamsResult> </ExecuteWithXmlParamsResponse> </s:Body> </s:Envelope>
Serviço responsável por executar processos com parâmetros XML de forma assíncrona, isto é, o serviço submeterá a execução do processo e devolverá um id de job que pode ser passado como parâmetro para o serviço GetProcessStatus para consultar o andamento do processo.
Os passos a serem seguidos são idênticos ao serviço ExecuteWithXmlParams, porem o retorno do método é diferente.
Os parâmetros solicitado pelo ExecuteWithXmlParamsAsync são:
ProcessServerName tipo String
strXmlParams tipo String
Para pegar o parâmetro XML é necessário executar o processo através da biblioteca.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://www.totvs.com/"> <soapenv:Header/> <soapenv:Body> <tot:ExecuteWithXmlParams> <!--Optional:--> <tot:ProcessServerName>GlbProcCopyConsSQL</tot:ProcessServerName> <!--Optional:--> <tot:strXmlParams><?xml version="1.0" encoding="utf-16"?> <GlbParamsProcCopyColig xmlns:i="http://www.w3.org/2001/XMLSchema-instance" z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" xmlns="http://www.totvs.com.br/RM/"> <CanParallelize xmlns="http://www.totvs.com/">true</CanParallelize> <Context xmlns:d2p1="http://www.totvs.com.br/RM/" z:Id="i2" xmlns="http://www.totvs.com/"> <d2p1:_params xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODUNIDADEBIB</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">1</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CHAPAFUNCIONARIO</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">00001</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$EXERCICIOFISCAL</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">2</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODFILIAL</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">1</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$RHTIPOUSR</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">01</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODCOLIGADA</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">1</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$EDUTIPOUSR</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">F</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODLOCPRT</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">5</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODUSUARIO</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">mestre</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODUSUARIOSERVICO</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string"></d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODSISTEMA</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">G</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODTIPOCURSO</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">2</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$CODIGOEXTERNO</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">-1</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> <d3p1:KeyValueOfanyTypeanyType> <d3p1:Key xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">$IDPRJ</d3p1:Key> <d3p1:Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:int">2</d3p1:Value> </d3p1:KeyValueOfanyTypeanyType> </d2p1:_params> <d2p1:Environment>DotNet</d2p1:Environment> </Context> <Initialized xmlns="http://www.totvs.com/">true</Initialized> <IsolateProcess xmlns="http://www.totvs.com/">false</IsolateProcess> <MaximumQuantityOfPrimaryKeysPerProcess xmlns="http://www.totvs.com/">1000</MaximumQuantityOfPrimaryKeysPerProcess> <MinimumQuantityOfPrimaryKeysPerProcess xmlns="http://www.totvs.com/">1</MinimumQuantityOfPrimaryKeysPerProcess> <PrimaryKeyList xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://www.totvs.com/"> <d2p1:ArrayOfanyType> <d2p1:anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:short">1</d2p1:anyType> <d2p1:anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">G</d2p1:anyType> <d2p1:anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Exemplo</d2p1:anyType> </d2p1:ArrayOfanyType> </PrimaryKeyList> <PrimaryKeyNames xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://www.totvs.com/"> <d2p1:string>CODCOLIGADA</d2p1:string> <d2p1:string>APLICACAO</d2p1:string> <d2p1:string>CODSENTENCA</d2p1:string> </PrimaryKeyNames> <QuantityOfSplits xmlns="http://www.totvs.com/">0</QuantityOfSplits> <ShouldParallelize xmlns="http://www.totvs.com/">false</ShouldParallelize> <IsReplaceExistingRecordsVisible>true</IsReplaceExistingRecordsVisible> <ReplaceExistingRecords>false</ReplaceExistingRecords> <TargetColigadas xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:int>6</d2p1:int> </TargetColigadas> </GlbParamsProcCopyColig></tot:strXmlParams> </tot:ExecuteWithXmlParams> </soapenv:Body> </soapenv:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <ExecuteWithXmlParamsAsyncResponse xmlns="http://www.totvs.com/"> <ExecuteWithXmlParamsAsyncResult><![CDATA[<?xml version="1.0" encoding="utf-16"?> <ProcessID> <JobID>104863</JobID> <ExecID>1</ExecID> </ProcessID>]]></ExecuteWithXmlParamsAsyncResult> </ExecuteWithXmlParamsAsyncResponse> </s:Body> </s:Envelope>
Serviço responsável por retornar as informações de um processo. Os parâmetros podem ser capturados pelo método ExecuteWithXmlParamsAsync.
Os parâmetros solicitado pelo ExecuteWithXmlParams são:
jobId tipo String
execId tipo String
Para pegar o parâmetro XML é necessário executar o processo através da biblioteca.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://www.totvs.com/"> <soapenv:Header/> <soapenv:Body> <tot:GetProcessStatus> <!--Optional:--> <tot:jobId>104863</tot:jobId> <!--Optional:--> <tot:execId>1</tot:execId> </tot:GetProcessStatus> </soapenv:Body> </soapenv:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <GetProcessStatusResponse xmlns="http://www.totvs.com/"> <GetProcessStatusResult><![CDATA[<?xml version="1.0" encoding="utf-16"?> <ProcessInfo> <ProcessID> <JobID>104863</JobID> <ExecID>1</ExecID> </ProcessID> <Message /> <Progress>100</Progress> <Status>Warning</Status> </ProcessInfo>]]></GetProcessStatusResult> </GetProcessStatusResponse> </s:Body> </s:Envelope>
Observação
Os outros métodos expostos foram descontinuados, e encontram-se disponíveis somente por motivo de compatibilidade.
Para maiores informações:
Canais de Atendimento
Chamado: Através do Portal TOTVS - www.suporte.totvs.com.br
Telefônico: 4003-0015 Escolhendo as opções 2-2-3-9-5 (Framework) ou 2-2-3-9-4 (BI)
Produto | Framework |
---|---|
Versão | 11.82.XX |
Processo | Web Services |
Subprocesso | Utilizando o Web Service wsProcess |
Status do Documento: | Finalizado |
---|---|
Data: | 30/06/2015 |
Versão: | 11.82.XX |
Versão Anterior: | 11.82.XX |
Autores: |
- Sem rótulos