01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package javax.xml.soap;
20:
21: /**
22: * A point-to-point connection that a client can use for sending messages directly to a remote party
23: * (represented by a URL, for instance).
24: * <p/>
25: * A client can obtain a <code>SOAPConnection</code> object simply by calling the following static
26: * method.
27: * <pre>
28: * <p/>
29: * SOAPConnection con = SOAPConnection.newInstance();
30: * </pre>
31: * A <code>SOAPConnection</code> object can be used to send messages directly to a URL following the
32: * request/response paradigm. That is, messages are sent using the method <code>call</code>, which
33: * sends the message and then waits until it gets a reply.
34: */
35: public abstract class SOAPConnection {
36:
37: public SOAPConnection() {
38: }
39:
40: /**
41: * Sends the given message to the specified endpoint and blocks until it has returned the
42: * response.
43: *
44: * @param request the <CODE>SOAPMessage</CODE> object to be sent
45: * @param endpoint an <code>Object</code> that identifies where the message should be sent. It
46: * is required to support Objects of type <code>java.lang.String</code>,
47: * <code>java.net.URL</code>, and when JAXM is present <code>javax.xml.messaging.URLEndpoint</code>
48: * @return the <CODE>SOAPMessage</CODE> object that is the response to the message that was
49: * sent
50: * @throws SOAPException if there is a SOAP error
51: */
52: public abstract SOAPMessage call(SOAPMessage request,
53: Object endpoint) throws SOAPException;
54:
55: /**
56: * Closes this <CODE>SOAPConnection</CODE> object.
57: *
58: * @throws SOAPException if there is a SOAP error
59: */
60: public abstract void close() throws SOAPException;
61:
62: /**
63: * Gets a message from a specific endpoint and blocks until it receives,
64: *
65: * @param to - an Object that identifies where the request should be sent. Objects of type
66: * java.lang.String and java.net.URL must be supported.
67: * @return the SOAPMessage object that is the response to the get message request
68: * @throws SOAPException - if there is a SOAP error
69: */
70: public SOAPMessage get(Object obj) throws SOAPException {
71: throw new UnsupportedOperationException();
72: }
73: }
|