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