[georest] push by simon.pelicon - Added "Authorization" header... on 2012-01-05 12:34 GMT

2 views
Skip to first unread message

geo...@googlecode.com

unread,
Jan 5, 2012, 7:34:58 AM1/5/12
to georest...@googlegroups.com
Revision: 4f7ae9b58285
Author: Simon@Simon3
Date: Thu Jan 5 04:09:16 2012
Log: Added "Authorization" header
Support for posting Int64 properties values in XML post
Posting binary data
http://code.google.com/p/georest/source/detail?r=4f7ae9b58285

Modified:
/src/GeoRestCGI/GeoRestCGI.cpp
/src/GeoRestCommon/c_RestUri.cpp
/src/GeoRestCommon/c_RestUriRequestParam.cpp
/src/GeoRestCommon/c_RestUriRequestParam.h
/src/GeoRestFetchUri/c_RestDataTransform.cpp
/src/GeoRestHttpServerDLL/c_GisHttpServer.cpp
/src/GeoRest_ISAPI/GeoRest_ISAPI.vcproj
/src/GeoRest_ISAPI/src/GeoRest_ISAPI.cpp

=======================================
--- /src/GeoRestCGI/GeoRestCGI.cpp Sat Sep 4 11:58:20 2010
+++ /src/GeoRestCGI/GeoRestCGI.cpp Thu Jan 5 04:09:16 2012
@@ -146,14 +146,20 @@
restrequest->SetHeaderValue("Accept",header_accept);
}
char* header_dsv = getenv("HTTP_DataServiceVersion");
- if( header_accept )
- {
- restrequest->SetHeaderValue("DataServiceVersion",header_accept);
+ if( header_dsv )
+ {
+ restrequest->SetHeaderValue("DataServiceVersion",header_dsv);
}
char* header_max_dsvt = getenv("HTTP_MaxDataServiceVersion");
- if( header_accept )
- {
- restrequest->SetHeaderValue("MaxDataServiceVersion",header_accept);
+ if( header_max_dsvt )
+ {
+ restrequest->SetHeaderValue("MaxDataServiceVersion",header_max_dsvt);
+ }
+
+ char* auth = getenv("Authorization");
+ if( auth )
+ {
+ restrequest->SetHeaderValue("Authorization",auth);
}

Ptr<c_RestResponse> restresponse = restrequest->Execute();
=======================================
--- /src/GeoRestCommon/c_RestUri.cpp Thu Oct 28 15:09:34 2010
+++ /src/GeoRestCommon/c_RestUri.cpp Thu Jan 5 04:09:16 2012
@@ -70,6 +70,9 @@
m_RestUri = RestUri;

m_RestRequestParam->SetXmlPostData(XmlPostData.c_str());
+
+ m_RestRequestParam->SetPostData(XmlPostData);
+
m_HttpMethod = HttpMethod;


=======================================
--- /src/GeoRestCommon/c_RestUriRequestParam.cpp Fri Aug 6 16:30:40 2010
+++ /src/GeoRestCommon/c_RestUriRequestParam.cpp Thu Jan 5 04:09:16 2012
@@ -300,6 +300,12 @@
{
m_xmlPostData = xmlData;
}
+
+
+void c_RestUriRequestParam::SetPostData(string Data)
+{
+ m_PostData = Data;
+}

/// <summary>
/// Returns POSTed XML data as a string
@@ -311,3 +317,9 @@
{
return m_xmlPostData;
}
+
+
+string& c_RestUriRequestParam::GetPostData()
+{
+ return m_PostData;
+}
=======================================
--- /src/GeoRestCommon/c_RestUriRequestParam.h Fri Aug 6 16:30:40 2010
+++ /src/GeoRestCommon/c_RestUriRequestParam.h Thu Jan 5 04:09:16 2012
@@ -181,6 +181,7 @@
/// </returns>
string& GetXmlPostData();

+ string& GetPostData();
/// <summary>
/// Stores POSTed XML data as a string
/// </summary>
@@ -188,7 +189,7 @@
/// The XML data
/// </param>
void SetXmlPostData(const char* xmlData);
-
+ void SetPostData(std::string xmlData);
protected:
/// <summary>
/// This method is responsible for releasing all
@@ -210,6 +211,7 @@
Ptr<MgStringPropertyCollection> m_reqParamCollection;
MgStringPropertyCollection m_paramTypeCollection;
string m_xmlPostData;
+ string m_PostData;


};
=======================================
--- /src/GeoRestFetchUri/c_RestDataTransform.cpp Thu Oct 28 15:09:34 2010
+++ /src/GeoRestFetchUri/c_RestDataTransform.cpp Thu Jan 5 04:09:16 2012
@@ -170,6 +170,15 @@
propcoll->Add(prop);

}
+ break;
+ case MgPropertyType::Int64:
+ {
+ long val = _wtol(str_val.c_str());
+ Ptr<MgInt64Property> prop = new
MgInt64Property(str_name,val);
+ if( str_val.length() == 0 ) prop->SetNull(true);
+
+ propcoll->Add(prop);
+ }
break;
case MgPropertyType::Int32:
{
=======================================
--- /src/GeoRestHttpServerDLL/c_GisHttpServer.cpp Wed Aug 17 00:30:31 2011
+++ /src/GeoRestHttpServerDLL/c_GisHttpServer.cpp Thu Jan 5 04:09:16 2012
@@ -379,6 +379,13 @@
{

restrequest->SetHeaderValue("Accept-Encoding",request.get("Accept-Encoding").c_str());
}
+ catch(...){}
+
+ //simon
+ try
+ {
+
restrequest->SetHeaderValue("Authorization",request.get("Authorization").c_str());
+ }
catch(...){}


=======================================
--- /src/GeoRest_ISAPI/GeoRest_ISAPI.vcproj Wed Aug 17 00:30:31 2011
+++ /src/GeoRest_ISAPI/GeoRest_ISAPI.vcproj Thu Jan 5 04:09:16 2012
@@ -65,7 +65,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="mgfoundationd.lib GeoRestCommond.lib
GeoRestServiceConfigd.lib GeoRestRequestHandlerd.lib PocoFoundationd.lib
PocoXMLd.lib PocoNetd.lib PocoUtild.lib"
+ AdditionalDependencies="mgfoundationd.lib GeoRestCommond.lib
GeoRestServiceConfigd.lib GeoRestRequestHandlerd.lib PocoFoundationd.lib
PocoXMLd.lib PocoNetd.lib PocoUtild.lib WFSRequestHandler.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"

AdditionalLibraryDirectories="$(MG_PATH_OS_2_1)\Common\lib\debug;..\..\lib\Win32\$(ConfigurationName);&quot;$(POCO_PATH)\lib&quot;"
=======================================
--- /src/GeoRest_ISAPI/src/GeoRest_ISAPI.cpp Mon Dec 13 14:30:54 2010
+++ /src/GeoRest_ISAPI/src/GeoRest_ISAPI.cpp Thu Jan 5 04:09:16 2012
@@ -400,6 +400,11 @@
{
request->SetHeaderValue("MaxDataServiceVersion",buff);
}
+
+ if( ECB->GetServerVariable(ECB->ConnID, "Authorization", buff, &size) )
+ {
+ request->SetHeaderValue("Authorization",buff);
+ }

IsapiResponseHandler responseHandler(request,agent_uri,uri_base,ECB);
Ptr<c_RestResponse> response = request->Execute();

Reply all
Reply to author
Forward
0 new messages