org.apache.cocoon.reading
Class AxisRPCReader

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.reading.AbstractReader
          extended by org.apache.cocoon.reading.ServiceableReader
              extended by org.apache.cocoon.reading.AxisRPCReader
All Implemented Interfaces:
Poolable, Recyclable, Disposable, Component, Configurable, LogEnabled, Serviceable, Reader, SitemapModelComponent, SitemapOutputComponent

public class AxisRPCReader
extends ServiceableReader
implements Configurable, Disposable

SOAP Reader

This reader accepts a SOAP Request, and generates the resultant response as output. Essentially, this reader allows you to serve SOAP requests from your Cocoon application.

Code originates from the Apache AXIS project, org.apache.axis.http.transport.AxisServlet.

Ported to Cocoon by:

Version:
CVS $Id: AxisRPCReader.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Marcus Crafter Original AxisServlet authors:, Steve Loughran, Doug Davis

Field Summary
 
Fields inherited from class org.apache.cocoon.reading.ServiceableReader
manager
 
Fields inherited from class org.apache.cocoon.reading.AbstractReader
objectModel, out, parameters, resolver, source
 
Fields inherited from interface org.apache.cocoon.reading.Reader
ROLE
 
Constructor Summary
AxisRPCReader()
           
 
Method Summary
 void configure(Configuration config)
           
 void dispose()
          Dispose this reader.
 void generate()
          Axis RPC Router generate method.
protected  int getHttpServletResponseStatus(org.apache.axis.AxisFault af)
          Extract information from AxisFault and map it to a HTTP Status code.
protected  void processAxisFault(org.apache.axis.AxisFault fault)
          routine called whenever an axis fault is caught; where they are logged and any other business.
 void service(ServiceManager manager)
           
 void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters)
          Axis RPC Router setup method.
 
Methods inherited from class org.apache.cocoon.reading.AbstractReader
getLastModified, getMimeType, recycle, setOutputStream, shouldSetContentLength
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxisRPCReader

public AxisRPCReader()
Method Detail

configure

public void configure(Configuration config)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Overrides:
service in class ServiceableReader
Throws:
ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

setup

public void setup(SourceResolver resolver,
                  Map objectModel,
                  String src,
                  Parameters parameters)
           throws ProcessingException,
                  IOException,
                  SAXException
Axis RPC Router setup method.

This method sets the reader up for use. Essentially it checks that its been invoked in a HTTP-POST environment, reads some optional configuration variables, and obtains several component references to be used later.

Specified by:
setup in interface SitemapModelComponent
Overrides:
setup in class AbstractReader
Parameters:
resolver - SourceResolver instance
objectModel - request/response/context data
src - source String instance
parameters - sitemap invocation time customization parameters
Throws:
ProcessingException - if an error occurs
IOException - if an error occurs
SAXException - if an error occurs

generate

public void generate()
              throws IOException,
                     SAXException,
                     ProcessingException
Axis RPC Router generate method.

This method reads the SOAP request in from the input stream, invokes the requested method and sends the result back to the requestor

Specified by:
generate in interface Reader
Throws:
IOException - if an IO error occurs
SAXException - if a SAX error occurs
ProcessingException - if a processing error occurs

processAxisFault

protected void processAxisFault(org.apache.axis.AxisFault fault)
routine called whenever an axis fault is caught; where they are logged and any other business. The method may modify the fault in the process

Parameters:
fault - what went wrong.

getHttpServletResponseStatus

protected int getHttpServletResponseStatus(org.apache.axis.AxisFault af)
Extract information from AxisFault and map it to a HTTP Status code.

Parameters:
af - Axis Fault
Returns:
HTTP Status code.

dispose

public void dispose()
Dispose this reader. Release all held resources.

Specified by:
dispose in interface Disposable


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.