Services | Updates | Contact
Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML
length() Method In Java
In this section, you will learn how to use length() method of the String class.
 
FastTrack
FastTrack is a zero administration tool providing project work planning and tracking deeply integrated into Eclipse IDE
 
More Tutorials...


    Loan Information     Struts     Open Source

Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

 
 
Web Services

 
Comments
 
 

 

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

Facing Programming Problem?
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

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

 

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.

  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

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

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

Copyright © 2007. All rights reserved.