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