VistALink v1.6

gov.va.med.vistalink.rpc
Class RpcResponse

java.lang.Object
  extended by gov.va.med.vistalink.adapter.record.VistaLinkResponseVOImpl
      extended by gov.va.med.vistalink.rpc.RpcResponse
All Implemented Interfaces:
gov.va.med.vistalink.adapter.record.VistaLinkResponseVO

public class RpcResponse
extends gov.va.med.vistalink.adapter.record.VistaLinkResponseVOImpl

Represents a data structure which holds the response value(s).

It is extremely important that any code which might create a new RpcResponse be encased in a try catch block so that VistaLinkfaultException and FoundationsException can be caught.

J2SE Example:

//request and response objects
RpcRequest vReq = null;
RpcResponse vResp = null;

//The Rpc Context
String rpcContext = "XOBV VISTALINK TESTER";

//The Rpc to call
String rpcName = "XOBV TEST PING";

//Construct the request object
vReq = RpcRequestFactory.getRpcRequest(rpcContext, rpcName);

//Execute the Rpc and get the response
vResp = myConnection.executeRPC(vReq);

//Display the response
System.out.println(vResp.getRawResponse());


Method Summary
 java.lang.String getResults()
          Gets the results string for the returned data in this response.
 org.w3c.dom.Document getResultsDocument()
          Gets an XML Document format based on the contains of the results returned by the RPC.
 java.lang.String getResultsType()
          Gets the return type of the results sent back from the M VistAServer.
 void setResultsType(java.lang.String resultsType)
          Sets the resultsType.
 
Methods inherited from class gov.va.med.vistalink.adapter.record.VistaLinkResponseVOImpl
getDocument, getFilteredXml, getRawResponse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getResultsDocument

public org.w3c.dom.Document getResultsDocument()
                                        throws RpcResponseTypeIsNotXmlException,
                                               FoundationsException
Gets an XML Document format based on the contains of the results returned by the RPC.

Note: This XML document is created during the call to this method and not as part of the creation of the RpcResponse object.

If calling application wants to use this method, it should use generic xml DOM interfaces from org.w3c.dom.* package.

Alternatively if application wants to use this document in a specific XML parser implementation, parser should be able to create a specific Document implementation from org.w3c.dom.Document interface. In this case it might be better from performance standpiont to use getResults() and parse xml string directly.

Returns:
org.w3c.dom.Document
Throws:
RpcResponseTypeIsNotXmlException - results type must be 'xml'
FoundationsException

getResults

public java.lang.String getResults()
Gets the results string for the returned data in this response.

Returns:
String

getResultsType

public java.lang.String getResultsType()
Gets the return type of the results sent back from the M VistAServer. At the present time (04/2002) the possible types are 'string' or 'array'.

Returns:
String

setResultsType

public void setResultsType(java.lang.String resultsType)
Sets the resultsType.

Parameters:
resultsType - The resultsType to set
 
NOT FOR PUBLIC USE
This constructor, method or field is not for public use.

VistALink v1.6

VistALink v1.6