2 * Copyright 2001-2006 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file xmltooling/soap/SOAPClient.h
20 * Implements SOAP 1.1 messaging over a transport.
23 #ifndef __xmltooling_soap11client_h__
24 #define __xmltooling_soap11client_h__
26 #include <xmltooling/soap/SOAP.h>
27 #include <xmltooling/soap/SOAPTransport.h>
32 * Implements SOAP 1.1 messaging over a transport.
34 * In the abstract, this can be a one-way exchange, or use asynchronous
35 * transports, but this is mostly theoretical.
37 class XMLTOOL_API SOAPClient
39 MAKE_NONCOPYABLE(SOAPClient);
41 SOAPClient() : m_response(NULL) {}
42 virtual ~SOAPClient();
45 * Sends the supplied envelope to the identified recipient/endpoint.
47 * <p>The caller is responsible for freeing the outgoing envelope.
49 * <p>The client object will instantiate a transport layer object
50 * appropriate for the endpoint URL provided and supply it to the
51 * prepareTransport() method below.
53 * @param env SOAP envelope to send
54 * @param to identifier/name of party to send message to
55 * @param endpoint URL of endpoint to recieve message
57 virtual void send(const Envelope* env, const char* to, const char* endpoint);
60 * Returns the response message, if any. As long as a response is
61 * "expected" but not available, NULL will be returned. If no response
62 * will be forthcoming, an exception is raised.
64 * <p>The caller is responsible for freeing the incoming envelope.
66 virtual Envelope* receive();
70 * Allows client to supply transport-layer settings prior to sending message.
72 * @param transport reference to transport layer
73 * @return true iff transport preparation was successful
75 virtual bool prepareTransport(const xmltooling::SOAPTransport& transport) {}
77 /** Holds response until retrieved by caller. */
83 #endif /* __xmltooling_soap11client_h__ */