uk.org.ogsadai.client.toolkit.soap
Class SOAPCall

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.soap.SOAPCall

public class SOAPCall
extends java.lang.Object

This class wraps an Axis Call object, invokes service operations and parses and maps incoming SOAP faults to OGSA-DAI client toolkit faults if a suitable mapping exists.

The fault classes are from uk.org.ogsadai.client.toolkit.service.faults.

Author:
The OGSA-DAI Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private static java.lang.String FAULT_LOCAL
          Axis fault local name.
private static java.lang.String FAULT_NS
          Axis fault namespace.
private static DAILogger LOG
          Logger object for logging in this class.
private  AttachmentManager mAttachmentManager
          Map with MIME Content-IDs as keys and DataHangler objects representing attachments
private  org.apache.axis.client.Call mCall
          Wrapped Axis Call<.code> object.
private static java.util.Properties mMappings
          Mappings from OGSA-DAI service faults to OGSA-DAI client toolkit fault classes.
private  org.apache.axis.client.Service mService
          Axis service object.
 
Constructor Summary
SOAPCall()
          Constructs a new SOAPCall object.
 
Method Summary
static void checkUnsupportedOperation(java.lang.String url, javax.xml.namespace.QName operationName, org.apache.axis.AxisFault e)
          Check if an Axis fault was caused by an attempt to invoke an operation unsupported by a service.
 AttachmentManager getAttachmentManager()
          Get the attachments map mapping Content-ID MIME Header values to Objects representing attachment data.
 org.apache.axis.client.Call getCall()
          Return the Axis Call object that is wrapped by this object.
private  java.lang.String getExceptionName(org.w3c.dom.Element[] details)
          Get the fault class name from an Axis fault if it exists.
private  org.apache.axis.AxisFault getMappedFault(org.w3c.dom.Element[] details)
          Map an Axis fault to a DAIFaultType if such a mapping exists.
 java.util.Vector invoke(java.lang.String destination, javax.xml.namespace.QName operation, org.apache.axis.message.SOAPBodyElement body)
          Invoke an operation on a service.
private  void processAttachments(org.apache.axis.Message message)
          Extratcs attachments from SOAP message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

LOG

private static final DAILogger LOG
Logger object for logging in this class.


FAULT_NS

private static final java.lang.String FAULT_NS
Axis fault namespace.

See Also:
Constant Field Values

FAULT_LOCAL

private static final java.lang.String FAULT_LOCAL
Axis fault local name.

See Also:
Constant Field Values

mService

private final org.apache.axis.client.Service mService
Axis service object.


mCall

private final org.apache.axis.client.Call mCall
Wrapped Axis Call<.code> object.


mAttachmentManager


private final AttachmentManager mAttachmentManager
Map with MIME Content-IDs as keys and DataHangler objects representing attachments


mMappings


private static final java.util.Properties mMappings
Mappings from OGSA-DAI service faults to OGSA-DAI client toolkit fault classes.

Constructor Detail

SOAPCall


public SOAPCall()
Constructs a new SOAPCall object.

Method Detail

getCall

public org.apache.axis.client.Call getCall()
Return the Axis Call object that is wrapped by this object.

Returns:
Axis Call object

invoke

public java.util.Vector invoke(java.lang.String destination,
                               javax.xml.namespace.QName operation,
                               org.apache.axis.message.SOAPBodyElement body)
                        throws DAIFaultType,
                               java.rmi.RemoteException,
                               ServiceCommsException
Invoke an operation on a service. Atachments present in t

Parameters:
destination - URL of the service.
operation - Qualified name of the operation to invoke.
body - Body of the SOAP message.
Returns:
a Vector of SOAPBodyElements.
Throws:
DAIFaultType - if a fault occurred which could be mapped to an OGSA-DAI client toolkit fault class.
java.rmi.RemoteException - if a fault occurs and it has no mapping to an OGSA-DAI client toolkit fault class or any other problem arises.
ServiceCommsException - if there was a problem communicating with the service

processAttachments

private void processAttachments(org.apache.axis.Message message)
                         throws SOAPAttachmentException
Extratcs attachments from SOAP message.

Parameters:
message - SOAP message.
Throws:
SOAPAttachmentException

getAttachmentManager

public AttachmentManager getAttachmentManager()
Get the attachments map mapping Content-ID MIME Header values to Objects representing attachment data.

Returns:
Attachments map.

getExceptionName

private java.lang.String getExceptionName(org.w3c.dom.Element[] details)
Get the fault class name from an Axis fault if it exists.

Parameters:
details - Fault details
Returns:
fault class name or null

getMappedFault


private org.apache.axis.AxisFault getMappedFault(org.w3c.dom.Element[] details)
Map an Axis fault to a DAIFaultType if such a mapping exists.

Parameters:
details - Details of the Axis fault.
Returns:
a DAIFaultType if the fault could be mapped or an AxisFault if the fault could not be mapped.

checkUnsupportedOperation

public static void checkUnsupportedOperation(java.lang.String url,
                                             javax.xml.namespace.QName operationName,
                                             org.apache.axis.AxisFault e)
                                      throws UnsupportedOperationException,
                                             ServiceCommsException
Check if an Axis fault was caused by an attempt to invoke an operation unsupported by a service.

Parameters:
url - Service URL
operationName - Qualified name of the operation
e - Axis fault thrown by service.
Throws:
UnsupportedOperationException - If e represents an unsupported operation fault.
ServiceCommsException - If e does not represent an unsupported operation fault.