loanfund
Class ServiceResponse

java.lang.Object
  extended by loanfund.ServiceResponse

public class ServiceResponse
extends java.lang.Object

The class ServiceResponse is used to create the reponse message. It needs to create the header and the body. The body contains the service values. This also creates the tokens and a signature of the assertion.

Author:
Gunn Olaussen & Kirsti N. Torgersen

Field Summary
private  javax.xml.soap.SOAPEnvelope env
           
static java.lang.String GRANTED
           
private  java.lang.String inResponseTo
           
private  java.lang.String[][] labelsGB
           
private  java.lang.String[][] labelsNB
           
private  java.lang.String language
           
private  javax.xml.soap.SOAPMessage message
           
private static java.lang.String ns
           
private static java.lang.String sb
           
static int STATUS_INDEX
           
 
Constructor Summary
ServiceResponse(java.lang.String inResponseTo, java.lang.String language)
          The constructor creates the message and initialises variables that are used in message creation.
 
Method Summary
 void createBody(java.lang.String[] values)
          When creating the body the method adds all the services in a ServiceList element which holds the content of the response.
private  void createHeader()
          This method creates the header by adding all the required fields such as the messageID, correlation and timestamp.
private  java.lang.String getCauseText(java.lang.String statuscode)
          Returns the cause text of the input code in the correct language
 javax.xml.soap.SOAPMessage getMessage()
           
private  java.lang.String getStatusText(java.lang.String statuscode)
          Returns the status text of the input code in the correct language
 java.lang.String toString()
          Returns a string representation of this request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_INDEX

public static final int STATUS_INDEX
See Also:
Constant Field Values

GRANTED

public static final java.lang.String GRANTED
See Also:
Constant Field Values

ns

private static final java.lang.String ns
See Also:
Constant Field Values

sb

private static final java.lang.String sb
See Also:
Constant Field Values

env

private javax.xml.soap.SOAPEnvelope env

message

private javax.xml.soap.SOAPMessage message

inResponseTo

private java.lang.String inResponseTo

language

private java.lang.String language

labelsGB

private java.lang.String[][] labelsGB

labelsNB

private java.lang.String[][] labelsNB
Constructor Detail

ServiceResponse

public ServiceResponse(java.lang.String inResponseTo,
                       java.lang.String language)
                throws ServiceRequestException
The constructor creates the message and initialises variables that are used in message creation. It calls two other methods to create the header and body of the message.

Parameters:
inResponseTo - String The messageid of the request this is a response to
language - String The preferred language
Throws:
ServiceRequestException - If an error occurs that indicate we should make a fault message instead
Method Detail

createHeader

private void createHeader()
                   throws javax.xml.soap.SOAPException
This method creates the header by adding all the required fields such as the messageID, correlation and timestamp.

Throws:
javax.xml.soap.SOAPException

createBody

public void createBody(java.lang.String[] values)
                throws javax.xml.soap.SOAPException
When creating the body the method adds all the services in a ServiceList element which holds the content of the response.

Throws:
javax.xml.soap.SOAPException

getStatusText

private java.lang.String getStatusText(java.lang.String statuscode)
Returns the status text of the input code in the correct language


getCauseText

private java.lang.String getCauseText(java.lang.String statuscode)
Returns the cause text of the input code in the correct language


getMessage

public javax.xml.soap.SOAPMessage getMessage()
Returns:
SOAPMessage The service response message

toString

public java.lang.String toString()
Returns a string representation of this request.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()