Hi,

thanks again for helping.

But I what I don't understand is, when just adding a DOMOut/InHandler to the client, at which point in my code can I access the MessageContext? As far as I understand, the MessageContext can only be accessed from within the DOMOut/InHandler's invoke() method.

As an alternative I tried to override the DOMOutHandler like this:
public class MyOutHandler extends DOMOutHandler {

        //...
        
        @Override
        public void invoke(MessageContext msgContext) throws Exception {
                
                super.invoke(msgContext);

                AbstractMessage msg = msgContext.getCurrentMessage();
                logger.debug(msg);
                Document doc = (Document) 
msg.getProperty(DOMOutHandler.DOM_MESSAGE);
                logger.debug(doc);

But then an Exception is thrown, so what can I do?

scatterwebservice_client.WebServiceOperationException: Failed retrieving network.
        at 
scatterwebservice_client.ServiceClient.getNetwork(ServiceClient.java:59)
at scatterwebservice_client.actions.RefreshAction.run(RefreshAction.java:38) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at 
org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
        at org.eclipse.core.launcher.Main.run(Main.java:977)
        at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Fau
lt: java.lang.NullPointerException
        at 
org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:92)
        at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
        at $Proxy12.getNetwork(Unknown Source)
        at 
scatterwebservice_client.ServiceClient.getNetwork(ServiceClient.java:56)
        ... 27 more
Caused by: org.codehaus.xfire.fault.XFireFault: Fault: java.lang.NullPointerException at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31) at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer.java:28) at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:111) at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at org.codehaus.xfire.client.Client.onReceive(Client.java:382)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
        at 
org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
        at org.codehaus.xfire.client.Client.invoke(Client.java:335)
        at 
org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
        ... 30 more


Andres Bernasconi schrieb:
sorry, typo..that was... ADD the standard DOMOutHandler to the list, OR call the super...

On 3/27/07, *Andres Bernasconi* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    first add the standard DOMOutHandler to the list, all call the
    super.invoke() method...just by extending it and overriding the
    invoke method you are doing nothing.


    On 3/27/07, * Abid Hussain* <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:

        Hi again,

        I now try to get the messages with the following DOMOutHandler
        (and did
        almost the same with the DOMInHandler):

        public class MyOutHandler extends DOMOutHandler {

                //...

                @Override
                public void invoke(MessageContext msgContext) throws
        Exception {

                        AbstractMessage msg =
        msgContext.getCurrentMessage();
                        logger.debug(msg);
                        Document doc = (Document)
        msg.getProperty(DOMOutHandler.DOM_MESSAGE);
                        logger.debug(doc);
                }
        }

        No I initialize my client with the following code:

        service = new ScatterwebServiceClient();
        port = service.getScatterwebServiceHttpPort ();
        Client client = Client.getInstance(port);
        client.addInHandler(new MyInHandler());
        client.addOutHandler(new MyOutHandler());

        Now I call a web service method (called "getNetwork") using:
        wsn = port.getNetwork();

        But the document which I want to log (see above
        logger.debug(doc)) is null.

        And this happens in both cases, when using the eclipse-plugin to
        generate code and when I do it using an ant task.

        How can this be respectively what am I doing wrong?

        Best regards,

        Abid


        >  Sorry, I forgot this:
        >
        >  In the xfire-FAQ it says that one adds a handler using
        >  GeoIPServiceClient service = new GeoIPServiceClient();
        >  GeoIPServiceSoap geoIPClient = service.getGeoIPServiceSoap();
        >  Client client = Client.getInstance(geoIPClient);
        >  client.addInHandler(new DOMOutHandler());
        >
        >  But in my ServiceClient (which i initialize: service = new
        >  ScatterwebServiceClient();) there is no method like
        >  service.get...ServiceSoap().
        >
        >  I somehow don't get it...:-(
        >
        >  Best regards,
        >
        >  Abid
        >
        > > Hi again,
        > >
        > > thanks for help.
        > > But I still don't get it. I'm using xfire 1.2.4 together with the
        > > Eclipse-Plugin for Codegeneration and there is no possibility
        to add a
        > > handler to my ...ServiceClient.
        > >
        > > May it be the case that in this version it works in another
        way (or
        > > doesn't work at all) than with the newer versions?
        > >
        > > Best regards,
        > >
        > > Abid
        > >
        > > Tomek Sztelak schrieb:
        > >> And you expected correctly, question was posted many times :)
        > >>
        > >> client.addInHandler(new
        org.codehaus.xfire.util.dom.DOMInHandler ());
        > >> client.addOutHandler(new
        org.codehaus.xfire.util.dom.DOMOutHandler());
        > >>
        > >> Then you can access current message with
        > >>
        > >> AbstractMessage sm = msgContext.getCurrentMessage ();
        > >>  Document doc = (Document)
        sm.getProperty(DOMInHandler.DOM_MESSAGE);
        > >>
        > >>
        > >> OutMessage msg = context.getOutMessage();
        > >> Document doc = (Document)
        msg.getProperty(DOMOutHandler.DOM_MESSAGE);
        > >>
        > >>
        > >> On 3/22/07, Abid Hussain < [EMAIL PROTECTED]
        <mailto:[EMAIL PROTECTED]>> wrote:
        > >>> Hi everybody,
        > >>>
        > >>> I would expect this question to be posted already in the
        past, but I
        > >>> didn't find anything when using google (the search in the
        archives
        > >>> doesn't work currently).
        > >>>
        > >>> I'm using xfire as client in a desktop application and
        would like to
        > >>> display the request/response SOAP Messages in the
        application's GUI.
        > >>>
        > >>> Is there a way to fetch those messages when incoming/outgoing?
        > >>>
        > >>> Best regards,
        > >>>
        > >>> Abid
        > >>>
        > >>> --
        > >>>
        > >>> Abid Hussain
        > >>> Mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
        > >>> Web: http://www.abid76.de <http://www.abid76.de>
        > >>>
        > >>>
        ---------------------------------------------------------------------
        > >>> To unsubscribe from this list please visit:
        > >>>
        > >>>     http://xircles.codehaus.org/manage_email
        > >>>
        > >>>
        > >>
        > >>
        > >
        >

        --

        Abid Hussain
        Mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
        Web: http://www.abid76.de

        ---------------------------------------------------------------------
        To unsubscribe from this list please visit:

            http://xircles.codehaus.org/manage_email




--

Abid Hussain
Mail: [EMAIL PROTECTED]
Web: http://www.abid76.de

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to