VLJ Iteration II, v. 1.0.0.193

gov.va.med.foundations.rpc
Class RpcResponse

java.lang.Object
  |
  +--VistaLinkResponseVOImpl
        |
        +--gov.va.med.foundations.rpc.RpcResponse

public class RpcResponse
extends 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

 

 // create the callback handler
 CallbackHandlerSwing cbhSwing = new CallbackHandlerSwing(myFrame);
 
 // create the LoginContext  
 loginContext = new LoginContext("Production", cbhSwing);
 
 // login to server
 loginContext.login(); 
 
 //Gets the principal that contains the VistaLinkConnection
 VistaKernelPrincipalImpl myPrincipal = VistaKernelPrincipalImpl.
 			getKernelPrincipal(loginContext.getSubject());
 
 //Get the VistaLinkConnection
 VistaLinkConnection myConnection = myPrincipal.getAuthenticatedConnection();
 
  //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());
 
 
 

Version:
1.0.0.193
Author:
Application Modernization - Foundations Team
See Also:
Serialized Form

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)
          Deprecated. This method will be removed after the REMOTE PROCEDURE (#8894) file adds an XML return type.
 
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)
Deprecated. This method will be removed after the REMOTE PROCEDURE (#8894) file adds an XML return type.

Sets the resultsType.

Parameters:
resultsType - The resultsType to set

VLJ Iteration II, v. 1.0.0.193

VistaLink Iteration II, v. 1.0.0.193