Only if "session" is specified as an attribute/parameter in the service 
definition, which is basically what I described below.

You absolutely cannot just retrieve the session from any service without 
defining it as an attribute and then passing it in from the calling code.

Regards
Scott

On 9/03/2010, at 10:46 AM, Ruth Hoffman wrote:

> Hi Patrick:
> Actually, you can get a session from within a Java service. Try:
> 
> HttpSession session = (HttpSession)context.get("session");
> 
> Regards,
> Ruth
> ----------------------------------------------------
> Find me on the web at http://www.myofbiz.com or Google keyword "myofbiz"
> ruth.hoff...@myofbiz.com
> 
> 
> Scott Gray wrote:
>> You can't, services are isolated and not aware of the http request/response 
>> cycle.  You need to explicitly pass in any parameters that the service will 
>> use.
>> 
>> Regards
>> Scott
>> 
>> HotWax Media
>> http://www.hotwaxmedia.com
>> 
>> On 9/03/2010, at 8:08 AM, Patrick wrote:
>> 
>>  
>>> I have a service definition
>>> public static Map<String, Object> sendMailFromScreen(DispatchContext
>>> dctx, Map<String, ? extends Object> rServiceContext)
>>> 
>>> How can I get the session from this?  Thanks
>>> Patrick
>>>    
>> 
>>  

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to