Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
WEBSERVICE USING APACHE AXIS TUTORIAL-1 
 

Inter-operability is one of the two aims of Xml-webservice paradigm,while the other aim is tackling the firewall problem. (Since ASP.net runs only in Win2000, switch over to Win2000. before beginning this experiment).The emphasis is on the procedure, in l

 

WEBSERVICE USING APACHE AXIS TUTORIAL-1
Using Java XML-WEBSERVICE  from ASP.net.
( published in DeveloperIQ   January-2004)( www.developeriq.com)
R.S.RAMASWAMY (rs.ramaswamy@gmail.com) 

Sri.Manoj Kothale, has written a fine piece in DeveloperIQ(Nov'03) on  exposing an EJB as an XML-WebService, using Axis and JBOss. In this experiment, we attempt  exposing a javabean (jws)  from Tomcat/Axis and consuming that service in an ASP.net program.This is much simpler.

Inter-operability is one of the two aims of Xml-webservice paradigm,while the other aim is tackling the firewall problem. (Since ASP.net runs only in Win2000, switch over to Win2000. before beginning this experiment).The emphasis is on the procedure, in laboratory experiment fashion).

Kindly , ensure that correct versions of software , are used, as mentioned.It is presumed that DotNet SDK has already been installed and tested,for running asp.net programs.

   1)  axis1.1   was installed in c:\axis11

   2)  tomcat4.1  from march-2003 issue of Dev IQ.

                 was installed as c:\tomcat41 

   3)  We will  find a folder named 'axis' in c:\axiss11\webapps.

       Copy this ('axis') folder to  c:\tomcat41\webapps    folder.

   4)    We must copy  activation.jar  to:

          c:\tomcat41\webapps\axis\web-inf\lib   folder. (This file is available in jboss3.2\server\all\lib  folder

         and jboss3.2 was given in NovemberCD.)

       5)  We set JAVA_HOME  for tomcat as follows:

       c:\tomcat41\bin>set JAVA_HOME=D:\jdk141   (because, we have installed jdk1.4.1 in D-drive).

    6) We should uncomment the 'admin servlet' part in

      the web.xml  file in c:\tomcat41\webapps\axis\web-inf folder.

   7) We start tomcat server:

      c:\tomcat41\bin>startup

      8) This starts tomcat4.1 and we wait till, it is fully started.

    9) We create our own folder c:\axisdemo

      In this folder, we create a simple javabean     greeter.java   as given below. 

     //  c:\axisdemo\greeter.java 

       public class greeter

       {

          public String greetme(String s)

            {

             return "How are you?……………….."+s;

            }

       }

   10) we copy  greeter.java as greeter.jws

       into           c:\tomcat41\webapps\axis      folder.

      (we did this while tomcat41 was running!).No problem!

    11)  We start the browser and type the URL as:              

           'http://localhost:8080/axis/greeter.jws' 

           and we get  a link to the wsdl file for the above service. When we click this link, we get a wsdl file .

           (wsdl -> webservice description language).

     12) We save this   wsdl file  in  d:\inetpub\wwwroot  folder   as greeter.wsdl

     13)    Our aim is to create a C# file from this wsdl file.

          The following command does that. 

         d:\inetpub\wwwroot>wsdl   greeter.wsdl 

         This command created  greeterService.cs    file! 

         ( carefully note that the name has been appended with    'Service')   

         The next step is to compile this source file into a dll.   

    14)..wwwroot>csc /t:library  

              /r:System.dll,System.Web.Services.dll,System.Xml.dll

               greeterService.cs

           (type this in continuous line).  

          ( t -> target   &  r -> reference)   

         This command created greeterService.dll 

    15) Now copy this dll file to  d:\inetpub\wwwroot\bin  folder.

   ( If there is no such 'bin' folder  create it.).

    Now create  greeterService.aspx  as given below.

    ( in d:\inetpub\wwwroot        folder)

<%@ page language="c#" %>

<script runat=server>

public void job1(Object o, EventArgs e)

{

    String  a = text1.Text; 

    greeterService     greeter = new greeterService(); 

    String  s = greeter.greetme(a); 

     Response.Write(s); 

} 

</script>

<html>

<body>

<form              runat=server>

  <asp:Textbox   id=’text1’                runat=server  />

  <asp:Button  onclick=job1  text="Click" runat=server   />

</form>

</body>

</html>

 ( Normally, IIS-5 will be running . If not, start it.)

 After this, type the URL in browser as: 

    'http://localhost/greeterService.aspx' 

    Remember that the tomcat server is running and supplying   the 'greeter.jws'.

After some delay ( due to compiling time), we get a form.Type your name in the textbox ( say, ‘sam’ )& click the button  to    invoke the service.  We get  'How are you?…..sam’  message from the java web service. We get correct result .     We can also create a standalone C# client by just appending a main() to the greeterService.cs and naming it as  ‘greeterConsole.cs’.

Ref:  AXIS..by RominIrani & JeelaniBasha (wrox press).  Tutorual-2  continues in axis2a.htm

Visit  http://in.geocities.com/rsramsam

» View all related tutorials
Related Tags: c http web architecture com tutorials service io remote help services distributed request soa vi tutorial using managed int ria

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

1 comments so far (
post your own) View All Comments Latest 10 Comments:

This tutorial is actually very helpful for begginers in web services......

Posted by sidhartha on Thursday, 01.17.08 @ 15:05pm | #45432

Training Courses
Tell A Friend
Your Friend Name
Website Designing Services
 
Web Designing Packages From $150!
 
Website Designing Company Web Hosting
 
Website Designing Quotation
 
Search Tutorials:

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.