Hi

No problems. I'll comment a bit.

>Having a custom CXF invoker is probably one option, it should be able to
> ensure the right Method is invoked,

CXF invokers can 'decorate' a bit the way the invocation is done, but this
is probably not an option after all for your case because I think
CXFInvokers are already presented with the Java Method instance, so if
there's no greetMe2() method then the (custom) JAXWS invoker will not even
be invoked

> another option is to register a custom CXF ServletFilter which would
provide
> a custom HttpServletRequest which would in turn manipulate the request
body
> such that CXF is made to believe it is getGreeting() which has to be
> invoked.

This is not a CXF specific option. It's all about registering a custom
Servlet filter which will ensure that
the CXF stack always sees "getGreeting" by efficiently manipulating the
request body and relying on things like HttpServletRequestWrapper.

> 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
will
> make CXF to invoke getGreeting.

Pursuing this option will help you to know CXF better :-) and it can
actually be the most effective option.
I wish I could give you more info which CXF Soap interceptors determine the
method - but I don't know right now :-), it may depend on the
binding/transport being used, etc

cheers, Sergey


On Mon, Dec 6, 2010 at 9:16 AM, Manoel Farrugia <[email protected]>wrote:

> 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 <[email protected]>
> wrote:
> > 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
> provide
> > a custom HttpServletRequest which would in turn manipulate the request
> body
> > 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
> will
> > make CXF to invoke getGreeting.
> >
> > Sergey
> >
> >
> > On Thu, Dec 2, 2010 at 10:37 AM, Manoel Farrugia <[email protected]
> >wrote:
> >
> >> 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 <[email protected]
> >
> >> wrote:
> >> > Do you actually have getGreeting2 implemented ? Example, do you have
> two
> >> > 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 <
> [email protected]
> >> >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 <
> [email protected]>
> >> >> wrote:
> >> >> > I am not restricted to handleFault only. I want to redirect any
> wrong
> >> >> > methods to getGreeting() method.
> >> >> >
> >> >> > On Wed, Dec 1, 2010 at 8:07 PM, Daniel Kulp <[email protected]>
> wrote:
> >> >> >>
> >> >> >> On Wednesday 01 December 2010 5:49:41 am Manoel Farrugia wrote:
> >> >> >> > Something like this:
> >> >> >> >
> >> >> >> > public void handleFault(Message message) {
> >> >> >> >
>  System.out.println("------FAAAAAUUUUUUUULLLLLLTTTTTT-------");
> >> >> >> >
> >> >> >> >      String path = (String)message.get(Message.PATH_INFO);
> >> >> >> >      String basePath = (String)message.get(Message.BASE_PATH);
> >> >> >> >      String query = (String)message.get(Message.QUERY_STRING);
> >> >> >> >      System.out.println("Path: "+path+". BasePath: "+basePath+".
> >> >> Query:
> >> >> >> > "+query+".");
> >> >> >> >
>  System.out.println("------FAAAAAUUUUUUUULLLLLLTTTTTT-------");
> >> >> >> >
> >> >> >> >      message.put(Message.PATH_INFO,
> >> >> >> > "/HelloWorldWebServices/HelloWorldPort/getGreeting");
> >> >> >> >
> >> >> >> >      path = (String)message.get(Message.PATH_INFO);
> >> >> >> >      System.out.println("NEW PATH: "+path);
> >> >> >> >     }
> >> >> >> >
> >> >> >> > 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?   Hmm...  No idea really.
> >> >> >>
> >> >> >> You  could TRY to do something like
> >> >> >> message.getInterceptorChain().reset();
> >> >> >> message.getIntercetporChain().processMessage(message);
> >> >> >> message.getInterceptorChain().pause();
> >> >> >>
> >> >> >> or similar.  I really have no idea what that would do.   Honestly,
> >> once
> >> >> >> the
> >> >> >> fault occurs, things are somewhat left in an unpredictable state
> and
> >> I'm
> >> >> >> not
> >> >> >> sure what would happen.
> >> >> >>
> >> >> >> Dan
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> >
> >> >> >> > On Tue, Nov 30, 2010 at 10:01 PM, Daniel Kulp <[email protected]
> >
> >> >> 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/getGr
> >> >> >> > > ee
> >> >> >> > >
> >> >> >> > > > ting<
> >> >> >> > >
> >> >> >> > >
> >> >>
> http://localhost:8080/HelloWorldWebServices/services/HelloWorldPort/ge
> >> >> >> > >
> >> >> >> > > > tGreeting1?arg0=Manoel>
> >> >> >> > > >
> >> >> >> > > > Now I want that any other request method which does not
> exist
> >> in
> >> >> my
> >> >> >> > > > web
> >> >> >> > > > service (for example getGreetingMe()) is redirected to
> >> >> getGreeting()
> >> >> >> > > > as
> >> >> >> > >
> >> >> >> > > the
> >> >> >> > >
> >> >> >> > > > address above.
> >> >> >> > > >
> >> >> >> > > > How should I tackle this idea?
> >> >> >> > >
> >> >> >> > > If  this is just for the "GET" requests, it shouldn't be too
> >> hard.
> >> >> >> > >
> >> >> >> > > String path = (String)message.get(Message.PATH_INFO);
> >> >> >> > > String basePath = (String)message.get(Message.BASE_PATH);
> >> >> >> > > String query = (String)message.get(Message.QUERY_STRING);
> >> >> >> > >
> >> >> >> > > would get you the values that were sent in.  You would just
> need
> >> to
> >> >> >> > > reset
> >> >> >> > > them
> >> >> >> > > to the "getGreeting" versions of those via message.put(...)
> type
> >> >> >> > > things.
> >> >> >> > >
> >> >> >> > > --
> >> >> >> > > Daniel Kulp
> >> >> >> > > [email protected]
> >> >> >> > > http://dankulp.com/blog
> >> >> >>
> >> >> >> --
> >> >> >> Daniel Kulp
> >> >> >> [email protected]
> >> >> >> http://dankulp.com/blog
> >> >> >
> >> >> >
> >> >>
> >> >
> >>
> >
>

Reply via email to