/** {@inheritDoc} */
  @Override
  public Map<Integer, MarketBean> findAllMarkets() throws NotFoundException, TechnicalException {
    log.info("Executing operation findAllMarkets");

    Map<Integer, MarketBean> mapOfMarket = new HashMap<Integer, MarketBean>();

    try {

      List<MarcheSoap> listOfMarcheSoap = gererMarcheSoapProxy.rechercherMarches();
      for (MarcheSoap bean : listOfMarcheSoap) {
        mapOfMarket.put(bean.getId(), mapperSoap.map(bean, MarketBean.class));
      }

    } catch (ErreurTechniqueFault e) {
      // maps to TechnicalException
      throw mapperSoap.map(e);
    } catch (ErreurMarcheNonTrouveFault e) {
      // map to NotFoundException
      throw mapperSoap.map(e);
    } catch (WebServiceException e) {
      log.info("a timeout exception has occured: ");
      throw new TechnicalException(e.getMessage(), e.getCause());
    }

    return mapOfMarket;
  }
  /** {@inheritDoc} */
  @Override
  public List<MarketBean> findMarketByName(String name)
      throws NotFoundException, TechnicalException {
    log.info("Executing operation findMarketByName : " + name);

    List<MarketBean> listOfMarkets = new ArrayList<MarketBean>();

    try {

      List<MarcheSoap> listOfMarcheSoap = gererMarcheSoapProxy.rechercherMarchesParNom(name);
      for (MarcheSoap bean : listOfMarcheSoap) {
        listOfMarkets.add(mapperSoap.map(bean, MarketBean.class));
      }

    } catch (ErreurTechniqueFault e) {
      // maps to TechnicalException
      throw mapperSoap.map(e);
    } catch (ErreurMarcheNonTrouveFault e) {
      // map to NotFoundException
      throw mapperSoap.map(e);
    } catch (WebServiceException e) {
      log.info("a timeout exception has occured: ");
      throw new TechnicalException(e.getMessage(), e.getCause());
    }

    return listOfMarkets;
  }
  /** {@inheritDoc} */
  @Override
  public void deleteMarket(int id) throws InvalidMarketException, TechnicalException {
    log.info("Executing operation deleteMarket");

    try {

      gererMarcheSoapProxy.supprimerMarche(id);

    } catch (ErreurTechniqueFault e) {
      // maps to TechnicalException
      throw mapperSoap.map(e);
    } catch (ErreurMarcheInvalideFault e) {
      // map to InvalidMarketException
      throw mapperSoap.map(e);
    } catch (WebServiceException e) {
      log.info("a timeout exception has occured: ");
      throw new TechnicalException(e.getMessage(), e.getCause());
    }
  }
  /** {@inheritDoc} */
  @Override
  public void createMarket(MarketBean market) throws InvalidMarketException, TechnicalException {
    log.info("Executing operation createMarket");

    try {

      MarcheSoap marcheSoap = (MarcheSoap) mapperSoap.map(market, MarcheSoap.class);
      gererMarcheSoapProxy.creerMarche(marcheSoap);

    } catch (ErreurTechniqueFault e) {
      // maps to TechnicalException
      throw mapperSoap.map(e);
    } catch (ErreurMarcheInvalideFault e) {
      // map to InvalidMarketException
      throw mapperSoap.map(e);
    } catch (WebServiceException e) {
      log.info("a timeout exception has occured: ");
      throw new TechnicalException(e.getMessage(), e.getCause());
    }
  }
  /** {@inheritDoc} */
  @Override
  public MarketBean consultMarket(int idMarket) throws NotFoundException, TechnicalException {
    log.info("Executing operation consultMarket");

    MarketBean marketBean = null;

    try {

      MarcheSoap marcheSoap = gererMarcheSoapProxy.consulterMarche(idMarket);
      marketBean = (MarketBean) mapperSoap.map(marcheSoap, MarketBean.class);

    } catch (ErreurTechniqueFault e) {
      // maps to TechnicalException
      throw mapperSoap.map(e);
    } catch (ErreurMarcheNonTrouveFault e) {
      // map to NotFoundException
      throw mapperSoap.map(e);
    } catch (WebServiceException e) {
      log.info("a timeout exception has occured: ");
      throw new TechnicalException(e.getMessage(), e.getCause());
    }

    return marketBean;
  }