/**
   * Web service operation to update a spy in spy list.
   *
   * @param name name of spy to be updated
   * @param title title of spy to be updated
   * @param location location of spy to be updated
   * @param password password of spy to be updated
   * @return result of updating
   */
  @WebMethod(operationName = "updateSpy")
  public String updateSpy(
      @WebParam(name = "name") String name,
      @WebParam(name = "title") String title,
      @WebParam(name = "location") String location,
      @WebParam(name = "password") String password) {
    if (spyList.get(name) == null) {
      return "Spy doesn't exist. No update made.";
    }

    Spy spy = new Spy(name, title, location, password);
    spyList.add(spy);
    return spy.toString();
  }
 /**
  * Web service operation to add spy to the spy list.
  *
  * @param name name of spy to be added
  * @param title title of spy to be added
  * @param location location of spy to be added
  * @param password password of spy to be added
  * @return result of adding
  */
 @WebMethod(operationName = "addSpy")
 public String addSpy(
     @WebParam(name = "name") String name,
     @WebParam(name = "title") String title,
     @WebParam(name = "location") String location,
     @WebParam(name = "password") String password) {
   // TODO write your implementation code here:
   if (spyList.get(name) != null) {
     return "Spy already exists. No update made.";
   }
   Spy spy = new Spy(name, title, location, password);
   spyList.add(spy);
   return spy.toString();
 }