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

The newest version!
/*
 * Copyright (c) 1997, 2022 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 jakarta.jws.soap.SOAPBinding.Style;
import jakarta.jws.soap.SOAPBinding.Use;
import jakarta.jws.WebMethod;

/**
 * Models soap:binding in a WSDL document or a {@link jakarta.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 = "";

    /**
     * Default construtor.
     */
    protected SOAPBinding() {}

    /**
     * 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:
     * 
{@code
     * 
     *   
     *   
     *       
     * ...
     * }
* 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