[jboss-user] [EJB 3.0] - Re: EJB3 WebServices

dasariprasad do-not-reply at jboss.com
Sun Nov 5 10:10:45 EST 2006

I had tested one webservice example in jboss4.0.5GA  & ejb3(version RC9, i suppose) the following are files


package com.htc.htcws;
import javax.ejb.Remote;
public interface SimpleWS extends java.rmi.Remote 
   public  String greet(String person)
          throws  java.rmi.RemoteException;             


package com.htc.htcws; 

import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import org.jboss.annotation.ejb.RemoteBinding;
@RemoteBinding(jndiBinding="/ejb3/EJB3EndpointInterface")   @Remote(com.htc.htcws.SimpleWS.class)

public class SimpleWSBean implements SimpleWS
  public  String greet(String person) 
   return "Hi "+person+" all Good Wishes for Diwali";

the build.xml

<?xml  version="1.0" ?>













  first i ran 
   from my directory >ant

  then started server

   d:\jbossejb3\bin>run -c all

 then tested the client


package com.htc.htcws;

import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Service;
import javax.xml.namespace.QName;
import java.net.URL;

public class SimpleWSClient

 public static void main(String[] args)
    final String _NAMESPACE = "http://htcws.htc.com/jaws";
    final String _SERVICE = "SimpleWSService";
   URL url =  
     new URL("http://localhost:8080/simpws/SimpleWSBean?wsdl");
    QName qName = new QName(_NAMESPACE,_SERVICE);
      System.out.print("Give the person-name as args[0]");

    ServiceFactory sFactory = ServiceFactory.newInstance();
    Service service = sFactory.createService(url,qName);

    SimpleWS invoker =

     String res = invoker.greet(args[0]);
     System.out.println("Response is :"+res);
   catch(Exception ex)
       System.err.println("Caught the exception as"+ex);


    > ant   java
  it is working fine (except a warning that log4j not configured)

  just made a beginning  may be helpful to you

                       all good luck
                       Prasad DTR
                       rajendra32 at yahoo.co.uk

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983299#3983299

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983299

More information about the jboss-user mailing list