O método ConsultarVendedorPorId retorna os dados de um vendedor cadastrado no C&S Gestor conforme o ID do vendedor e a empresa informados.
⚙️ Importante: A requisição é do tipo POST.
POST /wsces/ConsultarVendedorPorId
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ConsultarVendedorPorId xmlns="http://www.cessistemas.com.br/wsces">
<xml><![CDATA[
<ConsultaVendedorIdReq xmlns="http://www.cessistemas.com.br/wsces">
<empresaId>10.654.646/0001-46</empresaId>
<vendedorId>1</vendedorId>
</ConsultaVendedorIdReq>
]]></xml>
</ConsultarVendedorPorId>
</soap:Body>
</soap:Envelope>
using System.Text;
using var client = new HttpClient();
var soapEnvelope = """
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ConsultarVendedorPorId xmlns="http://www.cessistemas.com.br/wsces">
<xml><![CDATA[
<ConsultaVendedorIdReq xmlns="http://www.cessistemas.com.br/wsces">
<empresaId>10.654.646/0001-46</empresaId>
<vendedorId>1</vendedorId>
</ConsultaVendedorIdReq>
]]></xml>
</ConsultarVendedorPorId>
</soap:Body>
</soap:Envelope>
""";
var content = new StringContent(
soapEnvelope,
Encoding.UTF8,
"text/xml"
);
content.Headers.Add(
"SOAPAction",
"\"http://www.cessistemas.com.br/wsces/ConsultarVendedorPorId\""
);
var response = await client.PostAsync(
"https://api.cessistemas.com.br/wsces/servicos.asmx",
content
);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);