- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
birt barcode WEB SERVICES AND JINI in Font
CHAPTER 28 WEB SERVICES AND JINI Making Data Matrix In None Using Barcode drawer for Font Control to generate, create Data Matrix image in Font applications. www.OnBarcode.comEAN13 Printer In None Using Barcode generator for Font Control to generate, create EAN-13 image in Font applications. www.OnBarcode.comSystem.out.println("Type of file 'file.txt' is " + ret); } catch (Exception e) { System.err.println(e.toString()); } } } There are other ways of achieving the same result, but this is good enough for the rest of this chapter, which is intended to show how Jini and Web Services can interoperate rather than delve into the arcanities of Web Services. Make Barcode In None Using Barcode printer for Font Control to generate, create Barcode image in Font applications. www.OnBarcode.comPDF417 Drawer In None Using Barcode encoder for Font Control to generate, create PDF417 image in Font applications. www.OnBarcode.comBridging Between a Jini Client and Web Service, Example 1
UPC-A Generator In None Using Barcode encoder for Font Control to generate, create Universal Product Code version A image in Font applications. www.OnBarcode.comQR Code Creator In None Using Barcode generation for Font Control to generate, create QR Code image in Font applications. www.OnBarcode.comA bridge that acts as a Jini service implementing the common.FileClassifier specification used throughout this book, and also as a client to the previous file classification Web Service, can be written by essentially including the Web Service client code from earlier into the implementation of the Jini service methods. The bridge is a normal Jini server advertising the following Jini service implementation: package ws; import common.MIMEType; import common.FileClassifier; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import javax.xml.namespace.QName; /** * FileClassifierImpl.java */ public class FileClassifierImpl implements RemoteFileClassifier { public MIMEType getMIMEType(String fileName) throws java.rmi.RemoteException { try { String endpoint = "http://localhost:8080/axis/FileClassifierService.jws"; Service Call service = new Service(); call = (Call) service.createCall(); Code 39 Creation In None Using Barcode creator for Font Control to generate, create Code 39 image in Font applications. www.OnBarcode.comUSD-4 Maker In None Using Barcode generation for Font Control to generate, create Ames code image in Font applications. www.OnBarcode.comcall.setTargetEndpointAddress( new java.net.URL(endpoint) ); call.setOperationName(new QName("http://soapinterop.org/", "getMIMEType")); String ret = (String) call.invoke( new Object[] { fileName } ); return new MIMEType(ret); } catch (Exception e) { Create ECC200 In Visual Basic .NET Using Barcode encoder for Visual Studio .NET Control to generate, create Data Matrix ECC200 image in Visual Studio .NET applications. www.OnBarcode.comECC200 Maker In .NET Using Barcode generator for Visual Studio .NET Control to generate, create Data Matrix 2d barcode image in .NET framework applications. www.OnBarcode.comCHAPTER 28 WEB SERVICES AND JINI
Encoding Data Matrix In None Using Barcode drawer for Word Control to generate, create Data Matrix 2d barcode image in Word applications. www.OnBarcode.comUPCA Creator In .NET Using Barcode printer for Reporting Service Control to generate, create UCC - 12 image in Reporting Service applications. www.OnBarcode.comthrow new RemoteException("SOAP failure", e); } } public FileClassifierImpl() throws java.rmi.RemoteException { // empty constructor required by RMI } } // FileClassifierImpl This service can export a Jeri or RMI proxy to a Jini client as we have seen before. Client calls on the proxy are sent to this service, which acts as a Web Service client using the model of Figure 28-2. When this implementation is built and run, it will need the Axis libraries on the Jini service side. Draw Quick Response Code In None Using Barcode maker for Microsoft Excel Control to generate, create QR Code image in Microsoft Excel applications. www.OnBarcode.comCode 3/9 Encoder In VB.NET Using Barcode printer for .NET Control to generate, create Code 39 Full ASCII image in Visual Studio .NET applications. www.OnBarcode.comBridging Between a Jini Client and Web Service, Example 2
Drawing Code128 In None Using Barcode creator for Microsoft Word Control to generate, create Code128 image in Microsoft Word applications. www.OnBarcode.comMaking GS1 128 In Java Using Barcode creator for Java Control to generate, create EAN / UCC - 14 image in Java applications. www.OnBarcode.comA service can be written that follows the second pattern in Figure 28-3, simply by changing the inheritance from RemoteFileClassifier to FileClassifier and Serializable. A client then gets a copy of this service and all calls are made locally in the client. package ws; import common.MIMEType; import common.FileClassifier; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import javax.xml.namespace.QName; /** * FileClassifierImpl.java */ public class FileClassifierSerializableImpl implements FileClassifier, java.io.Serializable { public MIMEType getMIMEType(String fileName) throws java.rmi.RemoteException { try { String endpoint = "http://localhost:8080/axis/FileClassifierService.jws"; Service Call service = new Service(); call = (Call) service.createCall(); Recognize DataMatrix In Visual Studio .NET Using Barcode recognizer for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications. www.OnBarcode.comScan Code 128A In None Using Barcode decoder for Software Control to read, scan read, scan image in Software applications. www.OnBarcode.comcall.setTargetEndpointAddress( new java.net.URL(endpoint) ); call.setOperationName(new QName("http://soapinterop.org/", "getMIMEType")); Data Matrix 2d Barcode Creation In Objective-C Using Barcode creation for iPad Control to generate, create ECC200 image in iPad applications. www.OnBarcode.comCode 128A Drawer In Visual Studio .NET Using Barcode encoder for Reporting Service Control to generate, create ANSI/AIM Code 128 image in Reporting Service applications. www.OnBarcode.comCHAPTER 28 WEB SERVICES AND JINI
String ret = (String) call.invoke( new Object[] { fileName } ); return new MIMEType(ret); } catch (Exception e) { throw new RemoteException(e); } } public FileClassifierImpl() throws java.rmi.RemoteException { // empty constructor required by RMI } } // FileClassifierImpl This has major implications for the classes downloaded to the client! In order to run this service on the client side, it needs access to the class files for the Axis classes Call, Service, and QName. The client cannot be expected to have these, since it doesn t need to know any details of the implementation. So the Axis libraries have to be placed on an HTTP server and listed in the Jini server s codebase. The libraries are over 1MB in size, so needing to send these across the network can result in a substantial download to the Jini client. Bridging Between a Web Service Client and Jini Service
Forming a bridge between Web Service clients and Jini services follows the same general structure, as shown in Figure 28-4. Figure 28-4. Bridge between a Web Service client and a Jini service In this case, we put the Jini client code into the Web Service implementation. There are a couple of wrinkles in getting this to work properly with Apache Axis and the Tomcat server: Jini class files Security policy The Jini class files are not in the classpath for Tomcat. However, Tomcat and Apache allow any extra .jar files required by a Web Service to be placed in special lib directories under the
|
|