The Testing Stage


The Deployment Stage

By the time you reach the deployment stage, you should have an understanding of how reliable your code is, the number of requests that you can handle per second, and whether your hardware can support that demand. Usually, in the deployment stage, your customers start to give you their last-minute security demands, and you need to rush to implement them.

In this case, because the data isn’t too personal, it doesn’t need to be encrypted. However, you do still want to control who accesses the service. Sometimes it’s difficult for people to find Web Services without something like UDDI available; but sometimes people do trip across your service and can access it simply by finding the WSDL. This is where a unique ID can help.

In the following code example there is a private method called checkID. This simple method contains a comparison between some string values that are assigned IDs. Then each method needs to have an ID parameter passed in to call the checkID static method. It was created as static so you would need to instantiate the MoneyExchangeProtected class just to call the checkID method. This way you can call it directly. If the proper ID is not passed, then either a numeric value indicates that the ID was incorrect or a text message is returned.

    public class MoneyExchangeProtected {       public double returnUSDollarEquiv      (String ID, String countryName, float quantity) {       double totalValue = 0;      int idStatus =           MoneyExchangeProtected.checkID(ID);      if (idStatus == 0) {         return -1;      }      //currency values as of 10/5/02      if (countryName.equals("Argentina")) {          totalValue = .2663 * quantity;      } else if (countryName.equals("Australia")) {          totalValue = .54 * quantity;      } else if (countryName.equals("China")) {       totalValue = .128 * quantity;      } else if (countryName.equals("Japan")) {       totalValue = .0081 * quantity;      } else if (countryName.equals("Mexico")) {       totalValue = .0988 * quantity;      } else if (countryName.equals("Swiss")) {       totalValue = .675 * quantity;      } else if (countryName.equals("UK")) {       totalValue = 1.568 * quantity;      } else {          totalValue = -1;      }      return totalValue;     }    public double returnForeignEquiv      (String ID, String countryName, float quantity) {      double totalValue = 0;      String name = null;      if (countryName.equals("Argentina")) {         name = "Peso";      } else if (countryName.equals("Australia")) {         name = "Dollar";      } else if (countryName.equals("China")) {         name = "Renminbi";      } else if (countryName.equals("Japan")) {         name = "Yen";      } else if (countryName.equals("Mexico")) {         name = "Peso";      } else if (countryName.equals("Swiss")) {         name = "Franc";      } else if (countryName.equals("UK")) {         name = "Pound";      } else {          name = "No match";      }      return name;    }    private static int checkID (String id) {      int checkOK = 0;      //ideally this calls a rdbms      if (id.equals("bx113me") || id.equals("lx114me")) {        checkOK = 1;      }      return checkOK;    } }

This obviously isn’t the only deployment issue, but by the time you reach this stage you should have gathered all your requirements, done preliminary testing, and completed more extensive testing including consumers and server strain. At this point, deployment should just be a matter of moving the files to the desired server and creating the appropriate security scheme.




Cross-Platform Web Services Using C# and Java
Cross-Platform Web Services Using C# & JAVA (Charles River Media Internet & Web Design)
ISBN: 1584502622
EAN: 2147483647
Year: 2005
Pages: 128

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net