How to consume an asmx web service from Business Central

isabtogumonisabtogumon Member Posts: 49
edited 2020-12-29 in NAV Three Tier
I have no idea how to do it since I have not worked with SOAP before. I have read some docs and have seen that I have to create both a page and a table (I already have that), but I have not found a way to communicate with the server and extract the data. Can someone explain in detail what I should do?

The information I have is the following:

POST /Interface.asmx HTTP/1.1
Host: uh.***.com.br
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.***.com.br/***/GetMovimentacao"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
<soap:Body>
<GetMovimentacao xmlns="http://www.***.com.br/***"&gt;
<Credencial>
<UserName>string</UserName>
<Password>string</Password>
<SecurePassword />
<Domain>string</Domain>
</Credencial>
</GetMovimentacao>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
<soap:Body>
<GetMovimentacaoResponse xmlns="http://www.***.com.br/***"&gt;
<GetMovimentacaoResult>
<Codigo>int</Codigo>
<Mensagem>string</Mensagem>
<Data>dateTime</Data>
<List>
<Movimentacao>
<Codigo>string</Codigo>
<TipoMovimentacao>string</TipoMovimentacao>
<DataMovimentacao>dateTime</DataMovimentacao>
<EmpresaOrigem xsi:nil="true" />
<CentroCustoOrigem xsi:nil="true" />
<EmpresaDestino xsi:nil="true" />
<CentroCustoDestino xsi:nil="true" />
<TipoDocumento>SemDocumento or Prescricao or Requisicao or DocumentoEntrada or DocumentoSaida</TipoDocumento>
<CodigoDocumento>string</CodigoDocumento>
<Matricula>string</Matricula>
<Prontuario>string</Prontuario>
<Produto xsi:nil="true" />
<CodigoProdutoSecundario>string</CodigoProdutoSecundario>
<Quantidade>int</Quantidade>
<Valor>decimal</Valor>
<Cubagem xsi:nil="true" />
<Lote>string</Lote>
<Validade>dateTime</Validade>
<CodigoItemDocumento>string</CodigoItemDocumento>
<Usuario>string</Usuario>
<CodigoEtiqueta>string</CodigoEtiqueta>
<Identificador>string</Identificador>
</Movimentacao>
<Movimentacao>
<Codigo>string</Codigo>
<TipoMovimentacao>string</TipoMovimentacao>
<DataMovimentacao>dateTime</DataMovimentacao>
<EmpresaOrigem xsi:nil="true" />
<CentroCustoOrigem xsi:nil="true" />
<EmpresaDestino xsi:nil="true" />
<CentroCustoDestino xsi:nil="true" />
<TipoDocumento>SemDocumento or Prescricao or Requisicao or DocumentoEntrada or DocumentoSaida</TipoDocumento>
<CodigoDocumento>string</CodigoDocumento>
<Matricula>string</Matricula>
<Prontuario>string</Prontuario>
<Produto xsi:nil="true" />
<CodigoProdutoSecundario>string</CodigoProdutoSecundario>
<Quantidade>int</Quantidade>
<Valor>decimal</Valor>
<Cubagem xsi:nil="true" />
<Lote>string</Lote>
<Validade>dateTime</Validade>
<CodigoItemDocumento>string</CodigoItemDocumento>
<Usuario>string</Usuario>
<CodigoEtiqueta>string</CodigoEtiqueta>
<Identificador>string</Identificador>
</Movimentacao>
</List>
<ErrorDetails>
<string>string</string>
<string>string</string>
</ErrorDetails>
<TempoDecorrido>string</TempoDecorrido>
</GetMovimentacaoResult>
</GetMovimentacaoResponse>
</soap:Body>
</soap:Envelope>

Answers

  • JJMcJJMc Member Posts: 60
    Good morning.
    Yes you can.

    As far as I can read, I think you're from Spain.
    What you want is very similiar the way BC does with SII.
    You can see how they do it in objects with the tag *SII*

    Happy new year
Sign In or Register to comment.