1 Creating File Access Services Presented by Ashraf Memon Hands-on Ashraf Memon, Ghulam 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 
Java Server Pages (JSP)
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”
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
Software Development Tools COMP220/COMP285 Seb Coope Ant and XML: Getting Started These slides are mainly based on “Java Development with Ant” - E. Hatcher.
Assignment 2 Modifying, Compiling, and Deploying a Simple Service Presenter Information goes Here.
ASP Tutorial. What is ASP? ASP (Active Server Pages) is a Microsoft technology that enables you to make dynamic and interactive web pages. –ASP usually.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
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.
Winter 2005Jason Prideaux1 Apache ANT A platform independent build tool for Java programs.
Scite Scintilla integrated text editor. Click here.
Distributed Web Software  Presentation-based, e.g., dynamic web pages  Service-based – Web Services.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
4 Copyright © 2004, Oracle. All rights reserved. Creating a Basic Form Module.
Java Server Pages B.Ramamurthy. Java Server Pages Servlets are pure Java programs. They introduce dynamism into web pages by using programmatic content.
CS1020: Intro Workshop. Topics CS1020Intro Workshop Login to UNIX operating system 2. …………………………………… 3. …………………………………… 4. …………………………………… 5. ……………………………………
Distributed Web Software Presentation-based, e.g., dynamic web pages Service-based – Web Services.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
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.
public static void main (String[] args)
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Creating File Access Services Presented by Ashraf Memon Presented by Ashraf Memon.
Javascript and the Web Whys and Hows of Javascript.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
WaveMaker Visual AJAX Studio 4.0 Training Troubleshooting.
Java Programming, 3e Concepts and Techniques Chapter 2 - Part 2 Creating a Java Application and Applet.
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.
®® Microsoft Windows 7 for Power Users Tutorial 13 Using the Command-Line Environment.
Working With Apache Axis. Axis Information See guide.html for the basic user guide.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.
Chapter 3 Servlet Basics. 1.Recall the Servlet Role 2.Basic Servlet Structure 3.A simple servlet that generates plain text 4.A servlet that generates.
IBM TSpaces Lab 1 Introduction. Summary TSpaces Overview Basic Definitions Basic primitive operations Reading/writing tuples in tuplespace HelloWorld.
4 Copyright © 2004, Oracle. All rights reserved. Creating a Basic Form Module.
XML Web Service. Overview of XML Web Service ASP.NET XML Web services enable you to remotely access the properties and methods of classes across a network.
Introduction IS Outline  Goals of the course  Course organization  Java command line  Object-oriented programming  File I/O.
1 Creating Web Services from a existing tool Presented by Ashraf Memon Hands-on Ashraf Memon, Ghulam Memon.
20-Nov-15introServlets.ppt Intro to servlets. 20-Nov-15introServlets.ppt typical web page – source Hello Hello.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
Illustration of a Visual Basic Program Running an Ada Program 1 by Richard Conn 11 September 1999.
Unix Environment Input Output 2  List Content (ls) ◦ ls (list current directory) ◦ ls –all (include hidden files/folders)  Make directory (mkdir) ◦
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
1 Creating Web Services Presented by Ashraf Memon Hands-on Ghulam Memon, Longjiang Ding.
”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.
Chapter 7: Creating and Consuming XML Web Services Understanding XML Web Services Creating XML Web Services Deploying and Discovering XML Web Services.
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 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
Creating Web Services Presented by Ashraf Memon Presented by Ashraf Memon.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
How CGI and Java Servlets are Run By David Stein 14 November 2006.
HOW TO INSTALL JAVA IDE TO WIN 7. Problems Installing Netbeans on Windows 7 If you are having trouble installing Netbeans on Windows 7, you might.
Net-centric Computing Web Services. Lecture Outline  What is Web Service  Web Service Architecture  Creating and using Java Web Services  Apache Axis.
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.
9/21/04 James Gallagher Server Installation and Testing: Hands-on ● Install the CGI server with the HDF and FreeForm handlers ● Link data so the server.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
CS1010: Intro Workshop.
Writing simple Java Web Services using Eclipse
Introduction to javadoc
Run Java file with Window cmd
Introduction to javadoc
Compile and run c files.
Presentation transcript:

1 Creating File Access Services Presented by Ashraf Memon Hands-on Ashraf Memon, Ghulam 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 Magnitude Date Time Latitude Longitude Depth /07/07 11:15: N W /07/07 11:11: N W /07/07 10:58: N W /07/07 10:55: N W 12.2

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 separated 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 quakes.dat file and return XML for those values Function signature is public String getData(double magnitude) Explanatory source code follows on next slide. For complete source code check c:\data\csig05\ws\solutions\ascii\AsciiAccess.java

6 Writing file access service classes in Java (contd) 1. public String getData(double magnitude) throws IOException{ 2. String xml = " \r\n\t"; 3.RandomAccessFile reader = new RandomAccessFile("C:\\data\\csig05\\ws\\solutions\\ascii\\data\\quakes.dat", "r"); 4. String line = reader.readLine(); 5. line = reader.readLine(); 6. while(line!=null){ 7. StringTokenizer tokenizer = new StringTokenizer(line, " "); 8. String[] tempArr = new String[tokenizer.countTokens()]; 9. for(int i=0;tokenizer.hasMoreTokens();i++){ 10. tempArr[i]=tokenizer.nextToken(); 11. } 12. if(Double.parseDouble(tempArr[0])>magnitude){ 13. xml+=" \r\n\t\t"; 14. xml+=" "+tempArr[4]+" \r\n\t\t"; 15. xml+=" "+tempArr[3]+" \r\n\t\t"; 16. xml+=" "+tempArr[0]+" \r\n\t"; 17. xml+=" \r\n\t"; 18. } 19. line = reader.readLine(); 20. } 21. xml+="\r\n"; 22. xml+=" "; 23. return xml; 24. }

7 Testing the code Navigate to solutions directory c:\data\csig05\ws\solutions Open command prompt by right clicking on the ascii directory and selecting “Command Prompt Here” Change to ascii directory by typing following at the command prompt cd ascii Compile AsciiAccess.java file by typing following at command prompt javac AsciiAccess.java Run program by typing following at command prompt java AsciiAccess Output should be of the form: continued on the next page

8 Testing the code (contd) W N W N W N W N W N 2.9 Type exit on the command prompt to quit

9 Deploying your code as a web services with Apache Axis Copy generated class file to C:\tools\tomcat4.1\webapps\axis\WEB-INF\classes\ Open using any text editor deployAsciiAccess.wsdd from C:\tools\tomcat4.1\webapps\axis\WEB-INF\classes\ Verify the content so that it matches the current service and its corresponding class

10 Deploying services with Apache Axis Navigate to C:\tools\tomcat4.1\webapps\axis\WEB-INF\ Open command prompt by right clicking on the classes directory and selecting “Command Prompt Here” Change to classes directory by typing following at the command prompt cd classes Set classpath by typing classpath.bat on the command prompt Execute deployment descriptor by typing deploy.bat deployAsciiAccess.wsdd at command prompt This will deploy database webservice on Axis SOAP Server Test it by going to and navigating to AsciiAccessServicehttp://localhost/axis/

11 Generating client files and testing them Change directory to c:\data\csig05\ws\solutions\ascii by typing “cd c:\data\csig05\ws\solutions\ascii” on the command prompt Compile AsciiAccessServiceClient.java by typing following at command prompt –javac AsciiAccess ServiceClient.java Execute Client by typing following at command prompt –java AsciiAccess ServiceClient Output should be similar to previous one

12 Creating Web Service to Access DatabaseCreating Web Service to Access Database Next Chapter