1 / 12

WebObjects 5

WebObjects 5. Speaker Peter Beran peedomator@gmx.net Alexis R. Rondeau alexis@veritaspuris.com Martin Köhler m_koehler@gmx.at Teaching Staff Siegfried Benkner Gerhard Engelbrecht. WebService Framework. software producer Apple Costs USD 699 (525 EUR) Site:

zayit
Télécharger la présentation

WebObjects 5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. WebObjects 5 Speaker Peter Beran peedomator@gmx.net Alexis R. Rondeau alexis@veritaspuris.com Martin Köhler m_koehler@gmx.at Teaching Staff Siegfried Benkner Gerhard Engelbrecht

  2. WebService Framework • software producer • Apple • Costs • USD 699 (525 EUR) • Site: • http://www.apple.com/webobjects/

  3. Application Area • Database-Driven Web Applications • Web Services • JavaBeans Web Applications • Java Client Web Applications • JavaServer Pages and Servlets

  4. Features • Development • develop your client in different languages: Java, AppleScript, Perl and DotNet • 3-layer oriented architecture (user interface, business logic, data access) • database handling tool (creation, configuration, reverse-engineering, testing) • dynamically generated GUIs (HTML, SMIL, Swing - data-driven, multi-lingual) • XML Support • Deployment and Usage • faster deployment on J2EE and J2SE compatible server • scalability with clustering support

  5. Technologies • EJB • ORB (for example Java RMI-IIOP) • JTA/JTS (J2EE technologies) • JDBC and JNDI data sources • JSP and Servlet Support • JNDL • SOAP (WSDL generator and XML support, based on the AXIS Framework)

  6. Requirements • Operating System • Mac OS X Server v10 • Windows 2000 Professional SP3 • Database Server • Microsoft SQL Server 2000 • MySQL 3.23.51 • OpenBase 7.0.8 • Oracle 8.1.7 und 9.2.0.1 • Sybase ASE 12.5 • Applikation Server • Apache Tomcat 3.2.4 and 4.0.5 • BEA WenLogic 7.0 • IBM WebSphere 4.0.4 • Web Server • Sun ONE Web Server 6.0 SP2 • Apache 1.3.9 und 1.3.26 • Microsoft Internet Information Server 5.0

  7. Development Workflow in WO

  8. Code Examples – Web Service publicclass Calculator extends Object { publicstatic double add(double addend1, double addend2) { double sum = addend1 + addend2; return sum; } publicstaticdouble subtract(double minuend, double subtrahend) { double difference = minuend - subtrahend; return difference; } publicstaticdouble multiply(double multiplicand1, double multiplicand2) { double product = multiplicand1 * multiplicand2; return product; } publicstaticdouble divide(double dividend, double divisor) { double quotient = dividend / divisor; return quotient; } } Deploy this web service with: WOWebServiceRegistrar.registerWebService(Calculator.class, true);

  9. Code Example – Client (1) import com.webobjects.foundation.*; import com.webobjects.webservices.client.*; publicclass CalculatorClient extends Object { /** Object through which the Web service's operations are invoked. */ private WOWebServiceClient _serviceClient = null; /** Address for the Web service's WSDL document. */ private String _service_address = "http://localhost:4210/cgi-bin/WebObjects/Calculator.woa/ws/Calculator?wsdl"; public CalculatorClient() { super(); } /** * Obtains the Web service's operation names. * @return the Web service's operation names. */ public NSArray operations() { NSArray operations = (serviceClient().operationsDictionaryForService(serviceName())).allValues(); NSMutableArray operation_names = new NSMutableArray(); Enumeration operations_enumerator = operations.objectEnumerator(); while (operations_enumerator.hasMoreElements()) { WOClientOperation operation = (WOClientOperation)operations_enumerator.nextElement(); operation_names.addObject((String)operation.name()); } return operation_names; }

  10. Code Example – Client (2) /** Invokes the Web service's operations. * @param operation operation to invoke; * @param arguments argument list; * @return value returned by the operation. */ public Double invoke(String operation, Object[] arguments) { Object result = serviceClient().invoke(serviceName(), operation, arguments); return (Double)result; } /** Obtains the Web service name. * Normally one WSDL file describes one Web service, * but it could describe one or more services. * @return Web service name. */ public String serviceName() { return (String)serviceClient().serviceNames().objectAtIndex(0); } /** * Obtains an WOWebServiceClient through which service operations are invoked. * @return Web service-client object. */ private WOWebServiceClient serviceClient() { if (_serviceClient == null) { _serviceClient = clientFromAddress(_service_address); } return _serviceClient; }

  11. Code Example – Client (3) /** * Obtains a Web service-client object through which * service operations can be invoked. * @return Web service-client object. */ private static WOWebServiceClient clientFromAddress(String address) { WOWebServiceClient service_client = null; // Create the Web service's URL. URL url; try { url = new URL(address); } catch (MalformedURLException e) { url = null; } // Get a service-client object. service_client = new WOWebServiceClient(url); return service_client; } }

  12. Code Example – ClientApp import com.webobjects.appserver.WOContext; import org.apache.axis.MessageContext; ... MessageContext message_context = MessageContext.getCurrentContext(); WOContext context = (WOContext)message_context.getProperty("com.webobjects.appserver.WOContext");

More Related