KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > soap > SOAPConnection


1 /*
2  * $Id: SOAPConnection.java,v 1.12 2005/04/05 21:03:23 mk125090 Exp $
3  * $Revision: 1.12 $
4  * $Date: 2005/04/05 21:03:23 $
5  */

6
7 /*
8  * The contents of this file are subject to the terms
9  * of the Common Development and Distribution License
10  * (the License). You may not use this file except in
11  * compliance with the License.
12  *
13  * You can obtain a copy of the license at
14  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
15  * See the License for the specific language governing
16  * permissions and limitations under the License.
17  *
18  * When distributing Covered Code, include this CDDL
19  * Header Notice in each file and include the License file
20  * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
21  * If applicable, add the following below the CDDL Header,
22  * with the fields enclosed by brackets [] replaced by
23  * you own identifying information:
24  * "Portions Copyrighted [year] [name of copyright owner]"
25  *
26  * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
27  */

28 package javax.xml.soap;
29
30
31 /**
32  * A point-to-point connection that a client can use for sending messages
33  * directly to a remote party (represented by a URL, for instance).
34  * <p>
35  * The SOAPConnection class is optional. Some implementations may
36  * not implement this interface in which case the call to
37  * <code>SOAPConnectionFactory.newInstance()</code> (see below) will
38  * throw an <code>UnsupportedOperationException</code>.
39  * <p>
40  * A client can obtain a <code>SOAPConnection</code> object using a
41  * {@link SOAPConnectionFactory} object as in the following example:
42  * <PRE>
43  * SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance();
44  * SOAPConnection con = factory.createConnection();
45  * </PRE>
46  * A <code>SOAPConnection</code> object can be used to send messages
47  * directly to a URL following the request/response paradigm. That is,
48  * messages are sent using the method <code>call</code>, which sends the
49  * message and then waits until it gets a reply.
50  */

51 public abstract class SOAPConnection {
52
53     /**
54      * Sends the given message to the specified endpoint and blocks until
55      * it has returned the response.
56      *
57      * @param request the <code>SOAPMessage</code> object to be sent
58      * @param to an <code>Object</code> that identifies
59      * where the message should be sent. It is required to
60      * support Objects of type
61      * <code>java.lang.String</code>,
62      * <code>java.net.URL</code>, and when JAXM is present
63      * <code>javax.xml.messaging.URLEndpoint</code>
64      *
65      * @return the <code>SOAPMessage</code> object that is the response to the
66      * message that was sent
67      * @throws SOAPException if there is a SOAP error
68      */

69     public abstract SOAPMessage JavaDoc call(SOAPMessage JavaDoc request,
70                                      Object JavaDoc to) throws SOAPException JavaDoc;
71
72     /**
73      * Gets a message from a specific endpoint and blocks until it receives,
74      *
75      * @param to an <code>Object</code> that identifies where
76      * the request should be sent. Objects of type
77      * <code>java.lang.String</code> and
78      * <code>java.net.URL</code> must be supported.
79      *
80      * @return the <code>SOAPMessage</code> object that is the response to the
81      * get message request
82      * @throws SOAPException if there is a SOAP error
83      * @since SAAJ 1.3
84      */

85     public SOAPMessage JavaDoc get(Object JavaDoc to)
86                                 throws SOAPException JavaDoc {
87         throw new UnsupportedOperationException JavaDoc("All subclasses of SOAPConnection must override get()");
88     }
89     
90     /**
91      * Closes this <code>SOAPConnection</code> object.
92      *
93      * @throws SOAPException if there is a SOAP error
94      */

95     public abstract void close()
96         throws SOAPException JavaDoc;
97 }
98
Popular Tags