Java SOAP Message isSOAP12(SOAPMessage soapMessage)

Here you can find the source of isSOAP12(SOAPMessage soapMessage)

Description

Determine if a SOAPMessage is SOAP 1.2

License

Apache License

Parameter

Parameter Description
soapMessage a parameter

Exception

Parameter Description
SOAPException an exception

Declaration

public static boolean isSOAP12(SOAPMessage soapMessage) throws SOAPException 

Method Source Code

//package com.java2s;
/*//from w w  w .  j  a  va  2  s. c  om
 * JBoss, Home of Professional Open Source
 *
 * Copyright 2013 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;

import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;

public class Main {
    /**
     * Determine if a SOAPMessage is SOAP 1.2
     *
     * @param soapMessage
     *
     * @return
     *
     * @throws SOAPException
     */
    public static boolean isSOAP12(SOAPMessage soapMessage) throws SOAPException {
        SOAPPart soapPart = soapMessage.getSOAPPart();
        SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
        if (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(soapEnvelope.getNamespaceURI()))
            return true;
        return false;
    }
}

Related

  1. invokeOneWay(Dispatch dispatch, String request, String... args)
  2. isExceptionObject(Class o)
  3. isFaultMessage(final SOAPMessage msg)
  4. isFaultResponse(SOAPMessage message)
  5. isOutgoingMessage(SOAPMessageContext smc)
  6. isSOAP12(SOAPMessage soapMessage)
  7. isSOAPFault(SOAPMessage messageSOAP)
  8. printMessage(SOAPMessageContext smc)
  9. printSoapFaultException(SOAPFaultException sfe)