Creating File Access Services Presented by Ashraf Memon Presented by Ashraf Memon.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 4 Writing Java Applications, Java Development Tools.
Advertisements

Cognos Web Services Business Intelligence. SOA SOA (Service Oriented Architecture) The SOA approach involves seven key principles: -- Coarse -grained.
Web Toolkit Julie George & Ronald Lopez 1. Requirements  Java SDK version 1.5 or later  Apache Ant is also necessary to run command line arguments 
A1.1 Assignment 1 “Deploying a Simple Web Service” ITCS 4010/5010 Grid Computing, UNC-Charlotte B. Wilkinson, 2005.
Barry Wilkinson and Mark Holliday, 2004A1.1 Assignments Preliminaries Several computers are configured at WCU for the assignments. Here, terra.cs.wcu.edu.
A1.1 Assignment 1 “Deploying a Simple Web Service”
ANT: Another Nice Tool Ali Beyad October 1, 2003.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
1 Automated Dynamic Invocation System for Web Service with a User-defined Data Type EOOWS June 200 4 Takashi KOSHIDA Matsue National College of.
Assignment 2 Modifying, Compiling, and Deploying a Simple Service Presenter Information goes Here.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
1 Introduction to Java and Applet. 2 Download Java Compiler (1)
Java Programming Working with TextPad. Using TextPad to Work with Java This text editor is designed for working with Java You can download a trial version.
Assignment 1 “Deploying a Simple Web Service” Mark Holliday Department of Mathematics and Computer Science Western Carolina University.
String Tokenization What is String Tokenization?
Winter 2005Jason Prideaux1 Apache ANT A platform independent build tool for Java programs.
Distributed Web Software  Presentation-based, e.g., dynamic web pages  Service-based – Web Services.
1 StringTokenizer and StringBuffer classes Overview l StringTokenizer class l Some StringTokenizer methods l StringTokenizer examples l StringBuffer class.
Tomcat Configuration A Very, Very, Very Brief Overview.
Distributed Web Software Presentation-based, e.g., dynamic web pages Service-based – Web Services.
Intro to Apache Axis Siva Jagadeesan
COMPILING JAVA PROGRAM USING JDK COMMAND LINE WINDOWS PLATFORM.
Chapter 13 XML Concept of XML Simple Example of XML XML vs. HTML in Syntax XML Structure DTD and CDATA Sections Concept of SAX Processing Download and.
Web Services CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
SERVLETS.
Creating Data Access Services Presented by Ashraf Memon Presented by Ashraf Memon.
CprE 288 – Quick intro for compiling C in Linux
Web Services (tying it all together) and Introduction to Grid Services Concepts These slides are adapted from course material developed by Barry Wilkinson,
Streams and File I/O Chapter 14. I/O Overview I/O = Input/Output In this context it is input to and output from programs Input can be from keyboard or.
Georgia Institute of Technology Speed part 3 Barb Ericson Georgia Institute of Technology May 2006.
1 Understanding Cocoon2 Pankaj Kumar May 24, 2001 Web Services Organization HPMD, SSO, HP.
CS 157B: Database Management Systems II February 27 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
Functionality of a web server What does the web server do? Let a user request a resource Find the resource Return something to the user The resource can.
Guidelines for Homework 6. Getting Started Homework 6 requires that you complete Homework 5. –All of HW5 must run on the GridFarm. –HW6 may run elsewhere.
Working With Apache Axis. Axis Information See guide.html for the basic user guide.
1 Creating File Access Services Presented by Ashraf Memon Hands-on Ashraf Memon, Ghulam Memon.
CSI 1390: Introduction to Computers TA: Tapu Kumar Ghose Office: STE 5014
Sun’s Jini Lab 2 Service Registration Client Lookup.
COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.
CPSC 388 – Compiler Design and Construction Scanners – JLex Scanner Generator.
IBM TSpaces Lab 1 Introduction. Summary TSpaces Overview Basic Definitions Basic primitive operations Reading/writing tuples in tuplespace HelloWorld.
1 Recitation 8. 2 Outline Goals of this recitation: 1.Learn about loading files 2.Learn about command line arguments 3.Review of Exceptions.
JAVA PROGRAMMING BASICS CHAPTER 2. History of Java Begin with project Green in 1991 founded by Patrick Noughton, Mike Sheridan and James Gosling who worked.
BUILD ON THE POLYGLOT COMPILER FRAMEWORK MIHAL BRUMBULLI 7th Workshop “SEERE” Montenegro-Risan 9-14 September 2007 SimJ Programming Language.
1 StringTokenization Overview l StringTokenizer class l Some StringTokenizer methods l StringTokenizer examples.
1 Creating Web Services from a existing tool Presented by Ashraf Memon Hands-on Ashraf Memon, Ghulam Memon.
1 ENGI 2420 Structured Programming (Lab Tutorial 7) Memorial University of Newfoundland.
1 Creating Web Services Presented by Ashraf Memon Hands-on Ghulam Memon, Longjiang Ding.
CS101 Lab “File input/Output”. File input, output File : binary file, text file READ/WRITE class of “text file” - File Reading class : FileReader, BufferedReader.
5-Dec-15 Sequential Files and Streams. 2 File Handling. File Concept.
”Java and JMLfor Dummies” The Java source code is written in a text file using your favourite editor (Notepad) and is saved with extension.java. Be careful.
Java Programming, Second Edition Appendix A Working with Java SDK 1.4.
Java for C++ Programmers A Brief Tutorial. Overview Classes and Objects Simple Program Constructors Arrays Strings Inheritance and Interfaces Exceptions.
Chapter 9 1 Chapter 9 – Part 2 l Overview of Streams and File I/O l Text File I/O l Binary File I/O l File Objects and File Names Streams and File I/O.
1 G52IWS: Example Web-services Chris Greenhalgh. 2 Contents Software requirements AXIS web service run-time components Getting started with Jetty & AXIS.
1 Creating Data Access Services Presented by Ashraf Memon Hands-on Ghulam Memon, Longjiang Ding.
1 ENGI 2420 Structured Programming (Lab Tutorial 7) Memorial University of Newfoundland.
Creating Web Services Presented by Ashraf Memon Presented by Ashraf Memon.
Net-centric Computing Web Services. Lecture Outline  What is Web Service  Web Service Architecture  Creating and using Java Web Services  Apache Axis.
Settings MySQL Database and JDBC configuration Instructor: Sergey Goldman.
PHP – PHP Hypertext Processor A quick overview. How is PHP used? Embedded with HTML, e.g. Not like CGI: PHP files not an executable Used with servers.
Compiling and Running a Java Program
Section 64 – Manipulating Data Using Methods – Java Swing
Introduction to javadoc
An Introduction to Java – Part I, language basics
Unit 6 Working with files. Unit 6 Working with files.
Lecture 18 (Hadoop: Programming Examples)
Introduction to javadoc
Compile and run c files.
Presentation transcript:

Creating File Access Services Presented by Ashraf Memon Presented by Ashraf Memon

2 Overview Writing file access service classes in Java Generating service Deploying services with Apache Axis Generating client files and testing them

3 Writing file access service classes in Java A spatial ASCII file will be used as an example for this service. ASCII file format is not standard. Sample ASCII file looks like Longitude Latitude Magnitude E E E E-02

4 Writing file access service classes in Java (contd) First line of the file contains labels i.e. coordinates and attributes Each following line contains values Each value is seaparated by space Each record is separated by a new line.

5 Writing file access service classes in Java (contd) Sample File Access Class contains 1 function which reads lat/lon values and attributes from quakes1.dat file and return XML for those values Function signature is public String parse(String content, int criteria) Complete class code follows on next slide.

6 Writing file access service classes in Java (contd) import java.io.BufferedReader; import java.io.IOException; import java.util.StringTokenizer; import java.io.StringReader; import java.io.RandomAccessFile; import java.io.File; public class AsciiAccess { public AsciiAccess() { }

7 Writing file access service classes in Java (contd) public String parse(String ascii, int magnitudeCriteria) throws IOException{ String xml = " \r\n\t"; BufferedReader reader = new BufferedReader(new StringReader(ascii)); String line = reader.readLine(); line = reader.readLine(); while(line!=null){ StringTokenizer tokenizer = new StringTokenizer(line, " ");

8 Writing file access service classes in Java (contd) String[] tempArr = new String[tokenizer.countTokens()]; for(int i=0;tokenizer.hasMoreTokens();i++){ tempArr[i]=tokenizer.nextToken(); } if(Double.parseDouble(tempArr[tempArr.length- 1])>magnitudeCriteria){ xml+=" \r\n\t\t"; xml+=" "+tempArr[0]+" \r\n\t\t"; xml+=" "+tempArr[1]+" \r\n\t\t";

9 Writing file access service classes in Java (contd) xml+=" "+tempArr[2]+" \r\n\t"; xml+=" \r\n\t"; } line = reader.readLine(); } xml+="\r\n"; xml+=" "; return xml; }

10 Generating Service Download AsciiAccessService directory from ftp://dotnet.sdsc.edu/CSIG-WS/ ftp://dotnet.sdsc.edu/CSIG-WS/ Save directory to C:\training\user\code Copy quakes1.dat to C:\training\user\ Compile AsciiAccess.java file by typing following at command prompt javac AsciiAccess.java

11 Generating Service (contd) Run program by typing following at command prompt java AsciiAccess Output should be E-02

12 Deploying services with Apache Axis Copy generated class file to C:\training\tools\tomcat\webapps\axis\WEB -INF\classes\ Open deployAsciiAccess.wsdd in Textpad (Explanation by instructor) Close file.

13 Deploying services with Apache Axis(contd) Set classpath by typing classpath at command prompt Execute deployment descriptor by typing deploy deployAsciiAccess.wsdd at command prompt. This deploys webservice on Axis SOAP Server.

14 Generating client files and testing them(contd) Compile AsciiAccessServiceClient.java by typing following at command prompt –javac AsciiAccessServiceClient.java Execute Client by typing following at command prompt –java AsciiAccessServiceClient Output should be similar to the result of executing AsciiAccess