[JBoss-user] [JBossWS] - ServiceLifeCycle Question

2006-05-25 Thread burrsutter
I was experimenting with the ServiceLifeCycle in my 181 WS and it would appear 
that the session is recreated with every invocation/operation.  Perhaps there 
is something in a config file that I need to setup.  If so then the doc doesn't 
mention that fact:
http://labs.jboss.com/portal/jbossws/user-guide/en/html/endpoints.html#service-lifecycle

Here is my code, perhaps I simply built it incorrectly:


  | package org.jboss.samples;
  | 
  | import javax.jws.WebMethod;
  | import javax.jws.WebService;
  | import javax.xml.rpc.server.ServiceLifecycle;
  | import javax.xml.rpc.server.ServletEndpointContext;
  | import javax.xml.rpc.ServiceException;
  | import javax.xml.rpc.handler.MessageContext;
  | import java.util.Iterator;
  | import javax.jws.soap.SOAPBinding; 
  | import javax.jws.soap.SOAPBinding.Use;
  | 
  | 
  | @WebService
  | @SOAPBinding(style = SOAPBinding.Style.RPC)
  | public class ExamineContext implements ServiceLifecycle {
  |  private ServletEndpointContext context;
  | 
  |  @WebMethod (operationName="GetUserPrincipalName")
  |  public String getUserPrincipalName() {
  | return context.getUserPrincipal().getName();
  |  }
  |  
  |  @WebMethod
  |  public String getAttribute(String key) {
  | return (String) 
context.getHttpSession().getAttribute(key);
  |  }
  |  @WebMethod 
  |  public void setAttribute(String key, String value) {
  | context.getHttpSession().setAttribute(key,value);
  |  }
  |  @WebMethod 
  |  public void removeAttribute(String key) {
  | context.getHttpSession().removeAttribute(key);
  |  }
  |  @WebMethod 
  |  public String getSessionId() {
  | return context.getHttpSession().getId();
  |  }
  |  
  |  @WebMethod
  |  public String getMessageContext() {
  | MessageContext msgContext = context.getMessageContext();
  | StringBuffer sb = new StringBuffer();
  | String key = null;
  | for(Iterator i = msgContext.getPropertyNames(); 
i.hasNext(); ) {
  | key = (String) i.next();
  | sb.append(";" + key + "=" + 
msgContext.getProperty(key));
  |   }
  |   return sb.toString();
  |}
  |  
  |public void init(Object context) throws ServiceException
  |{
  |  System.out.println("ExamineContext Init\n");
  |  this.context = (ServletEndpointContext)context;
  |}
  | 
  |public void destroy()
  |{
  |  System.out.println("ExamineContext Destroy\n");
  |}
  | }

Burr

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

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


---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBossWS] - ServiceLifeCycle

2006-02-05 Thread johnr1111
I created a web service implementing the ServiceLifeCycle interface.  In doing 
some tests it appeared that the init and destroy were called on every single 
web service call.  Is this really the case?  It appears that the Servlets do 
not do this and only call the init when the object is first created and destroy 
when it's being unloaded or removed.

Using the latest released JBoss, it appears that for every call to a web 
service, the web service is created and destroyed, calling init and destroy for 
every method call. 

I know the spec doesn't say how they have to be managed as its up to the 
container management, but this seems like a realy performance nightmare. 

Can you help me clarify this behavior, so I know that this is currently how it 
is or if I have just configured something wrong or missed configuring 
something.  I know the JBossWS stuff is still evolving.



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

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


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBossWS] - ServiceLifecycle problem with webservice and jboss-4.0.2

2005-05-10 Thread sirwio
Hi,

I'm in the task of developing a binary file upload webservice on jboss. The 
binary attachment is passed as a mime multipart attachment. In order to 
retrieve the attachment the webservice implements ServiceLifecycle.

The context retrevied from the argument of the init method is then used to 
retrive the SOAPMessage context as shown below.
SOAPMessageContext msgContext = (SOAPMessageContext) 
context.getMessageContext();
This worked fine in jboss-4.0.1 and jboss-4.0.2RC1 but the the init method 
doesn't seem to be called on jboss-4.0.2 since the context variable is null.

Am I doing something faulty. Perhaps something needs to be configured 
differently in jboss-4.0.2?

/Magnus

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

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


---
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user