SSPCPP-670 - Session Cleanup for Database Session Storage can cause performance issues
[shibboleth/cpp-sp.git] / shibsp / binding / SOAPClient.h
1 /**
2  * Licensed to the University Corporation for Advanced Internet
3  * Development, Inc. (UCAID) under one or more contributor license
4  * agreements. See the NOTICE file distributed with this work for
5  * additional information regarding copyright ownership.
6  *
7  * UCAID licenses this file to you under the Apache License,
8  * Version 2.0 (the "License"); you may not use this file except
9  * in compliance with the License. You may obtain a copy of the
10  * License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17  * either express or implied. See the License for the specific
18  * language governing permissions and limitations under the License.
19  */
20
21 /**
22  * @file shibsp/binding/SOAPClient.h
23  * 
24  * Specialized SOAPClient for SP environment.
25  */
26
27 #ifndef __shibsp_soap11client_h__
28 #define __shibsp_soap11client_h__
29
30 #include <shibsp/base.h>
31
32 #include <saml/binding/SOAPClient.h>
33
34 namespace shibsp {
35
36     class SHIBSP_API PropertySet;
37     class SHIBSP_API SecurityPolicy;
38
39     /**
40      * Specialized SOAPClient for SP environment.
41      */
42     class SHIBSP_API SOAPClient : public opensaml::SOAPClient
43     {
44     public:
45         /**
46          * Creates a SOAP client instance for an Application to use.
47          * 
48          * @param policy        reference to SP-SecurityPolicy to apply
49          */
50         SOAPClient(SecurityPolicy& policy);
51         
52         virtual ~SOAPClient();
53
54         /**
55          * Override handles message signing for SAML payloads.
56          * 
57          * @param env       SOAP envelope to send
58          * @param from      identity of sending application
59          * @param to        peer to send message to, expressed in metadata terms
60          * @param endpoint  URL of endpoint to recieve message
61          */
62         void send(const soap11::Envelope& env, const char* from, opensaml::saml2md::MetadataCredentialCriteria& to, const char* endpoint);
63
64         void reset();
65
66     protected:
67         /**
68          * Override prepares transport by applying policy settings from Application.
69          * 
70          * @param transport reference to transport layer
71          */
72         void prepareTransport(xmltooling::SOAPTransport& transport);
73
74         /** Application supplied to client. */
75         const Application& m_app;
76
77         /** RelyingParty properties, set after transport prep. */
78         const PropertySet* m_relyingParty;
79
80         /** Locked CredentialResolver for transport, set after transport prep. */
81         xmltooling::CredentialResolver* m_credResolver;
82     };
83
84 };
85
86 #endif /* __shibsp_soap11client_h__ */