/* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package com.sun.xml.internal.ws.api; import com.sun.xml.internal.bind.util.Which; import com.sun.xml.internal.ws.api.message.saaj.SAAJFactory; import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants; import javax.xml.namespace.QName; import javax.xml.soap.MessageFactory; import javax.xml.soap.SOAPConstants; import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPFactory; import javax.xml.ws.soap.SOAPBinding; import com.oracle.webservices.internal.api.EnvelopeStyle; import com.oracle.webservices.internal.api.EnvelopeStyleFeature; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; /** * Version of SOAP (1.1 and 1.2). * *
* This class defines various constants for SOAP 1.1 and SOAP 1.2, * and also defines convenience methods to simplify the processing * of multiple SOAP versions. * *
* This constant alows you to do: * *
* SOAPVersion version = ...; * version.someOp(...); ** * As opposed to: * *
* if(binding is SOAP11) { * doSomeOp11(...); * } else { * doSomeOp12(...); * } ** * @author Kohsuke Kawaguchi */ public enum SOAPVersion { SOAP_11(SOAPBinding.SOAP11HTTP_BINDING, com.sun.xml.internal.ws.encoding.soap.SOAPConstants.URI_ENVELOPE, "text/xml", SOAPConstants.URI_SOAP_ACTOR_NEXT, "actor", javax.xml.soap.SOAPConstants.SOAP_1_1_PROTOCOL, new QName(com.sun.xml.internal.ws.encoding.soap.SOAPConstants.URI_ENVELOPE, "MustUnderstand"), "Client", "Server", Collections.singleton(SOAPConstants.URI_SOAP_ACTOR_NEXT)), SOAP_12(SOAPBinding.SOAP12HTTP_BINDING, SOAP12Constants.URI_ENVELOPE, "application/soap+xml", SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER, "role", javax.xml.soap.SOAPConstants.SOAP_1_2_PROTOCOL, new QName(com.sun.xml.internal.ws.encoding.soap.SOAP12Constants.URI_ENVELOPE, "MustUnderstand"), "Sender", "Receiver", new HashSet
* Either {@link SOAPBinding#SOAP11HTTP_BINDING} or
* {@link SOAPBinding#SOAP12HTTP_BINDING}
*/
public final String httpBindingId;
/**
* SOAP envelope namespace URI.
*/
public final String nsUri;
/**
* Content-type. Either "text/xml" or "application/soap+xml".
*/
public final String contentType;
/**
* SOAP MustUnderstand FaultCode for this SOAP version
*/
public final QName faultCodeMustUnderstand;
/**
* SAAJ {@link MessageFactory} for this SOAP version.
* @deprecated
*/
public final MessageFactory saajMessageFactory;
/**
* SAAJ {@link SOAPFactory} for this SOAP version.
* @deprecated
*/
public final SOAPFactory saajSoapFactory;
private final String saajFactoryString;
/**
* If the actor/role attribute is absent, this SOAP version assumes this value.
*/
public final String implicitRole;
/**
* Singleton set that contains {@link #implicitRole}.
*/
public final Set