You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Simon Fell <sf...@salesforce.com> on 2004/10/13 00:54:19 UTC

RE: capturing SOAP XML in a client for debug?

Thanks, now if only createCall wasn't private so I could do this in a
subclass instead of having to alter generated code.

Cheers
Simon

> -----Original Message-----
> From: Peter Smith [mailto:peters@fast.fujitsu.com.au] 
> Sent: Monday, October 11, 2004 7:40 PM
> To: axis-user@ws.apache.org
> Subject: Re: capturing SOAP XML in a client for debug?
> 
> I could achieve the same thing programatically by simply 
> modifying the generated Stub as follows:
> 
> BEFORE
> 
>     public int times(int in0, int in1) throws 
> java.rmi.RemoteException {
>         if (super.cachedEndpoint == null) {
>             throw new org.apache.axis.NoEndPointException();
>         }
>         org.apache.axis.client.Call _call = createCall();
>         _call.setOperation(_operations[0]);
>         _call.setUseSOAPAction(true);
>         ... blah blah blah
> 
> AFTER
> 
>     public int times(int in0, int in1) throws 
> java.rmi.RemoteException {
>         if (super.cachedEndpoint == null) {
>             throw new org.apache.axis.NoEndPointException();
>         }
>         org.apache.axis.client.Call _call = createCall();
>         //PS - start
>         org.apache.axis.Handler reqHandler = new 
> org.apache.axis.handlers.LogHandler();
>         org.apache.axis.Handler respHandler = new 
> org.apache.axis.handlers.LogHandler();
>         _call.setClientHandlers(reqHandler, respHandler);
>         //PS - end
>         _call.setOperation(_operations[0]);
>         _call.setUseSOAPAction(true);
>         ...blah blah blah
> 
> ~~~
> 
> I am a newbie to axis & web services so I hope somebody else 
> can comment if modifying stubs in this way is acceptable 
> practice or a total hack ;-)
> 
> Cheers,
> Peter.
> 
> ----- Original Message -----
> From: "Simon Fell" <sf...@salesforce.com>
> To: <ax...@ws.apache.org>
> Sent: Tuesday, October 12, 2004 6:24 AM
> Subject: RE: capturing SOAP XML in a client for debug?
> 
> 
> > Does anyone know if there a way to do this programmatically at the
> > client ?
> >
> > Thanks
> > Simon
> >
> > > -----Original Message-----
> > > From: Nelson Minar [mailto:nelson@monkey.org]
> > > Sent: Friday, October 08, 2004 11:18 AM
> > > To: axis-user@ws.apache.org
> > > Subject: Re: capturing SOAP XML in a client for debug?
> > >
> > > >Thanks for all the suggestions - I particularly like the
> > > idea of giving
> > > >them a client WSDD that includes the log handler.
> > >
> > > This was easier than I thought. But iff there are any docs on
> > > how this works, I couldn't find them. One caveat - if you
> > > provide your own client config then you lose the default HTTP
> > > and local transports, so you have to configure them here. I
> > > left out the local transport in this example.
> > >
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > >
> > > <!-- Save this file as "client-config.wsdd" in the 
> working directory
> > >      of your Axis client. Axis will load it automatically. The
> > >      configuration here tells Axis to save all incoming 
> and outgoing
> > >      XML into a file named "axis.log"
> > > -->
> > >
> > > <deployment
> > >     xmlns="http://xml.apache.org/axis/wsdd/"
> > >     xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> > >
> > >   <handler name="log"
> > > type="java:org.apache.axis.handlers.LogHandler"/>
> > >
> > >   <globalConfiguration>
> > >     <requestFlow>
> > >       <handler type="log"/>
> > >     </requestFlow>
> > >     <responseFlow>
> > >       <handler type="log"/>
> > >     </responseFlow>
> > >   </globalConfiguration>
> > >
> > >   <transport
> > >       name="http"
> > >       pivot="java:org.apache.axis.transport.http.HTTPSender"/>
> > >
> > > </deployment>
> > >
> > >
> >
> 
> This is an email from Fujitsu Australia Software Technology 
> Pty Ltd, ABN 27 003 693 481. It is confidential to the 
> ordinary user of the email address to which it was addressed 
> and may contain copyright and/or legally privileged 
> information. No one else may read, print, store, copy or 
> forward all or any of it or its attachments. If you receive 
> this email in error, please return to sender. Thank you.
> 
> If you do not wish to receive commercial email messages from 
> Fujitsu Australia Software Technology Pty Ltd, please email 
> unsubscribe@fast.fujitsu.com.au
> 
> 
> 

Re: capturing SOAP XML in a client for debug?

Posted by Davanum Srinivas <da...@gmail.com>.
done. i feel like a genie today :)


On Tue, 12 Oct 2004 15:54:19 -0700, Simon Fell <sf...@salesforce.com> wrote:
> Thanks, now if only createCall wasn't private so I could do this in a
> subclass instead of having to alter generated code.
> 
> Cheers
> Simon
> 
> 
> 
> > -----Original Message-----
> > From: Peter Smith [mailto:peters@fast.fujitsu.com.au]
> > Sent: Monday, October 11, 2004 7:40 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: capturing SOAP XML in a client for debug?
> >
> > I could achieve the same thing programatically by simply
> > modifying the generated Stub as follows:
> >
> > BEFORE
> >
> >     public int times(int in0, int in1) throws
> > java.rmi.RemoteException {
> >         if (super.cachedEndpoint == null) {
> >             throw new org.apache.axis.NoEndPointException();
> >         }
> >         org.apache.axis.client.Call _call = createCall();
> >         _call.setOperation(_operations[0]);
> >         _call.setUseSOAPAction(true);
> >         ... blah blah blah
> >
> > AFTER
> >
> >     public int times(int in0, int in1) throws
> > java.rmi.RemoteException {
> >         if (super.cachedEndpoint == null) {
> >             throw new org.apache.axis.NoEndPointException();
> >         }
> >         org.apache.axis.client.Call _call = createCall();
> >         //PS - start
> >         org.apache.axis.Handler reqHandler = new
> > org.apache.axis.handlers.LogHandler();
> >         org.apache.axis.Handler respHandler = new
> > org.apache.axis.handlers.LogHandler();
> >         _call.setClientHandlers(reqHandler, respHandler);
> >         //PS - end
> >         _call.setOperation(_operations[0]);
> >         _call.setUseSOAPAction(true);
> >         ...blah blah blah
> >
> > ~~~
> >
> > I am a newbie to axis & web services so I hope somebody else
> > can comment if modifying stubs in this way is acceptable
> > practice or a total hack ;-)
> >
> > Cheers,
> > Peter.
> >
> > ----- Original Message -----
> > From: "Simon Fell" <sf...@salesforce.com>
> > To: <ax...@ws.apache.org>
> > Sent: Tuesday, October 12, 2004 6:24 AM
> > Subject: RE: capturing SOAP XML in a client for debug?
> >
> >
> > > Does anyone know if there a way to do this programmatically at the
> > > client ?
> > >
> > > Thanks
> > > Simon
> > >
> > > > -----Original Message-----
> > > > From: Nelson Minar [mailto:nelson@monkey.org]
> > > > Sent: Friday, October 08, 2004 11:18 AM
> > > > To: axis-user@ws.apache.org
> > > > Subject: Re: capturing SOAP XML in a client for debug?
> > > >
> > > > >Thanks for all the suggestions - I particularly like the
> > > > idea of giving
> > > > >them a client WSDD that includes the log handler.
> > > >
> > > > This was easier than I thought. But iff there are any docs on
> > > > how this works, I couldn't find them. One caveat - if you
> > > > provide your own client config then you lose the default HTTP
> > > > and local transports, so you have to configure them here. I
> > > > left out the local transport in this example.
> > > >
> > > >
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > >
> > > > <!-- Save this file as "client-config.wsdd" in the
> > working directory
> > > >      of your Axis client. Axis will load it automatically. The
> > > >      configuration here tells Axis to save all incoming
> > and outgoing
> > > >      XML into a file named "axis.log"
> > > > -->
> > > >
> > > > <deployment
> > > >     xmlns="http://xml.apache.org/axis/wsdd/"
> > > >     xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> > > >
> > > >   <handler name="log"
> > > > type="java:org.apache.axis.handlers.LogHandler"/>
> > > >
> > > >   <globalConfiguration>
> > > >     <requestFlow>
> > > >       <handler type="log"/>
> > > >     </requestFlow>
> > > >     <responseFlow>
> > > >       <handler type="log"/>
> > > >     </responseFlow>
> > > >   </globalConfiguration>
> > > >
> > > >   <transport
> > > >       name="http"
> > > >       pivot="java:org.apache.axis.transport.http.HTTPSender"/>
> > > >
> > > > </deployment>
> > > >
> > > >
> > >
> >
> > This is an email from Fujitsu Australia Software Technology
> > Pty Ltd, ABN 27 003 693 481. It is confidential to the
> > ordinary user of the email address to which it was addressed
> > and may contain copyright and/or legally privileged
> > information. No one else may read, print, store, copy or
> > forward all or any of it or its attachments. If you receive
> > this email in error, please return to sender. Thank you.
> >
> > If you do not wish to receive commercial email messages from
> > Fujitsu Australia Software Technology Pty Ltd, please email
> > unsubscribe@fast.fujitsu.com.au
> >
> >
> >
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

Re: capturing SOAP XML in a client for debug?

Posted by Davanum Srinivas <da...@gmail.com>.
done. i feel like a genie today :)


On Tue, 12 Oct 2004 15:54:19 -0700, Simon Fell <sf...@salesforce.com> wrote:
> Thanks, now if only createCall wasn't private so I could do this in a
> subclass instead of having to alter generated code.
> 
> Cheers
> Simon
> 
> 
> 
> > -----Original Message-----
> > From: Peter Smith [mailto:peters@fast.fujitsu.com.au]
> > Sent: Monday, October 11, 2004 7:40 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: capturing SOAP XML in a client for debug?
> >
> > I could achieve the same thing programatically by simply
> > modifying the generated Stub as follows:
> >
> > BEFORE
> >
> >     public int times(int in0, int in1) throws
> > java.rmi.RemoteException {
> >         if (super.cachedEndpoint == null) {
> >             throw new org.apache.axis.NoEndPointException();
> >         }
> >         org.apache.axis.client.Call _call = createCall();
> >         _call.setOperation(_operations[0]);
> >         _call.setUseSOAPAction(true);
> >         ... blah blah blah
> >
> > AFTER
> >
> >     public int times(int in0, int in1) throws
> > java.rmi.RemoteException {
> >         if (super.cachedEndpoint == null) {
> >             throw new org.apache.axis.NoEndPointException();
> >         }
> >         org.apache.axis.client.Call _call = createCall();
> >         //PS - start
> >         org.apache.axis.Handler reqHandler = new
> > org.apache.axis.handlers.LogHandler();
> >         org.apache.axis.Handler respHandler = new
> > org.apache.axis.handlers.LogHandler();
> >         _call.setClientHandlers(reqHandler, respHandler);
> >         //PS - end
> >         _call.setOperation(_operations[0]);
> >         _call.setUseSOAPAction(true);
> >         ...blah blah blah
> >
> > ~~~
> >
> > I am a newbie to axis & web services so I hope somebody else
> > can comment if modifying stubs in this way is acceptable
> > practice or a total hack ;-)
> >
> > Cheers,
> > Peter.
> >
> > ----- Original Message -----
> > From: "Simon Fell" <sf...@salesforce.com>
> > To: <ax...@ws.apache.org>
> > Sent: Tuesday, October 12, 2004 6:24 AM
> > Subject: RE: capturing SOAP XML in a client for debug?
> >
> >
> > > Does anyone know if there a way to do this programmatically at the
> > > client ?
> > >
> > > Thanks
> > > Simon
> > >
> > > > -----Original Message-----
> > > > From: Nelson Minar [mailto:nelson@monkey.org]
> > > > Sent: Friday, October 08, 2004 11:18 AM
> > > > To: axis-user@ws.apache.org
> > > > Subject: Re: capturing SOAP XML in a client for debug?
> > > >
> > > > >Thanks for all the suggestions - I particularly like the
> > > > idea of giving
> > > > >them a client WSDD that includes the log handler.
> > > >
> > > > This was easier than I thought. But iff there are any docs on
> > > > how this works, I couldn't find them. One caveat - if you
> > > > provide your own client config then you lose the default HTTP
> > > > and local transports, so you have to configure them here. I
> > > > left out the local transport in this example.
> > > >
> > > >
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > >
> > > > <!-- Save this file as "client-config.wsdd" in the
> > working directory
> > > >      of your Axis client. Axis will load it automatically. The
> > > >      configuration here tells Axis to save all incoming
> > and outgoing
> > > >      XML into a file named "axis.log"
> > > > -->
> > > >
> > > > <deployment
> > > >     xmlns="http://xml.apache.org/axis/wsdd/"
> > > >     xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> > > >
> > > >   <handler name="log"
> > > > type="java:org.apache.axis.handlers.LogHandler"/>
> > > >
> > > >   <globalConfiguration>
> > > >     <requestFlow>
> > > >       <handler type="log"/>
> > > >     </requestFlow>
> > > >     <responseFlow>
> > > >       <handler type="log"/>
> > > >     </responseFlow>
> > > >   </globalConfiguration>
> > > >
> > > >   <transport
> > > >       name="http"
> > > >       pivot="java:org.apache.axis.transport.http.HTTPSender"/>
> > > >
> > > > </deployment>
> > > >
> > > >
> > >
> >
> > This is an email from Fujitsu Australia Software Technology
> > Pty Ltd, ABN 27 003 693 481. It is confidential to the
> > ordinary user of the email address to which it was addressed
> > and may contain copyright and/or legally privileged
> > information. No one else may read, print, store, copy or
> > forward all or any of it or its attachments. If you receive
> > this email in error, please return to sender. Thank you.
> >
> > If you do not wish to receive commercial email messages from
> > Fujitsu Australia Software Technology Pty Ltd, please email
> > unsubscribe@fast.fujitsu.com.au
> >
> >
> >
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

Re: capturing SOAP XML in a client for debug?

Posted by Peter Smith <pe...@fast.fujitsu.com.au>.
Looking at the axis source code I noticed the implementation of
Call.setClientHandlers makes a SOAPService with a null pivot Handler
[Call.java] so I don't understand how the request and response log handlers
are actually identified as really being "request" or "response" handlers
when there is no "PivotIndicator" in the handler chain sitting between them.
I was wondering if something is not quite right here [possibly in the
SimpleTargetedChain.init method]

More evidence that something maybe is amiss can be seen when I used the
setClientHandlers code as described below (passing both request & response
handlers) because although I see the SOAP logging I don't see any "Elapsed"
timing information in the log. According to the LogHandler
javadoc/implementation the timing information only appears when the handler
is deploy in *both* request and response flows.

Is this a real problem or have I fooled myself ?

Thanks,
Peter.

----- Original Message ----- 
From: "Simon Fell" <sf...@salesforce.com>
To: <ax...@ws.apache.org>; <ax...@ws.apache.org>
Sent: Wednesday, October 13, 2004 8:54 AM
Subject: RE: capturing SOAP XML in a client for debug?


> Thanks, now if only createCall wasn't private so I could do this in a
> subclass instead of having to alter generated code.
>
> Cheers
> Simon
>
> > -----Original Message-----
> > From: Peter Smith [mailto:peters@fast.fujitsu.com.au]
> > Sent: Monday, October 11, 2004 7:40 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: capturing SOAP XML in a client for debug?
> >
> > I could achieve the same thing programatically by simply
> > modifying the generated Stub as follows:
> >
> > BEFORE
> >
> >     public int times(int in0, int in1) throws
> > java.rmi.RemoteException {
> >         if (super.cachedEndpoint == null) {
> >             throw new org.apache.axis.NoEndPointException();
> >         }
> >         org.apache.axis.client.Call _call = createCall();
> >         _call.setOperation(_operations[0]);
> >         _call.setUseSOAPAction(true);
> >         ... blah blah blah
> >
> > AFTER
> >
> >     public int times(int in0, int in1) throws
> > java.rmi.RemoteException {
> >         if (super.cachedEndpoint == null) {
> >             throw new org.apache.axis.NoEndPointException();
> >         }
> >         org.apache.axis.client.Call _call = createCall();
> >         //PS - start
> >         org.apache.axis.Handler reqHandler = new
> > org.apache.axis.handlers.LogHandler();
> >         org.apache.axis.Handler respHandler = new
> > org.apache.axis.handlers.LogHandler();
> >         _call.setClientHandlers(reqHandler, respHandler);
> >         //PS - end
> >         _call.setOperation(_operations[0]);
> >         _call.setUseSOAPAction(true);
> >         ...blah blah blah
> >
> > ~~~
> >
> > I am a newbie to axis & web services so I hope somebody else
> > can comment if modifying stubs in this way is acceptable
> > practice or a total hack ;-)
> >
> > Cheers,
> > Peter.
> >
> > ----- Original Message -----
> > From: "Simon Fell" <sf...@salesforce.com>
> > To: <ax...@ws.apache.org>
> > Sent: Tuesday, October 12, 2004 6:24 AM
> > Subject: RE: capturing SOAP XML in a client for debug?
> >
> >
> > > Does anyone know if there a way to do this programmatically at the
> > > client ?
> > >
> > > Thanks
> > > Simon
> > >
> > > > -----Original Message-----
> > > > From: Nelson Minar [mailto:nelson@monkey.org]
> > > > Sent: Friday, October 08, 2004 11:18 AM
> > > > To: axis-user@ws.apache.org
> > > > Subject: Re: capturing SOAP XML in a client for debug?
> > > >
> > > > >Thanks for all the suggestions - I particularly like the
> > > > idea of giving
> > > > >them a client WSDD that includes the log handler.
> > > >
> > > > This was easier than I thought. But iff there are any docs on
> > > > how this works, I couldn't find them. One caveat - if you
> > > > provide your own client config then you lose the default HTTP
> > > > and local transports, so you have to configure them here. I
> > > > left out the local transport in this example.
> > > >
> > > >
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > >
> > > > <!-- Save this file as "client-config.wsdd" in the
> > working directory
> > > >      of your Axis client. Axis will load it automatically. The
> > > >      configuration here tells Axis to save all incoming
> > and outgoing
> > > >      XML into a file named "axis.log"
> > > > -->
> > > >
> > > > <deployment
> > > >     xmlns="http://xml.apache.org/axis/wsdd/"
> > > >     xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> > > >
> > > >   <handler name="log"
> > > > type="java:org.apache.axis.handlers.LogHandler"/>
> > > >
> > > >   <globalConfiguration>
> > > >     <requestFlow>
> > > >       <handler type="log"/>
> > > >     </requestFlow>
> > > >     <responseFlow>
> > > >       <handler type="log"/>
> > > >     </responseFlow>
> > > >   </globalConfiguration>
> > > >
> > > >   <transport
> > > >       name="http"
> > > >       pivot="java:org.apache.axis.transport.http.HTTPSender"/>
> > > >
> > > > </deployment>
> > > >
> > > >
> > >
> >
> > This is an email from Fujitsu Australia Software Technology
> > Pty Ltd, ABN 27 003 693 481. It is confidential to the
> > ordinary user of the email address to which it was addressed
> > and may contain copyright and/or legally privileged
> > information. No one else may read, print, store, copy or
> > forward all or any of it or its attachments. If you receive
> > this email in error, please return to sender. Thank you.
> >
> > If you do not wish to receive commercial email messages from
> > Fujitsu Australia Software Technology Pty Ltd, please email
> > unsubscribe@fast.fujitsu.com.au
> >
> >
> >
>

This is an email from Fujitsu Australia Software Technology Pty Ltd, ABN 27 003 693 481. It is confidential to the ordinary user of the email address to which it was addressed and may contain copyright and/or legally privileged information. No one else may read, print, store, copy or forward all or any of it or its attachments. If you receive this email in error, please return to sender. Thank you.

If you do not wish to receive commercial email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.fujitsu.com.au