Return-Path: Delivered-To: apmail-incubator-cxf-user-archive@locus.apache.org Received: (qmail 95795 invoked from network); 28 Sep 2007 05:36:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Sep 2007 05:36:06 -0000 Received: (qmail 72344 invoked by uid 500); 28 Sep 2007 05:35:56 -0000 Delivered-To: apmail-incubator-cxf-user-archive@incubator.apache.org Received: (qmail 72294 invoked by uid 500); 28 Sep 2007 05:35:56 -0000 Mailing-List: contact cxf-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-user@incubator.apache.org Delivered-To: mailing list cxf-user@incubator.apache.org Received: (qmail 72285 invoked by uid 99); 28 Sep 2007 05:35:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Sep 2007 22:35:56 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of egilmezbilek@gmail.com designates 64.233.162.234 as permitted sender) Received: from [64.233.162.234] (HELO nz-out-0506.google.com) (64.233.162.234) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Sep 2007 05:35:57 +0000 Received: by nz-out-0506.google.com with SMTP id o37so1872596nzf for ; Thu, 27 Sep 2007 22:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=WV5uAzA/XLyT/hPiEI4ZJBVeLYbmd9ipVRkYHunY/sk=; b=fdkbma4lU1V3m40QGT6ctqGNwPH+M20OwpsSAx/VFEaJwetPOYE3g7SRp8Wgb6yTvsqKQDVWUNX87Eu3fif4I8EDwtFYTb0MKVWjzdUDE8RmdkAFZUiOLpir3jF3G2fOCqLo5ISHEzEOvoMf0KfD82tZBkL1ciFFiUSENijXMws= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=gU5H9tBaZHw3GcgZvsxiZLH8I6IDYRq0td454MjfPMLtlxEzpH1NqxsckskWiRoeFkAhzgiWf825G1XCZjhdwYaWwPLIv/MLaYk3OCt0RbbngThoNrbUiGeFLsEOM8mWW6T6M3Jn49eg2c+Y72ODMZsgBNY8/nH9MkZWOXY3hI4= Received: by 10.65.119.14 with SMTP id w14mr6625448qbm.1190957735266; Thu, 27 Sep 2007 22:35:35 -0700 (PDT) Received: by 10.65.158.17 with HTTP; Thu, 27 Sep 2007 22:35:35 -0700 (PDT) Message-ID: <9555ec7f0709272235h1689fa28h7be6aaf98aa001ba@mail.gmail.com> Date: Fri, 28 Sep 2007 08:35:35 +0300 From: "Mustafa Egilmezbilek" To: cxf-user@incubator.apache.org Subject: Re: WebServiceContext is null In-Reply-To: <2a2f8de80709271257u597b136hefc4982d4efe8aa4@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5042_6553475.1190957735248" References: <9555ec7f0709270714r5e5ebdf5wae6055857ad33698@mail.gmail.com> <2a2f8de80709271257u597b136hefc4982d4efe8aa4@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_5042_6553475.1190957735248 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Dave, How do you set http transport in CXF ? On 9/27/07, Dave Kallstrom wrote: > > This is how i get the httpRequest > @Resource > private WebServiceContext context; > private HttpServletRequest getHttpRequest() > { > MessageContext ctx = getContext().getMessageContext(); > HttpServletRequest request = (HttpServletRequest) ctx.get( > AbstractHTTPDestination.HTTP_REQUEST); > return request; > } > > Be careful though, this only works when you are using http transport. > On 9/27/07, Mustafa Egilmezbilek wrote: > > > > Hi, > > > > I am trying to access WebServiceContext to be able use HttpSession as > > described in: http://cwiki.apache.org/CXF20DOC/servlet-transport.html, > but > > I > > keep getting null. What might be the reason ? > > > > > > @Resource > > > > *public* WebServiceContext wsContext; > > protected HttpSession getHttpSession() { > > MessageContext mc = *wsContext*.getMessageContext(); > > HttpSession session = ((javax.servlet.http.HttpServletRequest > > )mc.get(MessageContext.SERVLET_REQUEST)).getSession(); > > return session; > > } > > > > > > > > Thanks, > > > > Karakoyun > > > > > > -- > Dave Kallstrom > -- Mustafa Egilmezbilek ------=_Part_5042_6553475.1190957735248--