Announcement Announcement Module
Collapse
No announcement yet.
Accessing Spring beans from SLSB Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Accessing Spring beans from SLSB

    I am trying to rejuvenate some old web service for spam processing that was originally written in AXIS 1.
    I decided to try SLSB based web service and created this code based on existing API:
    Code:
    @Stateless()
    @WebService(
        targetNamespace="http://my.webservice.namespace/1.0")
    @SOAPBinding(style = Style.RPC)
    public class SpamComplaintWS
    {
        /**
         * Web service operation
         */
        @javax.jws.WebMethod
        public SpamResult processSpamComplaint(
            @WebParam(name = "email") String email, 
            @WebParam(name = "fromAddress") String fromAddress, 
            @WebParam(name = "mailDate") String mailDate)
        {
            SpamToken st = new SpamToken();
            java.lang.String[] res = st.processSpamRecord(email, fromAddress, mailDate);
        	return (new SpamResult(res));
        }    
    }
    Comparing to the old service, that uses the same API, the amount of code is reduced hundredfold.
    Unfortunately, that existing API has extensive DI from the original servlet context (3 context files).
    I am quite new to ejb3, so I am not sure how should I inject these dependencies into my EJB.
    Should I use @Reference annotation?
    What is the best way to deploy this thing, i.e. instead of original war file should I create ear or sar?
    I am using JBOSS 4.2, BTW.
    I will appreciate any tips on this matter.
Working...
X