2 * Copyright 2001-2009 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 saml/saml2/binding/SAML2SOAPClient.h
20 * Specialized SOAPClient for SAML 2.0 SOAP binding.
23 #ifndef __saml2_soap11client_h__
24 #define __saml2_soap11client_h__
26 #include <saml/base.h>
30 class SAML_API SOAPClient;
33 class SAML_API MetadataCredentialCriteria;
38 class SAML_API RequestAbstractType;
39 class SAML_API StatusResponseType;
40 class SAML_API Status;
43 * Specialized SOAPClient for SAML 2.0 SOAP binding.
45 class SAML_API SAML2SOAPClient
51 * @param soaper reference to SOAPClient object to use for call
52 * @param fatalSAMLErrors true iff a non-successful SAML Status code should be fatal
54 SAML2SOAPClient(SOAPClient& soaper, bool fatalSAMLErrors=true);
56 virtual ~SAML2SOAPClient();
59 * Specialized method for sending SAML 2.0 requests. The SOAP layer will be
60 * constructed automatically.
62 * <p>The request will be freed by the client object regardless of the outcome.
64 * @param request SAML request to send
65 * @param to peer to send message to, expressed in metadata criteria terms
66 * @param from identity of sending application
67 * @param endpoint URL of endpoint to recieve message
69 virtual void sendSAML(RequestAbstractType* request, const char* from, saml2md::MetadataCredentialCriteria& to, const char* endpoint);
72 * Specialized method for receiving SAML 2.0 responses. The SOAP layer will be
73 * evaluated automatically, and the attached policy will be applied to the Response.
75 * <p>The caller is responsible for freeing the response.
77 * @return SAML 2.0 response, after SecurityPolicy has been applied
79 virtual StatusResponseType* receiveSAML();
83 * Handling of SAML errors.
85 * @param status SAML Status received by client
86 * @return true iff the error should be treated as a fatal error
88 virtual bool handleError(const Status& status);
90 /** SOAP client object */
93 /** Flag controlling default error handler. */
103 #endif /* __saml2_soap11client_h__ */