Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnection.java
38890 views
/*1* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.xml.soap;262728/**29* A point-to-point connection that a client can use for sending messages30* directly to a remote party (represented by a URL, for instance).31* <p>32* The SOAPConnection class is optional. Some implementations may33* not implement this interface in which case the call to34* <code>SOAPConnectionFactory.newInstance()</code> (see below) will35* throw an <code>UnsupportedOperationException</code>.36* <p>37* A client can obtain a <code>SOAPConnection</code> object using a38* {@link SOAPConnectionFactory} object as in the following example:39* <PRE>40* SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance();41* SOAPConnection con = factory.createConnection();42* </PRE>43* A <code>SOAPConnection</code> object can be used to send messages44* directly to a URL following the request/response paradigm. That is,45* messages are sent using the method <code>call</code>, which sends the46* message and then waits until it gets a reply.47*/48public abstract class SOAPConnection {4950/**51* Sends the given message to the specified endpoint and blocks until52* it has returned the response.53*54* @param request the <code>SOAPMessage</code> object to be sent55* @param to an <code>Object</code> that identifies56* where the message should be sent. It is required to57* support Objects of type58* <code>java.lang.String</code>,59* <code>java.net.URL</code>, and when JAXM is present60* <code>javax.xml.messaging.URLEndpoint</code>61*62* @return the <code>SOAPMessage</code> object that is the response to the63* message that was sent64* @throws SOAPException if there is a SOAP error65*/66public abstract SOAPMessage call(SOAPMessage request,67Object to) throws SOAPException;6869/**70* Gets a message from a specific endpoint and blocks until it receives,71*72* @param to an <code>Object</code> that identifies where73* the request should be sent. Objects of type74* <code>java.lang.String</code> and75* <code>java.net.URL</code> must be supported.76*77* @return the <code>SOAPMessage</code> object that is the response to the78* get message request79* @throws SOAPException if there is a SOAP error80* @since SAAJ 1.381*/82public SOAPMessage get(Object to)83throws SOAPException {84throw new UnsupportedOperationException("All subclasses of SOAPConnection must override get()");85}8687/**88* Closes this <code>SOAPConnection</code> object.89*90* @throws SOAPException if there is a SOAP error91*/92public abstract void close()93throws SOAPException;94}959697