axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erich Oliphant" <>
Subject Re: Accessing 'raw' document body.
Date Thu, 13 Mar 2003 07:15:14 GMT
I gave this a shot and I'm getting a weird message.  When the response comes back I get an
error indicating that there are no deserializers for the returned object.  If I comment the
setClientHandlers() call out it works fine.  I didn't think the Handlers would affect the
serialization process...

Anyone seen this?

  ----- Original Message ----- 
  From: Phil Bohnenkamp 
  To: '' 
  Sent: Wednesday, March 12, 2003 3:10 PM
  Subject: RE: Accessing 'raw' document body.

  Here is another way of doing it which I found convenient to use. Not sure if it is for better
or worse though:

  class SomeClass {

          org.apache.axis.client.Service myService = new org.apache.axis.client.Service; //
Initialize service and call objects normally
          org.apache.axis.client.Call call = new org.apache.axis.client.Call();

          Handler responseHandler = new CustomClientResponseHandler();

          // This is call to set your custom client handler
          call.setClientHandlers(null, responseHandler);

  public class CustomClientResponseHandler extends BasicHandler {

      // Function called before the response returns to Call object after invoke
      public void invoke(MessageContext msgContext) throws AxisFault
          String bodyXML = msgContext.getMessage().getSOAPPart().getEnvelope().getBody().toString();
          // Hand off to another program anyway you like. Don't have to work with string,
          // getBody() will return a SOAPBody object which extends a SOAPElement object
          // which extends a SOAPNode
    -----Original Message-----
    From: WALTERS,EUGENIO (HP-Boise,ex1) []
    Sent: Wednesday, March 12, 2003 1:45 PM
    Subject: RE: Accessing 'raw' document body.

    Well in that case you need to change the default engine of the service object that could
use to get the call object. You can add the handler there. It could look something like this
although I have never tried it:

    public class MyEngineConfiguration extends SimpleProvider
         MyEngineConfiguration ()
            this.deployTransport ("http", new CustomHandler);
        Handler getGlobalResonseHandler()
             return new CustomHandler();

    Service service = new Service (MyEngineConfiguration);
    Call call = service.createCall()

    Hope that helps
      -----Original Message-----
      From: Erich Oliphant []
      Sent: Wednesday, March 12, 2003 12:28 PM
      Subject: Re: Accessing 'raw' document body.

      But I thought the handlers only applied to the server side?  I need to get the doc body
with the client API.
        ----- Original Message ----- 
        From: WALTERS,EUGENIO (HP-Boise,ex1) 
        Sent: Wednesday, March 12, 2003 2:17 PM
        Subject: RE: Accessing 'raw' document body.

        You could use a response handler to retrieve the response message. 

        your deploy.wsdd could look something like this:

         <service name="test" provider="java:RPC">
           <handler type="java:CustomHandler">
            <parameter name="scope" value="scope"/>
          <parameter name="allowedMethods" value="*"/>
          <parameter name="className" value="ServiceClass"/>
          <parameter name="scope" value="scope"/>

        your handler could look some thing like 

        public class CustomHandler extends BasicHandler
            public void invoke (MessageContext messageContext)
                Message responseMessage = messageContext.getResponseMessage();
          -----Original Message-----
          From: Erich Oliphant []
          Sent: Wednesday, March 12, 2003 12:04 PM
          Subject: Accessing 'raw' document body.

          I am using Axis to make calls against a SOAP service that uses document style messaging.
 The Axis classes make it much easier to send requests and deal w/ the responses.  I have
one situation where I need do several request/replies but I need to hand the unparsed response
document body off to another program in the last step.  Is there any easy way to do this?

View raw message