Methods Summary |
---|
private static java.lang.Exception | checkForPacket()
Exception rvalue = null;
try {
if (Class.forName("com.sun.xml.ws.api.message.Packet") != null &&
Class.forName("com.sun.xml.ws.api.message.Messages") != null) {
}
} catch (Exception e) {
// silently disables packet support
rvalue = e;
}
return rvalue;
|
public java.util.Map | getMap()Get the SOAP request object.
if (this.infoMap == null) {
this.infoMap = new HashMap();
}
return this.infoMap;
|
private java.lang.Object | getPacket(boolean isRequestPacket, boolean putDesired)Return the request Packet.
Object p = (this.infoMap == null ?
null : this.infoMap.get
(isRequestPacket ? REQ_PACKET : RES_PACKET));
if (putDesired) {
SOAPMessage m = (isRequestPacket ? this.request : this.response);
if (p != null && m != null) {
// if SOAP request message has been read from packet
// we may need to set it back in the packet before
// returning the revised packet
if (isRequestPacket) {
if (!this.requestInPacket) {
this.requestInPacket = putSOAPInPacket(m,p);
}
} else {
if (!this.responseInPacket) {
this.responseInPacket = putSOAPInPacket(m,p);
}
}
}
}
return p;
|
public javax.xml.soap.SOAPMessage | getRequest()Get the SOAP request object.
if (this.request == null) {
Object p = getPacket(REQUEST_PACKET,true);
if (p != null && this.requestInPacket) {
// if packet is not null, get SOAP from packet
// requestInPacket set to false as side-effect
// since packet has been consumed.
this.request = getSOAPFromPacket(REQUEST_PACKET,p);
}
}
return this.request;
|
public java.lang.Object | getRequestPacket()Return the request Packet.
if (classLoadingException != null) {
throw new RuntimeException(classLoadingException);
}
return getPacket(REQUEST_PACKET,true);
|
public javax.xml.soap.SOAPMessage | getResponse()Get the SOAP response object.
if (this.response == null) {
Object p = getPacket(RESPONSE_PACKET,false);
if (p != null && this.responseInPacket) {
// if packet is not null, get SOAP from packet
// responseInPacket set to false as side-effect
// since packet has been consumed.
this.response = getSOAPFromPacket(RESPONSE_PACKET,p);
}
}
return this.response;
|
public java.lang.Object | getResponsePacket()Return the response Packet.
if (classLoadingException != null) {
throw new RuntimeException(classLoadingException);
}
return getPacket(RESPONSE_PACKET,true);
|
private javax.xml.soap.SOAPMessage | getSOAPFromPacket(boolean isRequestPacket, java.lang.Object p)
if (classLoadingException != null) {
throw new RuntimeException(classLoadingException);
}
SOAPMessage s = null;
if (p instanceof Packet) {
Message m = ((Packet) p).getMessage();
if (m != null) {
try {
s = m.readAsSOAPMessage();
}catch (Exception e) {
throw new RuntimeException(e);
}
}
}
if (s != null) {
// System.out.println("SOAPAuthParam.getSOAPFromPacket:");
// printSOAP(s);
if (isRequestPacket) {
this.requestInPacket = false;
} else {
this.responseInPacket = false;
}
}
return s;
|
public static void | printSOAP(javax.xml.soap.SOAPMessage s)
try {
if (s != null) {
s.writeTo(System.out);
// System.out.println("\n");
} else {
// System.out.println("SOAPMessage is empty");
}
} catch (Exception e) {
// System.out.println("SOAPAuthParam.printSOAP exception!");
}
|
private boolean | putSOAPInPacket(javax.xml.soap.SOAPMessage m, java.lang.Object p)
if (m == null) {
((Packet)p).setMessage(null);
} else {
Message msg = Messages.create(m);
((Packet)p).setMessage(msg);
}
return true;
|
public void | setRequest(javax.xml.soap.SOAPMessage request)Set the SOAP request object.
Object p = getPacket(REQUEST_PACKET,false);
if (p != null) {
this.requestInPacket = putSOAPInPacket(request,p);
}
this.request = request;
|
public void | setRequestPacket(java.lang.Object p)Set the request Packet.
has the side effect of resetting the SOAP request message.
if (classLoadingException != null) {
throw new RuntimeException(classLoadingException);
}
if (p == null || p instanceof Packet) {
getMap().put(REQ_PACKET,p);
this.requestInPacket = (p == null ? false : true);
this.request = null;
} else {
throw new RuntimeException("argument is not packet");
}
|
public void | setResponse(javax.xml.soap.SOAPMessage response)Set the SOAP response object.
// XXX previously, i.e. before wsit,
// if a response had already been set (it is non-null),
// this method would return with doing anything
// The original response would not be overwritten.
// that is no longer the case.
Object p = getPacket(RESPONSE_PACKET,false);
if (p != null) {
this.responseInPacket = putSOAPInPacket(response,p);
}
this.response = response;
|
public void | setResponsePacket(java.lang.Object p)Set the response Packet.
has the side effect of resetting the SOAP response message.
if (classLoadingException != null) {
throw new RuntimeException(classLoadingException);
}
if (p == null || p instanceof Packet) {
getMap().put(RES_PACKET,p);
this.responseInPacket = (p == null ? false : true);
this.response = null;
} else {
throw new RuntimeException("argument is not packet");
}
|