Exemplo n.º 1
0
  private ResponseWrapper constructResponseWrapperFromResponse(Services xmlServices) {

    ResponseWrapper response = new ResponseWrapper(xmlServices.getProbeID());
    response.setResponseID(xmlServices.getResponseID());

    for (Service xmlService : xmlServices.getService()) {
      ServiceWrapper service = constructServiceWrapperFromService(xmlService);

      response.addResponse(service);
    }

    return response;
  }
Exemplo n.º 2
0
  private Services composeResponseFromResponseWrapper(ResponseWrapper response) {

    ObjectFactory of = new ObjectFactory();
    Services xmlServices = of.createServices();

    xmlServices.setProbeID(response.getProbeID());
    xmlServices.setResponseID(response.getResponseID());

    List<Service> serviceList = xmlServices.getService();

    for (ServiceWrapper service : response.getServices()) {
      Service xmlService = this.composeServiceFromServiceWrapper(service);
      serviceList.add(xmlService);
    }

    return xmlServices;
  }