<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>\r
\r
\r
+<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>\r
<storageModule moduleId="org.eclipse.cdt.core.pathentry">\r
<pathentry include="C:/log4shib-1.0/include" kind="inc" path="" system="true"/>\r
<pathentry include="C:/xerces-c_2_8_0-x86-windows-vc_8_0/include" kind="inc" path="" system="true"/>\r
<pathentry kind="mac" name="WIN32" path="" value=""/>\r
<pathentry kind="mac" name="XMLTOOL_API" path="" value=""/>\r
<pathentry kind="mac" name="XMLTOOL_DLLLOCAL" path="" value=""/>\r
+<pathentry kind="mac" name="XMLTOOLING_LOGCAT" path="" value=""XMLTooling""/>\r
<pathentry kind="out" path="xmltooling/Debug"/>\r
<pathentry kind="out" path="xmltoolingtest/Debug"/>\r
<pathentry kind="out" path="debug"/>\r
XSECCryptoKey* SecurityHelper::loadKeyFromURL(SOAPTransport& transport, const char* backing, const char* format, const char* password)
{
// Fetch the data.
- istringstream dummy;
- transport.send(dummy);
+ transport.send();
istream& msg = transport.receive();
// Dump to output file.
ofstream out(backing, fstream::trunc|fstream::binary);
out << msg.rdbuf();
+ out.close();
return loadKeyFromFile(backing, format, password);
}
vector<XSECCryptoX509*>& certs, SOAPTransport& transport, const char* backing, const char* format, const char* password
)
{
- // Fetch the data.
- istringstream dummy;
- transport.send(dummy);
+ transport.send();
istream& msg = transport.receive();
// Dump to output file.
ofstream out(backing, fstream::trunc|fstream::binary);
out << msg.rdbuf();
+ out.close();
return loadCertificatesFromFile(certs, backing, format, password);
}
)
{
// Fetch the data.
- istringstream dummy;
- transport.send(dummy);
+ transport.send();
istream& msg = transport.receive();
// Dump to output file.
ofstream out(backing, fstream::trunc|fstream::binary);
out << msg.rdbuf();
+ out.close();
return loadCRLsFromFile(crls, backing, format);
}
virtual void send(std::istream& in)=0;
/**
+ * Sends an optional stream of data over the transport. The function may return without
+ * having received any data, depending on the nature of the transport.
+ *
+ * <p>If the parameter is omitted, a request may be issued with no body if the transport
+ * supports that feature.
+ *
+ * @param in input stream to send
+ */
+ virtual void send(std::istream* in=NULL);
+
+ /**
* Returns reference to response stream. The resulting stream must be
* checked directly to determine whether data is available.
*
#endif
}
- void send(istream& in);
+ void send(istream& in) {
+ send(&in);
+ }
+
+ void send(istream* in=NULL);
istream& receive() {
return m_stream;
return content_type ? content_type : "";
}
-void CURLSOAPTransport::send(istream& in)
+void CURLSOAPTransport::send(istream* in)
{
#ifdef _DEBUG
xmltooling::NDC ndc("send");
curl_easy_setopt(m_handle,CURLOPT_POST,1);
m_headers=curl_slist_append(m_headers,"Transfer-Encoding: chunked");
curl_easy_setopt(m_handle,CURLOPT_READFUNCTION,&curl_read_hook);
- curl_easy_setopt(m_handle,CURLOPT_READDATA,&in);
+ curl_easy_setopt(m_handle,CURLOPT_READDATA,in);
}
else if (in) {
char buf[1024];
- while (in) {
- in.read(buf,1024);
- msg.append(buf,in.gcount());
+ while (*in) {
+ in->read(buf,1024);
+ msg.append(buf,in->gcount());
}
curl_easy_setopt(m_handle,CURLOPT_POST,1);
curl_easy_setopt(m_handle,CURLOPT_READFUNCTION,NULL);
// callback to send data to server
size_t xmltooling::curl_read_hook(void* ptr, size_t size, size_t nmemb, void* stream)
{
- // *stream is actually an istream object
- istream& buf=*(reinterpret_cast<istream*>(stream));
- buf.read(reinterpret_cast<char*>(ptr),size*nmemb);
- return buf.gcount();
+ // stream is actually an istream pointer
+ istream* buf=reinterpret_cast<istream*>(stream);
+ buf->read(reinterpret_cast<char*>(ptr),size*nmemb);
+ return buf->gcount();
}
// callback to buffer data from server
using namespace xmltooling;
using namespace std;
+void SOAPTransport::send(istream* in)
+{
+ if (!in)
+ throw IOException("SOAP transport does not support an empty request body.");
+ return send(*in);
+}
+
SOAPClient::~SOAPClient()
{
delete m_transport;