[jboss-user] [JBossWS] - Re: WebServiceContext injection. Was it fixed or not?

ggary do-not-reply at jboss.com
Thu Oct 4 12:59:21 EDT 2007


"richard_opalka" wrote : Could you share your service code with us?
  | 
  | Richard
Sure, here it is:
package com.rsys.rsystools.ws;
  | 
  | import javax.annotation.Resource;
  | import javax.jws.WebMethod;
  | import javax.jws.WebParam;
  | import javax.jws.WebResult;
  | import javax.jws.WebService;
  | import javax.jws.soap.SOAPBinding;
  | import javax.jws.soap.SOAPBinding.Style;
  | import javax.servlet.ServletContext;
  | import javax.xml.ws.ResponseWrapper;
  | import javax.xml.ws.WebServiceContext;
  | import javax.xml.ws.handler.MessageContext;
  | import org.springframework.web.context.support.WebApplicationContextUtils;
  | 
  | 
  | @WebService(targetNamespace="http://service.responsys.com/rsystools/ws/SpamComplaintWS/1.0")
  | @SOAPBinding(style = Style.DOCUMENT)
  | public class SpamComplaintWS implements SpamComplaint
  | {
  |     @Resource
  |     private WebServiceContext context;
  |     
  |     ServletContext servletCtx;
  |     /** Creates a new instance of SpamComplaintWS */
  |     public SpamComplaintWS()
  |     {
  |     }
  |     
  |     /**
  |      * Web service operation
  |      */
  |     @WebMethod(operationName="processSpamComplaints")
  |     @WebResult(name="SpamResult", targetNamespace="http://service.responsys.com/rsystools/ws/SpamComplaintWS/1.0")
  |     @ResponseWrapper(className="com.rsys.rsystools.ws.SpamResult",
  |     targetNamespace="http://service.responsys.com/rsystools/ws/SpamComplaintWS/1.0")
  |     public SpamResult processSpamComplaints(
  |         @WebParam(name = "email") String email,
  |     @WebParam(name = "fromAddress") String fromAddress,
  |     @WebParam(name = "mailDate") String mailDate,
  |     @WebParam(name = "complaintDate") String complaintDate,
  |     @WebParam(name = "mailbox") String mailbox,
  |     @WebParam(name = "complainer") String complainer,
  |     @WebParam(name = "xRext") String xRext,
  |     @WebParam(name = "accountName") String accountName)
  |     {
  |         ServletContext servletCtx = (ServletContext) context.getMessageContext().get(MessageContext.SERVLET_CONTEXT);
  |         Object appContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletCtx);
  |         responsys.prodtools.SpammerTables st = new responsys.prodtools.SpammerTables();
  |         java.lang.String[] res = st.processSpamRecord(email, fromAddress, mailDate, complaintDate, mailbox, complainer, xRext, accountName);
  |         return (new SpamResult(res[0],res[1],res[2],res[3],res[4],res[5],res[6],res[7],res[8],res[9],res[10],res[11],res[12],res[13]));
  |     }
  |     
  |     
  | }
  | 

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

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



More information about the jboss-user mailing list