Java SOAP Message printMessage(SOAPMessageContext smc)

Here you can find the source of printMessage(SOAPMessageContext smc)

Description

Prints the SOAP Message on the console

License

Open Source License

Parameter

Parameter Description
smc a parameter

Declaration

public static void printMessage(SOAPMessageContext smc) 

Method Source Code

//package com.java2s;

import javax.xml.soap.SOAPException;

import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import java.io.IOException;

public class Main {
    /**/*  w w w  .  j a v  a2 s  .c  o  m*/
     * Prints the SOAP Message on the console
     *
     * @param smc
     */
    public static void printMessage(SOAPMessageContext smc) {
        try {
            System.out.println("*********Message Start********");
            System.out.println(
                    "This is a " + (((Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)).booleanValue()
                            ? "Outbound request"
                            : "Inbound response"));
            // Print out the outbound SOAP message to System.out
            smc.getMessage().writeTo(System.out);
            System.out.println("*********Message End**********");
        } catch (SOAPException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        } catch (IOException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }
}

Related

  1. isFaultResponse(SOAPMessage message)
  2. isOutgoingMessage(SOAPMessageContext smc)
  3. isSOAP12(SOAPMessage soapMessage)
  4. isSOAP12(SOAPMessage soapMessage)
  5. isSOAPFault(SOAPMessage messageSOAP)
  6. printSoapFaultException(SOAPFaultException sfe)
  7. printSOAPMessage(SOAPMessage msg, String titol)
  8. printTree(NodeList childNodes, String padding, ByteArrayOutputStream byteArrayOS)
  9. saveMimeHeaders(SOAPMessage msg, String fileName)