README.txt examples11/ 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61:

README Computer Science E-259

OVERVIEW In these directories are two client-server pairs, one that demonstrates Project 4’s warehouse and one that demonstrates a tax service. Each’s usage is documented below.

TAXES To access TaxService.jws as a web service, simply do the following. 1.

Spawn Tomcat from within examples11/server/, after specifying in examples11/server/conf/server.xml the ports desired.

2.

Execute the following command (which, unfortunately, wraps onto a second line) from within examples11/clients/taxes/. java org.apache.axis.wsdl.WSDL2Java "http://$ICEBOX.fas.harvard.edu:n/taxes/TaxService.jws?wsdl"

3.

Edit the first line of examples11/clients/taxes/TaxClient.java so that the appropriately named package is imported. The first line of that file, at present, is import edu.harvard.fas.ice1.taxes.TaxService_jws.*; because we whipped up this demo on ice1.fas.harvard.edu.

4.

Execute the following commands from within examples11/clients/taxes/. javac TaxClient.java java TaxClient You should see the result of the service’s performing the various calculations specified in TaxClient.java.

WAREHOUSE To access Project 4’s warehouse as a web service, simply do the following. 1.

Spawn Tomcat from within examples11/server/, after specifying in examples11/server/conf/server.xml the ports desired.

2.

In another terminal, execute the following command (which, unfortunately, wraps onto a second line) from within examples11/clients/warehouse/. java org.apache.axis.wsdl.WSDL2Java

1/2

README.txt examples11/ 62: 63: 64: 3. 65: 66: 67: 68: 69: 70: 71: 72: 73: 4. 74: 75: 76: 77: 78: 79: 80: 81:

"http://$ICEBOX.fas.harvard.edu:n/warehouse/services/Purchasing?wsdl" Edit the first line of examples11/clients/warehouse/PurchasingClient.java so that the appropriately named package is imported. The first line of that file, at present, is import edu.harvard.fas.ice1.warehouse.services.Purchasing.*; because we whipped up this demo on ice1.fas.harvard.edu. Execute the following commands from within examples11/clients/warehouse/. javac PurchasingClient.java java PurchasingClient You should see the result of the service’s application of po-ack.xsl to the empty element passed to the service by PurchasingClient.

2/2

TaxClient.java

1/1

examples11/clients/taxes/ 1: import edu.harvard.fas.ice1.taxes.TaxService_jws.*; 2: import org.apache.axis.AxisFault; 3: 4: 5: /** 6: * Lecture 11’s demo of a client that accesses a web service 7: * that performs various tax calculations. 8: * 9: * Excerpted from 10: * http://www.ammai.com/modules.php?op=modload&name=Sections&file=index&req=viewarticle &artid=4&page=5 11: * 12: * @author Ammai.com 13: * @author Computer Science E-259 14: **/ 15: 16: public class TaxClient 17: { 18: /** 19: * Main driver. 20: */ 21: public static void main(String[] args) 22: { 23: try 24: { 25: // Make a service 26: TaxServiceService service = new TaxServiceServiceLocator(); 27: TaxService port = service.getTaxService(); 28: 29: // Make the actual calls to the three methods 30: double taxpercent = port.calcTaxRate(21.00, 23.10); 31: double total = port.calcTotal(21.00, 0.10); 32: double subtotal = port.calcSubTotal(23.10, 0.10); 33: 34: // Output the results 35: System.out.println( 36: "Subtotal: 21.00, Total: 23.10, Tax: " + taxpercent 37: ); 38: System.out.println( 39: "Subtotal: 21.00, Tax: 0.10, Total: " + total 40: ); 41: System.out.println( 42: "Total: 23.10, Tax: 0.10, Subtotal: " + subtotal 43: ); 44: } 45: catch (AxisFault af) 46: { 47: System.err.println("An Axis Fault occurred: " + af); 48: } 49: catch (Exception e) 50: { 51: System.err.println("Exception caught: " + e); 52: } 53: } 54: }

PurchasingClient.java examples11/clients/warehouse/ 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39:

import edu.harvard.fas.ice1.warehouse.services.Purchasing.*; import org.apache.axis.AxisFault;

/** * Lecture 11’s demo of a client that accesses Project 4’s * warehouse. * * @author Computer Science E-259 **/ public class PurchasingClient { /** * Main driver. */ public static void main(String [] argv) { // attempt to connect to warehouse try { PurchasingService service = new PurchasingServiceLocator(); Purchasing port = service.getPurchasing(); // eh, we’ve got nothing to say tonight System.out.println(port.processPO("")); } catch (AxisFault af) { System.err.println("An Axis Fault occurred: " + af); System.err.println(); System.err.println(af.dumpToString()); } catch (Exception e) { System.err.println("Exception caught: " + e); } } }

1/1

TaxService.jws

1/1

examples11/server/webapps/taxes/ 1: /** 2: * Lecture 11’s demo of a web service that performs 3: * various tax calculations. 4: * 5: * Excerpted from 6: * http://www.ammai.com/modules.php?op=modload&name=Sections&file=index&req=viewarticle &artid=4&page=4. 7: * 8: * @author Ammai.com 9: * @author Computer Science E-259 10: **/ 11: 12: public class TaxService 13: { 14: /** 15: * Determines tax rate based on given subtotal and total. 16: */ 17: public double calcTaxRate(double subtotal, double total) 18: { 19: double rate = (total - subtotal) / subtotal; 20: return rate; 21: } 22: 23: 24: /** 25: * Determines pre-tax subtotal based on given total and 26: * tax rate. 27: */ 28: public double calcSubTotal(double total, double taxpercent) 29: { 30: double subtotal = total / (1 + taxpercent); 31: return subtotal; 32: } 33: 34: 35: /** 36: * Determines total based on given subtotal and 37: * tax rate. 38: */ 39: public double calcTotal(double subtotal, double taxpercent) 40: { 41: double total = subtotal * (1 + taxpercent); 42: return total; 43: } 44: }

README.txt 1/2 - Fas Harvard

3: Computer Science E-259. 4: 5: 6: OVERVIEW. 7: 8: In these directories are ... 13: * @author Computer Science E-259. 14: **/. 15: 16: public class TaxClient.

7KB Sizes 1 Downloads 224 Views

Recommend Documents

anchor.svg 1/1 - Fas Harvard
anchor.svg. 1/1 examples6/svg/. 1: 2:

foo.xml 1/1 - Fas Harvard
15: * characters are displayed as "\n", "\t", and "\r". 16: * explicitly, and line numbers are reported in errors. 17: *. 18: * @author Computer Science E-259. 19: **/.

books.xml 1/1 - Fas Harvard
2: . 3: DOCTYPE emails SYSTEM "emails.dtd">. 4: . 5:

DiagServer.java 1/2 - Fas Harvard
DiagServer.java. 2/2 examples7/. 46: byteCount++;. 47: System.out.write(b); ... 2:

XML Schema (Second Edition) - Fas Harvard
After the release of XML 1.0, DTDs were soon recognized as insufficient. ▫ Work towards new schema standards began in early 1998. ▫ Different companies all ...

AttributeConverter1.xsl 1/2 - Fas Harvard
2/2 examples5/. 46: . 47: .... 2/2 examples5/. 44: 45: . 46: 47: . 48:  ...

Computer Science E-259 - Fas Harvard
“SVG is a language for describing two-dimensional graphics in XML. SVG allows ... Adapted from http://www.adobe.com/svg/basics/getstarted2.html. Viewable at ...

Computer Science E-259 - Fas Harvard
Computer Science E-259. XML with Java, Java ... Computer. Laptop. PDA. Web Server. JSP/servlet. JSP/servlet. EJB Server. EJB. EJB. DB. XML? ... Page 10 ...

Computer Science E-259 - Fas Harvard
Apr 13, 2005 - 1. Copyright © 2007, David J. Malan . All Rights Reserved. Computer Science E-259. XML with Java. Lecture 11:.

XML Schema (Second Edition) - Fas Harvard
Establish a contract with trading partners. ▫ Documentation. ▫ Augmentation of instance with default values. ▫ Storage of application information ...

Computer Science E-259 - Fas Harvard
Cut through the hype and get to the value. ▫ Focus on. ▫ practicality: what you need to know to do real work. ▫ applications: what are the tools and technologies.

Computer Science E-259 - Fas Harvard
Computer Science E-259. XML with Java. Lecture 5: XPath 1.0 (and 2.0) and XSLT ... All Rights Reserved. Computer Science E-259. Last Time. ▫ CSS Level 2.

Computer Science E-259 - Fas Harvard
Page 2 .... . . .... unidirectional hyperlinks of today's HTML, as well as.

XPath 1.0 (and 2.0) - Fas Harvard
Computer Science E-259. This Time. ▫ CSS Level 2. ▫ XPath 1.0 (and 2.0). ▫ XSLT 1.0 (and 2.0). ▫ TrAX. ▫ Project 2 .... Displaying XML data on the Web as HTML.

Computer Science E-259 - Fas Harvard
All Rights Reserved. Computer Science E-259. XML with Java. Lecture 2: XML 1.1 and SAX 2.0.2. 24 September 2007. David J. Malan [email protected] ...

Horario FAS Docente.pdf
TALLER DE LENGUA. Y COMUNICACIÓN I. Código 0103011. Agustín Prado. SEMINARIO DE. PENSAMIENTO LÓGICO. MATEMÁTICO. Código 0207010.

Horario FAS Docente.pdf
Rosa Chavarría. DISEÑO DE. VESTUARIO. Código 0306051. Aurora Ayala. METODOLOGÍA DE. LA DANZA III. Código 0308053. Manuel Stagnaro. KINESIOLOGÍA II. Código 0317052. Moises Del Castillo. PSICOLOGÍA. GENERAL. Código 0201050. Doris Ramírez. HOR

2017 FAS Paper Form.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. 2017 FAS Paper ...

ESTATUTO FAS 2013.pdf
Page 1 of 8. Page 1 of 8. Page 2 of 8. Page 2 of 8. Page 3 of 8. Page 3 of 8. ESTATUTO FAS 2013.pdf. ESTATUTO FAS 2013.pdf. Open. Extract. Open with.

Ciclo preparación FAS-extenso.pdf
Whoops! There was a problem loading more pages. Retrying... Ciclo preparación FAS-extenso.pdf. Ciclo preparación FAS-extenso.pdf. Open. Extract. Open with.

Fas-induced Pulmonary Apoptosis and Inflammation ...
respiratory distress syndrome (ARDS)/ALI affects about 7% of all intensive ...... system mediates epithelial injury, but not pulmonary host defenses, in response to ...