https://issues.shibboleth.net/jira/browse/CPPXT-47
[shibboleth/cpp-xmltooling.git] / xmltooling / soap / impl / SOAPClient.cpp
index 9082d41..1978e28 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 #include "internal.h"
 #include "exceptions.h"
 #include "logging.h"
+#include "soap/HTTPSOAPTransport.h"
 #include "soap/SOAP.h"
 #include "soap/SOAPClient.h"
 #include "util/XMLHelper.h"
@@ -36,11 +37,29 @@ using namespace xmltooling;
 using namespace xercesc;
 using namespace std;
 
-void SOAPTransport::send(istream* in)
+SOAPTransport::SOAPTransport()
+{
+}
+
+SOAPTransport::~SOAPTransport()
+{
+}
+
+bool SOAPTransport::setProviderOption(const char* provider, const char* option, const char* value)
+{
+    return false;
+}
+
+HTTPSOAPTransport::HTTPSOAPTransport()
+{
+}
+
+HTTPSOAPTransport::~HTTPSOAPTransport()
+{
+}
+
+SOAPClient::SOAPClient(bool validate) : m_validate(validate), m_transport(NULL)
 {
-    if (!in)
-        throw IOException("SOAP transport does not support an empty request body.");
-    return send(*in);
 }
 
 SOAPClient::~SOAPClient()
@@ -48,12 +67,24 @@ SOAPClient::~SOAPClient()
     delete m_transport;
 }
 
+void SOAPClient::setValidating(bool validate)
+{
+    m_validate = validate;
+}
+
 void SOAPClient::reset()
 {
     delete m_transport;
     m_transport=NULL;
 }
 
+void SOAPTransport::send(istream* in)
+{
+    if (!in)
+        throw IOException("SOAP transport does not support an empty request body.");
+    return send(*in);
+}
+
 void SOAPClient::send(const Envelope& env, const SOAPTransport::Address& addr)
 {
     // Prepare a transport object.
@@ -109,8 +140,8 @@ Envelope* SOAPClient::receive()
     
     auto_ptr<XMLObject> xmlObject(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true));
     janitor.release();
-    if (!m_validate)
-        SchemaValidators.validate(xmlObject.get());
+
+    SchemaValidators.validate(xmlObject.get());
 
     Envelope* env = dynamic_cast<Envelope*>(xmlObject.get());
     if (!env)
@@ -128,6 +159,10 @@ Envelope* SOAPClient::receive()
     return env;
 }
 
+void SOAPClient::prepareTransport(SOAPTransport& transport)
+{
+}
+
 bool SOAPClient::handleFault(const Fault& fault)
 {
     const xmltooling::QName* code = (fault.getFaultcode() ? fault.getFaultcode()->getCode() : NULL);