|
-
Jun 1st, 2010, 04:00 AM
#1
Thread Starter
Addicted Member
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 !?
-
Jun 4th, 2010, 02:57 AM
#2
Thread Starter
Addicted Member
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
-
Jun 4th, 2010, 10:52 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|