001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.binding.soap;
019:
020: import javax.xml.namespace.QName;
021:
022: /**
023: * Represents the SOAP 1.2 version
024: *
025: */
026: public final class Soap12 implements SoapVersion {
027: public static final String SOAP_NAMESPACE = "http://www.w3.org/2003/05/soap-envelope";
028:
029: private static Soap12 instance = new Soap12();
030:
031: private final double version = 1.2;
032:
033: private final String namespace = SOAP_NAMESPACE;
034:
035: private final String prefix = "soap";
036:
037: private final String noneRole = namespace + "/role/none";
038:
039: private final String ultimateReceiverRole = namespace
040: + "/role/ultimateReceiver";
041:
042: private final String nextRole = namespace + "/role/next";
043:
044: private final String soapEncodingStyle = "http://www.w3.org/2003/05/soap-encoding";
045:
046: private final QName envelope = new QName(namespace, "Envelope",
047: prefix);
048:
049: private final QName header = new QName(namespace, "Header", prefix);
050:
051: private final QName body = new QName(namespace, "Body", prefix);
052:
053: private final QName fault = new QName(namespace, "Fault", prefix);
054:
055: private Soap12() {
056: // Singleton
057: }
058:
059: public static Soap12 getInstance() {
060: return instance;
061: }
062:
063: public double getVersion() {
064: return version;
065: }
066:
067: public String getNamespace() {
068: return namespace;
069: }
070:
071: public String getPrefix() {
072: return prefix;
073: }
074:
075: public QName getEnvelope() {
076: return envelope;
077: }
078:
079: public QName getHeader() {
080: return header;
081: }
082:
083: public QName getBody() {
084: return body;
085: }
086:
087: public QName getFault() {
088: return fault;
089: }
090:
091: public String getSoapEncodingStyle() {
092: return soapEncodingStyle;
093: }
094:
095: // Role URIs
096: // -------------------------------------------------------------------------
097: public String getNoneRole() {
098: return noneRole;
099: }
100:
101: public String getUltimateReceiverRole() {
102: return ultimateReceiverRole;
103: }
104:
105: public String getNextRole() {
106: return nextRole;
107: }
108:
109: public String getAttrNameRole() {
110: return "role";
111: }
112:
113: public String getAttrNameMustUnderstand() {
114: return "mustUnderstand";
115: }
116:
117: public QName getReceiver() {
118: return new QName(SOAP_NAMESPACE, "Receiver");
119: }
120:
121: public QName getSender() {
122: return new QName(SOAP_NAMESPACE, "Sender");
123: }
124:
125: public QName getMustUnderstand() {
126: return new QName(SOAP_NAMESPACE, "MustUnderstand");
127: }
128:
129: public QName getVersionMismatch() {
130: return new QName(SOAP_NAMESPACE, "VersionMismatch");
131: }
132:
133: public QName getDateEncodingUnknown() {
134: return new QName(SOAP_NAMESPACE, "DataEncodingUnknown");
135: }
136:
137: public String getContentType() {
138: return "application/soap+xml";
139: }
140: }
|