Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 3408 invoked from network); 6 Dec 2010 09:17:24 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Dec 2010 09:17:24 -0000 Received: (qmail 3398 invoked by uid 500); 6 Dec 2010 09:17:23 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 3112 invoked by uid 500); 6 Dec 2010 09:17:21 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 3103 invoked by uid 99); 6 Dec 2010 09:17:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Dec 2010 09:17:20 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of manoelkazza@gmail.com designates 209.85.213.169 as permitted sender) Received: from [209.85.213.169] (HELO mail-yx0-f169.google.com) (209.85.213.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Dec 2010 09:17:15 +0000 Received: by yxl31 with SMTP id 31so20781575yxl.0 for ; Mon, 06 Dec 2010 01:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=xSzvTgMrVoPNW56yeFyPkLhVTdfOKbdwM2yg9bFKFKY=; b=P6W8gQ/vlF8CVwgTPbH8M90d2uyZg/erWHPBa8gAwlsCs5V02VXGPX/WzCv9oVgfuk tX2Gp5V/xDJLVeb79ksGxem8L7IzEeaAYXfRzNTN1hv7TqWnR1kXXmKgHsc1nlszjElf P9f2mu8TIgpKSfm+FFeOvE/IUXwpZPczTr/fA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=WTJrPfxG27o7D2dcG3ZLTENpyL9dr2uYFN30+ItFXVnKBhCsDzEBVZYxtgNBOBDaRp rjaidSfnmqIyoxRyjiJM5VZrQgKcJhDf9eaikSF3zfO1qJoP6Ck+btA4q5v0szUIsEsA Iv2SxOTOqcn120a9tzKLBbpgcG95Q5EsvgEAU= MIME-Version: 1.0 Received: by 10.42.230.131 with SMTP id jm3mr1388759icb.293.1291627014409; Mon, 06 Dec 2010 01:16:54 -0800 (PST) Received: by 10.42.230.201 with HTTP; Mon, 6 Dec 2010 01:16:54 -0800 (PST) In-Reply-To: References: <201011301601.29528.dkulp@apache.org> <201012011407.11330.dkulp@apache.org> Date: Mon, 6 Dec 2010 10:16:54 +0100 Message-ID: Subject: Re: Interceptors: How to handle an unknown request? From: Manoel Farrugia To: users@cxf.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sorry but I am new with CXF and have not understand the last post Sergey On Thu, Dec 2, 2010 at 11:52 AM, Sergey Beryozkin wr= ote: > Having a custom CXF invoker is probably one option, it should be able to > ensure the right Method is invoked, > another option is to register a custom CXF ServletFilter which would prov= ide > a custom HttpServletRequest which would in turn manipulate the request bo= dy > such that CXF is made to believe it is getGreeting() which has to be > invoked. > You may also want to debug and check how CXF SOAP interceptors determine = the > method name and may be you can register a custom XMLStreamReader which wi= ll > make CXF to invoke getGreeting. > > Sergey > > > On Thu, Dec 2, 2010 at 10:37 AM, Manoel Farrugia w= rote: > >> No I have only getGreeting implemented and want that every other wrong >> request is directed to getGreeting. >> >> If one requests getGreeting2 it directs him to getGreeting. >> >> >> On Thu, Dec 2, 2010 at 11:34 AM, Sergey Beryozkin >> wrote: >> > Do you actually have getGreeting2 implemented ? Example, do you have t= wo >> > SOAP endpoints, one implementing getGreeting and one getGreeting2 and = you >> > want the consumers of getGreeting2 be able to work with the old >> > getGreeting() ? >> > >> > cheers, Sergey >> > >> > On Thu, Dec 2, 2010 at 9:43 AM, Manoel Farrugia > >wrote: >> > >> >> I can even scrap the idea of Interceptors if there is a better way to >> >> do my wanted job! >> >> >> >> Instead of receiving soap:ServerNo such operation: getGreeting2 (HTTP >> >> GET PATH_INFO: /HelloWorldWebServices/HelloWorldPort/getGreeting2) I >> >> want to see the getGreeting response! >> >> >> >> How can I do it in CXF Web Services? >> >> >> >> >> >> >> >> On Wed, Dec 1, 2010 at 8:10 PM, Manoel Farrugia >> >> wrote: >> >> > I am not restricted to handleFault only. I want to redirect any wro= ng >> >> > methods to getGreeting() method. >> >> > >> >> > On Wed, Dec 1, 2010 at 8:07 PM, Daniel Kulp wrot= e: >> >> >> >> >> >> On Wednesday 01 December 2010 5:49:41 am Manoel Farrugia wrote: >> >> >> > Something like this: >> >> >> > >> >> >> > public void handleFault(Message message) { >> >> >> > =A0 =A0 =A0System.out.println("------FAAAAAUUUUUUUULLLLLLTTTTTT-= ------"); >> >> >> > >> >> >> > =A0 =A0 =A0String path =3D (String)message.get(Message.PATH_INFO= ); >> >> >> > =A0 =A0 =A0String basePath =3D (String)message.get(Message.BASE_= PATH); >> >> >> > =A0 =A0 =A0String query =3D (String)message.get(Message.QUERY_ST= RING); >> >> >> > =A0 =A0 =A0System.out.println("Path: "+path+". BasePath: "+baseP= ath+". >> >> Query: >> >> >> > "+query+"."); >> >> >> > =A0 =A0 =A0System.out.println("------FAAAAAUUUUUUUULLLLLLTTTTTT-= ------"); >> >> >> > >> >> >> > =A0 =A0 =A0message.put(Message.PATH_INFO, >> >> >> > "/HelloWorldWebServices/HelloWorldPort/getGreeting"); >> >> >> > >> >> >> > =A0 =A0 =A0path =3D (String)message.get(Message.PATH_INFO); >> >> >> > =A0 =A0 =A0System.out.println("NEW PATH: "+path); >> >> >> > =A0 =A0 } >> >> >> > >> >> >> > That is changing the message's pathinfo from the wrong one >> >> >> > to /HelloWorldWebServices/HelloWorldPort/getGreeting >> >> >> > >> >> >> > But I want to direct to >> >> >> > /HelloWorldWebServices/HelloWorldPort/getGreeting >> >> >> > from the handleFault method. >> >> >> > How should I do this? >> >> >> >> >> >> From handleFault? =A0 Hmm... =A0No idea really. >> >> >> >> >> >> You =A0could TRY to do something like >> >> >> message.getInterceptorChain().reset(); >> >> >> message.getIntercetporChain().processMessage(message); >> >> >> message.getInterceptorChain().pause(); >> >> >> >> >> >> or similar. =A0I really have no idea what that would do. =A0 Hones= tly, >> once >> >> >> the >> >> >> fault occurs, things are somewhat left in an unpredictable state a= nd >> I'm >> >> >> not >> >> >> sure what would happen. >> >> >> >> >> >> Dan >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> > On Tue, Nov 30, 2010 at 10:01 PM, Daniel Kulp >> >> wrote: >> >> >> > > On Tuesday 30 November 2010 5:31:10 am Manoel Farrugia wrote: >> >> >> > > > As a web service I have a getGreeting() method which is >> accessed >> >> by: >> >> >> > > >> >> >> > > >> >> >> http://localhost:8080/HelloWorldWebServices/services/HelloWorldPort/getG= r >> >> >> > > ee >> >> >> > > >> >> >> > > > ting< >> >> >> > > >> >> >> > > >> >> http://localhost:8080/HelloWorldWebServices/services/HelloWorldPort/g= e >> >> >> > > >> >> >> > > > tGreeting1?arg0=3DManoel> >> >> >> > > > >> >> >> > > > Now I want that any other request method which does not exis= t >> in >> >> my >> >> >> > > > web >> >> >> > > > service (for example getGreetingMe()) is redirected to >> >> getGreeting() >> >> >> > > > as >> >> >> > > >> >> >> > > the >> >> >> > > >> >> >> > > > address above. >> >> >> > > > >> >> >> > > > How should I tackle this idea? >> >> >> > > >> >> >> > > If =A0this is just for the "GET" requests, it shouldn't be too >> hard. >> >> >> > > >> >> >> > > String path =3D (String)message.get(Message.PATH_INFO); >> >> >> > > String basePath =3D (String)message.get(Message.BASE_PATH); >> >> >> > > String query =3D (String)message.get(Message.QUERY_STRING); >> >> >> > > >> >> >> > > would get you the values that were sent in. =A0You would just = need >> to >> >> >> > > reset >> >> >> > > them >> >> >> > > to the "getGreeting" versions of those via message.put(...) ty= pe >> >> >> > > things. >> >> >> > > >> >> >> > > -- >> >> >> > > Daniel Kulp >> >> >> > > dkulp@apache.org >> >> >> > > http://dankulp.com/blog >> >> >> >> >> >> -- >> >> >> Daniel Kulp >> >> >> dkulp@apache.org >> >> >> http://dankulp.com/blog >> >> > >> >> > >> >> >> > >> >