net.ivoa.registry.search
Class MessagePrintingServiceCaller

java.lang.Object
  extended by net.ivoa.registry.search.DefaultServiceCaller
      extended by net.ivoa.registry.search.MessagePrintingServiceCaller
All Implemented Interfaces:
ServiceCaller

public class MessagePrintingServiceCaller
extends DefaultServiceCaller

a ServiceCaller that will print the SOAP messages to an OutputStream. This is useful for debugging service communication.


Field Summary
 
Fields inherited from class net.ivoa.registry.search.DefaultServiceCaller
conn, GENERAL_FAULT, NOT_FOUND_FAULT, SOAP_NS, UNSUPPORTED_OPERATION_FAULT
 
Constructor Summary
MessagePrintingServiceCaller()
          create a default ServiceCaller object
MessagePrintingServiceCaller(SOAPConnection connection, java.net.URL endpoint)
          create a default ServiceCaller object
MessagePrintingServiceCaller(java.net.URL endpoint)
          create a default ServiceCaller object
 
Method Summary
 org.w3c.dom.Element call(SOAPMessage msg, java.lang.String actionURI)
          call the SOAP service and return the content of the body the SOAP response.
 java.io.OutputStream getMessageDestination()
          return the stream that messages are being sent to
 void setMessageDestination(java.io.OutputStream strm)
          set the stream to send the messages to.
 
Methods inherited from class net.ivoa.registry.search.DefaultServiceCaller
checkForFaults, extractContent, getEndpoint, getMessage, getReplyFromCall, setEndpoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessagePrintingServiceCaller

public MessagePrintingServiceCaller(SOAPConnection connection,
                                    java.net.URL endpoint)
create a default ServiceCaller object

Parameters:
connection - the SOAPConnection object to use to connect to the service. If null, a default connection will be created.
endpoint - the service's endpoint URL.

MessagePrintingServiceCaller

public MessagePrintingServiceCaller(java.net.URL endpoint)
create a default ServiceCaller object

Parameters:
endpoint - the service's endpoint URL

MessagePrintingServiceCaller

public MessagePrintingServiceCaller()
create a default ServiceCaller object

Method Detail

setMessageDestination

public void setMessageDestination(java.io.OutputStream strm)
set the stream to send the messages to.

Parameters:
strm - the destination OutputStream; if null, System.err is set.

getMessageDestination

public java.io.OutputStream getMessageDestination()
return the stream that messages are being sent to


call

public org.w3c.dom.Element call(SOAPMessage msg,
                                java.lang.String actionURI)
                         throws RegistryServiceException,
                                SOAPException
call the SOAP service and return the content of the body the SOAP response. This assumes a wrapped document message style in which the body contains a single child element.

Specified by:
call in interface ServiceCaller
Overrides:
call in class DefaultServiceCaller
Parameters:
msg - the input SOAP message to send
action - the SOAP action URI to use
Throws:
SOAPException - if an error occurs while handling the SOAP.
RegistryServiceException - if any errors occurs while communicating with the service.