X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2Fsoap%2FSOAPClient.h;h=883fe265019fbfc6b4995956b7e8ec2e2d238d4c;hb=81b488b2790e7bdeb2f43560b1d4a7d22c3dfdf5;hp=32633101c797d5b0becb3891b284930810995e8d;hpb=c7288a45e5a581ea8253cf4c1d45e84281172584;p=shibboleth%2Fcpp-xmltooling.git diff --git a/xmltooling/soap/SOAPClient.h b/xmltooling/soap/SOAPClient.h index 3263310..883fe26 100644 --- a/xmltooling/soap/SOAPClient.h +++ b/xmltooling/soap/SOAPClient.h @@ -1,17 +1,21 @@ -/* - * Copyright 2001-2006 Internet2 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/** + * Licensed to the University Corporation for Advanced Internet + * Development, Inc. (UCAID) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * - * http://www.apache.org/licenses/LICENSE-2.0 + * UCAID licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the + * License at * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. */ /** @@ -23,12 +27,12 @@ #ifndef __xmltooling_soap11client_h__ #define __xmltooling_soap11client_h__ -#include #include namespace soap11 { class XMLTOOL_API Envelope; + class XMLTOOL_API Fault; /** * Implements SOAP 1.1 messaging over a transport. @@ -40,7 +44,13 @@ namespace soap11 { { MAKE_NONCOPYABLE(SOAPClient); public: - SOAPClient() : m_validate(false), m_transport(NULL) {} + /** + * Constructor + * + * @param validate true iff schema validation should be used + */ + SOAPClient(bool validate=false); + virtual ~SOAPClient(); /** @@ -50,31 +60,30 @@ namespace soap11 { * * @param validate true iff the client should use a validating XML parser */ - void setValidating(bool validate=true) { - m_validate = validate; - } + void setValidating(bool validate=true); /** * Sends the supplied envelope to the identified recipient/endpoint. - * + * *

The client object will instantiate a transport layer object * appropriate for the endpoint URL provided and supply it to the * prepareTransport() method below. * - * @param env SOAP envelope to send - * @param peer peer to send message to, expressed in TrustEngine terms - * @param endpoint URL of endpoint to recieve message + *

To authenticate the server end, the transport layer object + * exposes a method to load a TrustEngine and CredentialResolver + * in a subclass-specific version of the prepareTransport() method. + * + * @param env SOAP envelope to send + * @param addr addressing information */ - virtual void send(const Envelope* env, const xmltooling::KeyInfoSource& peer, const char* endpoint); + virtual void send(const Envelope& env, const xmltooling::SOAPTransport::Address& addr); /** * Returns the response message, if any. As long as a response is - * "expected" but not available, NULL will be returned. If no response + * "expected" but not available, nullptr will be returned. If no response * will be forthcoming, an exception is raised. * *

The caller is responsible for freeing the returned envelope. - * - *

Once a response is returned, the object will be reset for a subsequent call. */ virtual Envelope* receive(); @@ -89,8 +98,16 @@ namespace soap11 { * * @param transport reference to transport layer */ - virtual void prepareTransport(const xmltooling::SOAPTransport& transport) {} - + virtual void prepareTransport(xmltooling::SOAPTransport& transport); + + /** + * Handling of SOAP faults. + * + * @param fault SOAP Fault received by client + * @return true iff the Fault should be treated as a fatal error + */ + virtual bool handleFault(const soap11::Fault& fault); + /** Flag controlling schema validation. */ bool m_validate;