Here you can find the source of isSOAP12(SOAPMessage soapMessage)
Parameter | Description |
---|---|
soapMessage | a parameter |
Parameter | Description |
---|---|
SOAPException | an exception |
public static boolean isSOAP12(SOAPMessage soapMessage) throws SOAPException
//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; } }