retrieveEnvlope static method

Future<Envelope> retrieveEnvlope(
  1. String uri,
  2. XmlDocument soapRequest, {
  3. Function? postProcess,
})

Retrieve an onvif SOAP envelope

Implementation

static Future<Envelope> retrieveEnvlope(String uri, XmlDocument soapRequest,
    {Function? postProcess}) async {
  final soapResponse = await Soap.send(uri, soapRequest.toString());

  final jsonMap = OnvifUtil.xmlToMap(soapResponse);

  final envelope = Envelope.fromJson(jsonMap);

  if (postProcess != null) {
    postProcess(soapResponse, jsonMap, envelope);
  }

  return envelope;
}