All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.cxf.binding.soap.Soap11 Maven / Gradle / Ivy

There is a newer version: 3.0.0-milestone2
Show newest version
/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you 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.
 */

package org.apache.cxf.binding.soap;

import javax.xml.namespace.QName;

/**
 * Represents the SOAP 1.1 version
 * 
 */
public final class Soap11 implements SoapVersion {
    public static final String SOAP_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/";

    private static final Soap11 INSTANCE = new Soap11();

    private final double version = 1.1;

    private final String namespace = SOAP_NAMESPACE;

    private final String prefix = "soap";

    private final String noneRole = namespace + "/role/none";

    private final String ultimateReceiverRole = namespace + "/role/ultimateReceiver";
    
    private final String nextRole = "http://schemas.xmlsoap.org/soap/actor/next";

    private final String soapEncodingStyle = "http://schemas.xmlsoap.org/soap/encoding/";

    private final QName envelope = new QName(namespace, "Envelope", prefix);

    private final QName header = new QName(namespace, "Header", prefix);

    private final QName body = new QName(namespace, "Body", prefix);

    private final QName fault = new QName(namespace, "Fault", prefix);      

    private Soap11() {
        // Singleton 
    }

    public static Soap11 getInstance() {
        return INSTANCE;
    }
    
    public double getVersion() {
        return version;
    }

    public String getNamespace() {
        return namespace;
    }

    public String getPrefix() {
        return prefix;
    }

    public QName getEnvelope() {
        return envelope;
    }

    public QName getHeader() {
        return header;
    }

    public QName getBody() {
        return body;
    }

    public QName getFault() {
        return fault;
    }

    public String getSoapEncodingStyle() {
        return soapEncodingStyle;
    }

    // Role URIs
    // -------------------------------------------------------------------------
    public String getNoneRole() {
        return noneRole;
    }

    public String getUltimateReceiverRole() {
        return ultimateReceiverRole;
    }

    public String getNextRole() {
        return nextRole;
    }

    public String getAttrNameRole() {
        return "actor";
    }

    public String getAttrNameMustUnderstand() {
        return "mustUnderstand";
    }

    public QName getReceiver() {
        return new QName(SOAP_NAMESPACE, "Server");
    }

    public QName getSender() {
        return new QName(SOAP_NAMESPACE, "Client");
    }

    public QName getMustUnderstand() {
        return new QName(SOAP_NAMESPACE, "MustUnderstand");
    }

    public QName getVersionMismatch() {
        return new QName(SOAP_NAMESPACE, "VersionMismatch");
    }

    public QName getDateEncodingUnknown() {
        // There is no such fault code in soap11
        return null;
    }
    
    public String getContentType() {
        return "text/xml";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy