Commit 90623f7a authored by YannGarcia's avatar YannGarcia
Browse files

Enhance LoST & Held codecs to support format such as <f... or <ns1:f... or <f...>

parent 2a2e510b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -111,19 +111,19 @@ int held_codec::decode (const OCTETSTRING& p_data, LibItsHttp__XmlMessageBodyTyp
    }
  }
  
  if (it->second.find("locationRequest>") != std::string::npos) {
  if ((it->second.find("<locationRequest") != std::string::npos) || (it->second.find(":locationRequest") != std::string::npos)) {
    urn__ietf__params__xml__ns__geopriv__held::LocationRequestType location_request;
    location_request.decode(urn__ietf__params__xml__ns__geopriv__held::LocationRequest_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.locationRequest() = location_request;
  } else if (it->second.find("locationResponse>") != std::string::npos) {
  } else if ((it->second.find("<locationResponse") != std::string::npos) || (it->second.find(":locationResponse") != std::string::npos)) {
    urn__ietf__params__xml__ns__geopriv__held::LocationResponseType location_response;
    location_response.decode(urn__ietf__params__xml__ns__geopriv__held::LocationResponse_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.locationResponse() = location_response;
  } else if (it->second.find("presence>") != std::string::npos) {
  } else if ((it->second.find("<presence") != std::string::npos) || (it->second.find(":presence") != std::string::npos)) {
    urn__ietf__params__xml__ns__pidf::Presence presence;
    presence.decode(urn__ietf__params__xml__ns__pidf::Presence_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.presence() = presence;
  } else if (it->second.find("error>") != std::string::npos) {
  } else if ((it->second.find("<error") != std::string::npos) || (it->second.find(":error") != std::string::npos)) {
    urn__ietf__params__xml__ns__geopriv__held::Error error;
    error.decode(urn__ietf__params__xml__ns__geopriv__held::Error_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.errorType() = error;
+6 −6
Original line number Diff line number Diff line
@@ -94,31 +94,31 @@ int lost_codec::decode (const OCTETSTRING& p_data, LibItsHttp__XmlMessageBodyTyp
  TTCN_EncDec::clear_error();
  TTCN_Buffer decoding_buffer(p_data);
  
  if (it->second.find("findServiceResponse>") != std::string::npos) {
  if ((it->second.find("<findServiceResponse") != std::string::npos) || (it->second.find(":findServiceResponse") != std::string::npos)) {
    loggers::get_instance().warning("lost_codec::decode: Process FindServiceResponse");
    urn__ietf__params__xml__ns__lost1::FindServiceResponse find_service_response;
    find_service_response.decode(urn__ietf__params__xml__ns__lost1::FindServiceResponse_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.findServiceResponse() = find_service_response;
  } else if (it->second.find("listServicesResponse>") != std::string::npos) {
  } else if ((it->second.find("<listServicesResponse") != std::string::npos) || (it->second.find(":listServicesResponse") != std::string::npos)) {
    loggers::get_instance().warning("lost_codec::decode: Process ListServicesResponse");
    urn__ietf__params__xml__ns__lost1::ListServicesResponse list_services_response;
    list_services_response.decode(urn__ietf__params__xml__ns__lost1::ListServicesResponse_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.listServicesResponse() = list_services_response;
  } else if (it->second.find("listServicesByLocationResponse>") != std::string::npos) {
  } else if ((it->second.find("<listServicesByLocationResponse") != std::string::npos) || (it->second.find(":listServicesByLocationResponse") != std::string::npos)) {
    loggers::get_instance().warning("lost_codec::decode: Process ListServicesByLocationResponse");
    urn__ietf__params__xml__ns__lost1::ListServicesByLocationResponse list_services_by_location_response;
    list_services_by_location_response.decode(urn__ietf__params__xml__ns__lost1::ListServicesByLocationResponse_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.listServicesByLocationResponse() = list_services_by_location_response;
} else if (it->second.find("redirect>") != std::string::npos) {
} else if ((it->second.find("<redirect") != std::string::npos) || (it->second.find(":redirect") != std::string::npos)) {
    loggers::get_instance().warning("lost_codec::decode: Process Redirect");
    urn__ietf__params__xml__ns__lost1::Redirect redirect;
    redirect.decode(urn__ietf__params__xml__ns__lost1::Redirect_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.redirect() = redirect;    
 } else if (it->second.find("findService>") != std::string::npos) {
 } else if ((it->second.find("<findService") != std::string::npos) || (it->second.find(":findService") != std::string::npos)) {
    urn__ietf__params__xml__ns__lost1::FindService find_service;
    find_service.decode(urn__ietf__params__xml__ns__lost1::FindService_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.findServiceRequest() = find_service;
  } else if (it->second.find("<error") != std::string::npos) {
  } else if ((it->second.find("<error") != std::string::npos) || (it->second.find(":error") != std::string::npos)) {
    urn__ietf__params__xml__ns__lost1::ExceptionContainer exception;
    exception.decode(urn__ietf__params__xml__ns__lost1::Errors_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.exceptionContainer() = exception;