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

com.sun.xml.ws.api.model.soap.SOAPBinding Maven / Gradle / Ivy

/*
 * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0, which is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

package com.sun.xml.ws.api.model.soap;

import com.sun.xml.ws.api.SOAPVersion;
import com.sun.xml.ws.api.model.JavaMethod;

import javax.jws.soap.SOAPBinding.Style;
import javax.jws.soap.SOAPBinding.Use;
import javax.jws.WebMethod;

/**
 * Models soap:binding in a WSDL document or a {@link javax.jws.soap.SOAPBinding} annotation. This
 * can be the return of {@link JavaMethod#getBinding()}.
 *
 * @author Vivek Pandey
 */
abstract public class SOAPBinding {
    protected Use use = Use.LITERAL;
    protected Style style = Style.DOCUMENT;
    protected SOAPVersion soapVersion = SOAPVersion.SOAP_11;
    protected String soapAction = "";

    /**
     * Get {@link Use} such as literal or encoded.
     */
    public Use getUse() {
        return use;
    }

    /**
     * Get {@link Style} - such as document or rpc.
     */
    public Style getStyle() {
        return style;
    }

    /**
     * Get the {@link SOAPVersion}
     */
    public SOAPVersion getSOAPVersion() {
        return soapVersion;
    }

    /**
     * Returns true if its document/literal
     */
    public boolean isDocLit() {
        return style == Style.DOCUMENT && use == Use.LITERAL;
    }

    /**
     * Returns true if this is a rpc/literal binding
     */
    public boolean isRpcLit() {
        return style == Style.RPC && use == Use.LITERAL;
    }

    /**
     * Value of wsdl:binding/wsdl:operation/soap:operation@soapAction attribute or
     * {@link WebMethod#action()} annotation.
     * 
     * For example:
     * <wsdl:binding name="HelloBinding" type="tns:Hello">
     *   <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
     *   <wsdl:operation name="echoData">
     *       <soap12:operation soapAction=""/>
     * ...
     * 
* It's always non-null. soap message serializer needs to generated SOAPAction HTTP header with * the return of this method enclosed in quotes(""). * * @see com.sun.xml.ws.api.message.Packet#soapAction */ public String getSOAPAction() { return soapAction; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy