Results 1 to 3 of 3

Thread: Very Simple Web Service

  1. #1

    Thread Starter
    Addicted Member waelr's Avatar
    Join Date
    Nov 2004
    Posts
    168

    Very Simple Web Service

    Hello.. Java newb coming from .NET development
    What am trying to do is actually very simple, don't need a fancy (heavy) IDE, notepad is more than enough
    I downloaded and installed both JDK 1.6 & Glassfish v3, both installed correctly and are up and running
    I need to create a simple HELLO web service, code goes like this

    Code:
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    
    @WebService
    public class Hello
    {
    	@WebMethod
    	public String sayHello(String name)
    	{
    		return "Hello " + name + "!";
    	}
    }
    What I need next is to simply put this in a .war file and place it in the "autodeploy" folder of the glassfish web server
    Coming from the .NET world, things are as simple as creating your asmx file and copying it over to IIS, you can simply use notepad to write the following

    Code:
    <%@ WebService Language="VB" Class="Hello" %>
    
    Imports System
    Imports System.Web
    Imports System.Web.Services
    Imports System.Xml.Serialization
    
    Public Class Hello
        Inherits System.Web.Services.WebService
        
        <WebMethod()> Public Function sayHello(ByVal name As String) As String
    		return "Hello " & name
        End Function
    
    End Class
    Save that as "Hello.asmx", copy it to "C:\inetpub\wwwroot\", go to "http://localhost/Hello.asmx" and there you go, you have your webservice working perfectly

    Is it possible to do the same with Java & Glassfish !?

  2. #2

    Thread Starter
    Addicted Member waelr's Avatar
    Join Date
    Nov 2004
    Posts
    168

    Re: Very Simple Web Service

    Guys!! Nobody has an answer for such a simple request! Is it possible that this can't be done !? Am I forced to use nasty IDEs like Netbeans & Eclipse

  3. #3
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Very Simple Web Service

    No, of course it's possible. I've never tried doing that manually but I don't really think developing a web service is that difficult. I think you should checkout Metro docs
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width