Relax content type check.
authorcantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Mon, 22 Jan 2007 17:00:51 +0000 (17:00 +0000)
committercantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Mon, 22 Jan 2007 17:00:51 +0000 (17:00 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@232 de75baf8-a10c-0410-a50a-987c0e22f00f

xmltooling/soap/impl/SOAPClient.cpp

index d785b63..ec0d781 100644 (file)
@@ -74,6 +74,11 @@ Envelope* SOAPClient::receive()
     if (!out)
         return NULL;    // nothing yet
     
+    // Check content type.
+    string s = m_transport->getContentType();
+    if (s.find("text/xml") == string::npos)
+        throw IOException("Incorrect content type ($1) for SOAP response.", params(1,s.c_str() ? s.c_str() : "none"));
+    
     // Parse and bind the document into an XMLObject.
     DOMDocument* doc = (m_validate ? XMLToolingConfig::getConfig().getValidatingParser()
         : XMLToolingConfig::getConfig().getParser()).parse(out);