List of utility methods to do SOAP Message
boolean | isFaultResponse(SOAPMessage message) is Fault Response return message.getSOAPBody().getFault() != null;
|
boolean | isOutgoingMessage(SOAPMessageContext smc) Returns true if the SOAPMessageContext is part of the request Boolean outboundProperty = (Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
return outboundProperty.booleanValue();
|
Boolean | isSOAP12(SOAPMessage soapMessage) Determines if the envelope is SOAP 1.1 or 1.2. return soapMessage.getSOAPPart().getEnvelope().getNamespaceURI().equals(SOAP12_URI);
|
boolean | isSOAP12(SOAPMessage soapMessage) Determine if a SOAPMessage is SOAP 1.2 SOAPPart soapPart = soapMessage.getSOAPPart(); SOAPEnvelope soapEnvelope = soapPart.getEnvelope(); if (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(soapEnvelope.getNamespaceURI())) return true; return false; |
boolean | isSOAPFault(SOAPMessage messageSOAP) Indicates if a SOAP message is actually a SOAP fault try { if (messageSOAP == null || messageSOAP.getSOAPBody().hasFault()) { return true; } catch (SOAPException ignore) { return false; |
void | printMessage(SOAPMessageContext smc) Prints the SOAP Message on the console try { System.out.println("*********Message Start********"); System.out.println( "This is a " + (((Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)).booleanValue() ? "Outbound request" : "Inbound response")); smc.getMessage().writeTo(System.out); System.out.println("*********Message End**********"); ... |
void | printSoapFaultException(SOAPFaultException sfe) print Soap Fault Exception snapshotLogger.log(Level.INFO, "SOAP Fault -"); if (sfe.getFault().hasDetail()) { snapshotLogger.log(Level.INFO, sfe.getFault().getDetail().getFirstChild().getLocalName()); if (sfe.getFault().getFaultString() != null) { System.out.println("\n Message: " + sfe.getFault().getFaultString()); |
void | printSOAPMessage(SOAPMessage msg, String titol) print SOAP Message ByteArrayOutputStream byteArrayOS = new ByteArrayOutputStream(); msg.writeTo(byteArrayOS); System.out.println("*******************************"); System.out.println(titol); System.out.println("-------------------------------"); System.out.println(new String(byteArrayOS.toByteArray())); System.out.println("*******************************"); |
void | printTree(NodeList childNodes, String padding, ByteArrayOutputStream byteArrayOS) print Tree try { NodeList nodes = childNodes; for (int i = 0; i < nodes.getLength(); i++) { Node node = (Node) nodes.item(i); String name = node.getNodeName(); if (node.hasChildNodes()) { byteArrayOS.write(('\n' + padding + "<" + name + ">").getBytes()); printTree(node.getChildNodes(), padding + " ", byteArrayOS); ... |
void | saveMimeHeaders(SOAPMessage msg, String fileName) save Mime Headers FileOutputStream fos = new FileOutputStream(fileName); ObjectOutputStream oos = new ObjectOutputStream(fos); Hashtable hashTable = new Hashtable(); MimeHeaders mimeHeaders = msg.getMimeHeaders(); Iterator iterator = mimeHeaders.getAllHeaders(); while (iterator.hasNext()) { MimeHeader mimeHeader = (MimeHeader) iterator.next(); hashTable.put(mimeHeader.getName(), mimeHeader.getValue()); ... |