olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bi...@apache.org
Subject [4/5] git commit: [issue-276] Convert Datajs codes from V3 to V4. The major works should be: 1. Remove all the Json verbose logic, make the DataJS accepted and returned javascript object be in Json light format. (Since Json verbose has been completely re
Date Tue, 13 May 2014 05:15:47 GMT
[issue-276] Convert Datajs codes from V3 to V4. The major works should be: 1. Remove all the Json verbose logic, make the DataJS accepted and returned javascript object be in Json light format. (Since Json verbose has been completely removed on V4, making the javascript object returned by DataJS in json verbose format does not make sense any more. ) 2. Add the supports for parsing and setting the changed and new added headers in the request,response. 3. Parse OData V4 Metadata payload. 4. Make the DataJS cache and storage components work. 5. Batch payload parser and serializer. (Note: Serializer means serializing javascript object to the string payload which could be posted to OData service side, while Parser means converting the odata payload string to javascript object.)  6. Use javascript build-in functions to do Json light Payload parser and serializer. 7. Upgrade the test cases.


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/commit/80db48ba
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/tree/80db48ba
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/diff/80db48ba

Branch: refs/heads/master
Commit: 80db48ba93427d633021b68045592dfbbd8fd1b3
Parents: a84a42d
Author: Bing Li <bingl@apache.org>
Authored: Mon May 12 10:30:03 2014 +0800
Committer: Bing Li <bingl@apache.org>
Committed: Mon May 12 10:30:03 2014 +0800

----------------------------------------------------------------------
 BuildTools/djsbuildver.cmd                      |   2 +-
 JSLib/JSLib.csproj                              | 316 ++++---
 JSLib/Web.config                                |   6 +-
 JSLib/src/cache-source.js                       |  32 +-
 JSLib/src/cache.js                              |  48 +-
 JSLib/src/odata-atom.js                         |   6 +-
 JSLib/src/odata-handler.js                      |  12 +-
 JSLib/src/odata-json-light.js                   |  65 +-
 JSLib/src/odata-json.js                         |  67 +-
 JSLib/src/odata-metadata.js                     | 308 +++---
 JSLib/src/odata-net.js                          |  13 +-
 JSLib/src/odata-utils.js                        |  27 +-
 JSLib/src/odata-xml.js                          |  37 +-
 JSLib/src/odata.js                              |  13 +-
 JSLib/src/utils.js                              |  57 ++
 JSLib/tests/code/ReflectionDataContext.cs       |   4 +-
 JSLib/tests/code/atomreader.cs                  |   2 +-
 JSLib/tests/code/csdlreader.cs                  | 173 ++--
 JSLib/tests/code/jsdate.cs                      |   4 +-
 JSLib/tests/code/jsonlightreader.cs             | 313 ------
 JSLib/tests/code/readerutils.cs                 |  22 +-
 JSLib/tests/common/ODataReadOracle.js           | 146 +--
 JSLib/tests/common/ODataReadOracle.svc          |  27 +-
 JSLib/tests/common/cacheoracle.js               | 119 ---
 JSLib/tests/common/djstest.js                   |  11 +-
 JSLib/tests/common/observablehttpclient.js      |  77 --
 JSLib/tests/endpoints/FoodStoreDataService.svc  | 430 ---------
 .../tests/endpoints/FoodStoreDataServiceV2.svc  | 442 ---------
 .../tests/endpoints/FoodStoreDataServiceV3.svc  | 583 ------------
 .../tests/endpoints/FoodStoreDataServiceV4.svc  | 589 ++++++++++++
 JSLib/tests/endpoints/web.config                |   7 +-
 JSLib/tests/odata-atom-tests.js                 | 945 +++++++++----------
 JSLib/tests/odata-qunit-tests.htm               |  28 +-
 33 files changed, 1824 insertions(+), 3107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/BuildTools/djsbuildver.cmd
----------------------------------------------------------------------
diff --git a/BuildTools/djsbuildver.cmd b/BuildTools/djsbuildver.cmd
index 279e499..49e8cb7 100644
--- a/BuildTools/djsbuildver.cmd
+++ b/BuildTools/djsbuildver.cmd
@@ -13,4 +13,4 @@ rem WARRANTIES OF MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFR
 rem COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
 rem ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-set DJSVER=1.1.2
\ No newline at end of file
+set DJSVER=2.0.0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/JSLib.csproj
----------------------------------------------------------------------
diff --git a/JSLib/JSLib.csproj b/JSLib/JSLib.csproj
index bff96ae..43b19fd 100644
--- a/JSLib/JSLib.csproj
+++ b/JSLib/JSLib.csproj
@@ -1,131 +1,187 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-	<PropertyGroup>
-		<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-		<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-		<ProductVersion>
-		</ProductVersion>
-		<SchemaVersion>2.0</SchemaVersion>
-		<ProjectGuid>{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}</ProjectGuid>
-		<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
-		<OutputType>Library</OutputType>
-		<AppDesignerFolder>Properties</AppDesignerFolder>
-		<RootNamespace>JSLib</RootNamespace>
-		<AssemblyName>JSLib</AssemblyName>
-		<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-		<UseIISExpress>false</UseIISExpress>
-	</PropertyGroup>
-	<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-		<DebugSymbols>true</DebugSymbols>
-		<DebugType>full</DebugType>
-		<Optimize>false</Optimize>
-		<OutputPath>bin\</OutputPath>
-		<DefineConstants>DEBUG;TRACE</DefineConstants>
-		<ErrorReport>prompt</ErrorReport>
-		<WarningLevel>4</WarningLevel>
-	</PropertyGroup>
-	<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-		<DebugType>pdbonly</DebugType>
-		<Optimize>true</Optimize>
-		<OutputPath>bin\</OutputPath>
-		<DefineConstants>TRACE</DefineConstants>
-		<ErrorReport>prompt</ErrorReport>
-		<WarningLevel>4</WarningLevel>
-	</PropertyGroup>
-	<ItemGroup>
-		<!-- Product code. -->
-		<Content Include="src\cache-source.js"/>
-		<Content Include="src\odata-gml.js"/>
-		<Content Include="src\utils.js"/>
-		<Content Include="src\odata-json-light.js"/>
-		<Content Include="src\datajs.js"/>
-		<Content Include="src\cache.js"/>
-		<Content Include="src\deferred.js"/>
-		<Content Include="src\odata.js"/>
-		<Content Include="src\odata-batch.js"/>
-		<Content Include="src\odata-handler.js"/>
-		<Content Include="src\odata-utils.js"/>
-		<Content Include="src\odata-xml.js"/>
-		<Content Include="src\odata-metadata.js"/>
-		<Content Include="src\odata-json.js"/>
-		<Content Include="src\odata-atom.js"/>
-		<Content Include="src\odata-net.js"/>
-		<Content Include="src\store-dom.js"/>
-		<Content Include="src\store-indexeddb.js"/>
-		<Content Include="src\store-memory.js"/>
-		<Content Include="src\store.js"/>
-		<Content Include="src\xml.js"/>
-		<Content Include="tests\common\djstest.js"/>
-		<Content Include="tests\common\ODataReadOracle.js"/>
-		<Content Include="tests\common\ODataReadOracle.svc"/>
-		<Content Include="tests\common\TestLogger.svc"/>
-		<Content Include="tests\common\TestSynchronizerClient.js"/>
-		<Content Include="tests\endpoints\FoodStoreDataServiceV3.svc"/>
-		<Content Include="tests\endpoints\FoodStoreDataService.svc"/>
-		<Content Include="tests\endpoints\FoodStoreDataServiceV2.svc"/>
-		<Content Include="tests\endpoints\web.config"/>
-		<Content Include="tests\odata-atom-tests.js"/>
-		<Content Include="tests\odata-qunit-tests.htm"/>
-		<Content Include="tests\run-tests.wsf"/>
-		<Content Include="tests\test-list.js"/>
-		<!-- Configuration file for the web project. -->
-		<Content Include="Web.config"/>
-	</ItemGroup>
-	<ItemGroup>
-		<Compile Include="tests\code\AtomReader.cs"/>
-		<Compile Include="tests\code\CsdlReader.cs"/>
-		<Compile Include="tests\code\JsDate.cs"/>
-		<Compile Include="tests\code\JsonObject.cs"/>
-		<Compile Include="tests\code\ReaderUtils.cs"/>
-		<Compile Include="tests\code\ReflectionDataContext.cs"/>
-	</ItemGroup>
-	<ItemGroup>
-	</ItemGroup>
-	<ItemGroup>
-		<Reference Include="Microsoft.Data.Edm, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-			<HintPath>packages\Microsoft.Data.Edm.5.1.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
-		</Reference>
-		<Reference Include="Microsoft.Data.OData, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-			<HintPath>packages\Microsoft.Data.OData.5.1.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
-		</Reference>
-		<Reference Include="Microsoft.Data.Services, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-			<HintPath>packages\Microsoft.Data.Services.5.1.0\lib\net40\Microsoft.Data.Services.dll</HintPath>
-		</Reference>
-		<Reference Include="Microsoft.Data.Services.Client, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-			<HintPath>packages\Microsoft.Data.Services.Client.5.1.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
-		</Reference>
-		<Reference Include="System"/>
-		<Reference Include="System.Net"/>
-		<Reference Include="System.Runtime.Serialization"/>
-		<Reference Include="System.ServiceModel"/>
-		<Reference Include="System.ServiceModel.Activation"/>
-		<Reference Include="System.ServiceModel.Web"/>
-		<Reference Include="System.Spatial, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-			<HintPath>packages\System.Spatial.5.1.0\lib\net40\System.Spatial.dll</HintPath>
-		</Reference>
-		<Reference Include="System.Web.Extensions"/>
-		<Reference Include="System.Xml"/>
-		<Reference Include="System.Xml.Linq"/>
-	</ItemGroup>
-	<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets"/>
-	<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets"/>
-	<ProjectExtensions>
-		<VisualStudio>
-			<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
-				<WebProjectProperties>
-					<UseIIS>False</UseIIS>
-					<AutoAssignPort>True</AutoAssignPort>
-					<DevelopmentServerPort>10092</DevelopmentServerPort>
-					<DevelopmentServerVPath>/</DevelopmentServerVPath>
-					<IISUrl>
-					</IISUrl>
-					<NTLMAuthentication>False</NTLMAuthentication>
-					<UseCustomServer>False</UseCustomServer>
-					<CustomServerUrl>
-					</CustomServerUrl>
-					<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
-				</WebProjectProperties>
-			</FlavorProperties>
-		</VisualStudio>
-	</ProjectExtensions>
-</Project>
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>
+    </ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}</ProjectGuid>
+    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>JSLib</RootNamespace>
+    <AssemblyName>JSLib</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <SccProjectName>SAK</SccProjectName>
+    <SccLocalPath>SAK</SccLocalPath>
+    <SccAuxPath>SAK</SccAuxPath>
+    <SccProvider>SAK</SccProvider>
+    <UseIISExpress>false</UseIISExpress>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <!-- Product code. -->
+    <Content Include="src\cache-source.js" />
+    <Content Include="src\odata-gml.js" />
+    <Content Include="src\utils.js" />
+    <Content Include="src\odata-json-light.js" />
+    <Content Include="src\datajs.js" />
+    <Content Include="src\cache.js" />
+    <Content Include="src\deferred.js" />
+    <Content Include="src\odata.js" />
+    <Content Include="src\odata-batch.js" />
+    <Content Include="src\odata-handler.js" />
+    <Content Include="src\odata-utils.js" />
+    <Content Include="src\odata-xml.js" />
+    <Content Include="src\odata-metadata.js" />
+    <Content Include="src\odata-json.js" />
+    <Content Include="src\odata-atom.js" />
+    <Content Include="src\odata-net.js" />
+    <Content Include="src\store-dom.js" />
+    <Content Include="src\store-indexeddb.js" />
+    <Content Include="src\store-memory.js" />
+    <Content Include="src\store.js" />
+    <Content Include="src\xml.js" />
+    <Content Include="tests\cache-tests.js" />
+    <Content Include="tests\common\CacheOracle.js" />
+    <Content Include="tests\common\Instrument.svc" />
+    <Content Include="tests\common\Instrument.js" />
+    <Content Include="tests\common\mockXMLHttpRequest.js" />
+    <Content Include="tests\common\mockHttpClient.js" />
+    <Content Include="tests\common\djstest.js" />
+    <Content Include="tests\common\gpo-ie8-tour-disable.reg" />
+    <Content Include="tests\common\ObservableHttpClient.js" />
+    <Content Include="tests\common\ODataReadOracle.js" />
+    <Content Include="tests\common\ODataReadOracle.svc" />
+    <Content Include="tests\common\rx.js" />
+    <Content Include="tests\common\TestLogger.svc" />
+    <Content Include="tests\common\TestSynchronizerClient.js" />
+    <Content Include="tests\odata-json-light-tests.js" />
+    <Content Include="tests\datajs-startup-perf-test.html" />
+    <Content Include="tests\endpoints\BasicAuthDataService.svc" />
+    <Content Include="tests\endpoints\FoodStoreDataServiceV4.svc" />
+    <Content Include="tests\endpoints\CustomAnnotations.xml" />
+    <Content Include="tests\endpoints\CustomDataService.svc" />
+    <Content Include="tests\endpoints\EpmDataService.svc" />
+    <Content Include="tests\endpoints\ErrorDataService.svc" />
+    <Content Include="tests\endpoints\LargeCollectionService.svc" />
+    <Content Include="tests\endpoints\web.config" />
+    <Content Include="tests\datajs-cache-large-collection-functional-tests.html" />
+    <Content Include="tests\datajs-cache-large-collection-functional-tests.js" />
+    <Content Include="tests\datajs-cache-long-haul-tests.html" />
+    <Content Include="tests\odata-atom-tests.js" />
+    <Content Include="tests\odata-batch-functional-tests.html" />
+    <Content Include="tests\odata-batch-functional-tests.js" />
+    <Content Include="tests\odata-batch-tests.js" />
+    <Content Include="tests\odata-cache-filter-functional-tests.html" />
+    <Content Include="tests\odata-cache-filter-functional-tests.js" />
+    <Content Include="tests\odata-cache-fperf-tests.html" />
+    <Content Include="tests\odata-cache-fperf-tests.js" />
+    <Content Include="tests\odata-cache-functional-tests.html" />
+    <Content Include="tests\odata-cache-functional-tests.js" />
+    <Content Include="tests\odata-cache-rx-functional-tests.html" />
+    <Content Include="tests\odata-cache-rx-functional-tests.js" />
+    <Content Include="tests\odata-fuzz.html" />
+    <Content Include="tests\odata-metadata-tests.js" />
+    <Content Include="tests\odata-handler-tests.js" />
+    <Content Include="tests\odata-json-tests.js" />
+    <Content Include="tests\odata-links-functional-tests.html" />
+    <Content Include="tests\odata-links-functional-tests.js" />
+    <Content Include="tests\odata-metadata-awareness-functional-tests.html" />
+    <Content Include="tests\odata-metadata-awareness-functional-tests.js" />
+    <Content Include="tests\odata-net-tests.js" />
+    <Content Include="tests\odata-perf-tests.html" />
+    <Content Include="tests\odata-perf-tests.js" />
+    <Content Include="tests\odata-read-crossdomain-functional-tests.html" />
+    <Content Include="tests\odata-read-crossdomain-functional-tests.js" />
+    <Content Include="tests\odata-read-functional-tests.html" />
+    <Content Include="tests\odata-request-functional-tests.html" />
+    <Content Include="tests\odata-request-functional-tests.js" />
+    <Content Include="tests\odata-read-functional-tests.js" />
+    <Content Include="tests\odata-qunit-tests.htm" />
+    <Content Include="tests\odata-tests.js" />
+    <Content Include="tests\odata-xml-tests.js" />
+    <Content Include="tests\run-tests.wsf" />
+    <Content Include="tests\store-indexeddb-tests.js" />
+    <Content Include="tests\store-tests.js" />
+    <Content Include="tests\test-list.js" />
+    <Content Include="tests\test-manager.html" />
+    <!-- Configuration file for the web project. -->
+    <Content Include="Web.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="tests\code\AtomReader.cs" />
+    <Compile Include="tests\code\CsdlReader.cs" />
+    <Compile Include="tests\code\JsDate.cs" />
+    <Compile Include="tests\code\JsonObject.cs" />
+    <Compile Include="tests\code\ReaderUtils.cs" />
+    <Compile Include="tests\code\ReflectionDataContext.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.OData.Client, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.OData.Client.6.0.0-beta1\lib\net40\Microsoft.OData.Client.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.OData.Core">
+      <HintPath>packages\Microsoft.OData.Core.6.0.0-beta1\lib\portable-net40+sl5+wp8+win8\Microsoft.OData.Core.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.OData.Edm">
+      <HintPath>packages\Microsoft.OData.Edm.6.0.0-beta1\lib\portable-net40+sl5+wp8+win8\Microsoft.OData.Edm.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.OData.Service, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.OData.Service.6.0.0-beta1\lib\net40\Microsoft.OData.Service.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Spatial">
+      <HintPath>packages\Microsoft.Spatial.6.0.0-beta1\lib\portable-net40+sl5+wp8+win8\Microsoft.Spatial.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Net" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.ServiceModel" />
+    <Reference Include="System.ServiceModel.Activation" />
+    <Reference Include="System.ServiceModel.Web" />
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Xml.Linq" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+        <WebProjectProperties>
+          <UseIIS>False</UseIIS>
+          <AutoAssignPort>True</AutoAssignPort>
+          <DevelopmentServerPort>46541</DevelopmentServerPort>
+          <DevelopmentServerVPath>/</DevelopmentServerVPath>
+          <IISUrl>
+          </IISUrl>
+          <NTLMAuthentication>False</NTLMAuthentication>
+          <UseCustomServer>False</UseCustomServer>
+          <CustomServerUrl>
+          </CustomServerUrl>
+          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+        </WebProjectProperties>
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/Web.config
----------------------------------------------------------------------
diff --git a/JSLib/Web.config b/JSLib/Web.config
index 142a457..2e1d265 100644
--- a/JSLib/Web.config
+++ b/JSLib/Web.config
@@ -10,9 +10,9 @@
         <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
         <add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
         <add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
-        <add assembly="Microsoft.Data.OData, Version=5.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
-        <add assembly="Microsoft.Data.Services, Version=5.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
-        <add assembly="Microsoft.Data.Services.Client, Version=5.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+        <add assembly="Microsoft.OData.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+        <add assembly="Microsoft.OData.Service, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+        <add assembly="Microsoft.OData.Client, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
       </assemblies>
     </compilation>
   </system.web>

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/cache-source.js
----------------------------------------------------------------------
diff --git a/JSLib/src/cache-source.js b/JSLib/src/cache-source.js
index 3616b84..6348a92 100644
--- a/JSLib/src/cache-source.js
+++ b/JSLib/src/cache-source.js
@@ -19,7 +19,6 @@
 
     var datajs = window.datajs || {};
     var odata = window.OData || {};
-
     var parseInt10 = datajs.parseInt10;
     var normalizeURICase = datajs.normalizeURICase;
 
@@ -96,7 +95,7 @@
         /// <param name="error" type="Function">Error callback.</param>
         /// <returns type="Object">Object with an abort method.</returns>
 
-        var request = queryForDataInternal(uri, options, [], success, error);
+        var request = queryForDataInternal(uri, options, {}, success, error);
         return request;
     };
 
@@ -111,14 +110,29 @@
 
         var request = buildODataRequest(uri, options);
         var currentRequest = odata.request(request, function (newData) {
-            var next = newData.__next;
-            var results = newData.results;
+            var nextLink = newData["@odata.nextLink"];
+            if (nextLink) {
+                var index = uri.indexOf(".svc/", 0);
+                if (index != -1) {
+                    nextLink = uri.substring(0, index + 5) + nextLink;
+                }
+            }
 
-            data = data.concat(results);
+            if (data.value && newData.value) {
+                data.value = data.value.concat(newData.value);
+            }
+            else {
+                for (var property in newData) {
+                    if (property != "@odata.nextLink") {
+                        data[property] = newData[property];
+                    }
+                }
+            }
 
-            if (next) {
-                currentRequest = queryForDataInternal(next, options, data, success, error);
-            } else {
+            if (nextLink) {
+                currentRequest = queryForDataInternal(nextLink, options, data, success, error);
+            }
+            else {
                 success(data);
             }
         }, error, undefined, options.httpClient, options.metadata);
@@ -137,7 +151,7 @@
 
         var that = this;
         var uri = options.source;
-        
+
         that.identifier = normalizeURICase(encodeURI(decodeURI(uri)));
         that.options = options;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/cache.js
----------------------------------------------------------------------
diff --git a/JSLib/src/cache.js b/JSLib/src/cache.js
index b3a3a01..2092af4 100644
--- a/JSLib/src/cache.js
+++ b/JSLib/src/cache.js
@@ -31,6 +31,9 @@
     var createDeferred = datajs.createDeferred;
     var DjsDeferred = datajs.DjsDeferred;
     var ODataCacheSource = datajs.ODataCacheSource;
+    var getJsonValueArraryLength = datajs.getJsonValueArraryLength;
+    var sliceJsonValueArray = datajs.sliceJsonValueArray;
+    var concatJsonValueArray = datajs.concatJsonValueArray;
 
     // CONTENT START
 
@@ -40,11 +43,14 @@
         /// <param name="page" type="Object">Page with (i)ndex, (c)ount and (d)ata.</param>
 
         var intersection = intersectRanges(operation, page);
+        var start = 0;
+        var end = 0;
         if (intersection) {
-            var start = intersection.i - page.i;
-            var end = start + (operation.c - operation.d.length);
-            operation.d = operation.d.concat(page.d.slice(start, end));
+            start = intersection.i - page.i;
+            end = start + (operation.c - getJsonValueArraryLength(operation.d));
         }
+
+        operation.d = concatJsonValueArray(operation.d, sliceJsonValueArray(page.d, start, end));
     };
 
     var intersectRanges = function (x, y) {
@@ -523,7 +529,7 @@
             var deferred = createDeferred();
 
             // Merging read operations would be a nice optimization here.
-            var op = new DataCacheOperation(readStateMachine, deferred, true, index, count, [], 0);
+            var op = new DataCacheOperation(readStateMachine, deferred, true, index, count, {}, 0);
             queueAndStart(op, readOperations);
 
             return extend(deferred.promise(), {
@@ -558,13 +564,13 @@
                 var successCallback = function (data) {
                     if (!disposed) {
                         var i, len;
-                        for (i = 0, len = data.length; i < len; i++) {
+                        for (i = 0, len = data.value.length; i < len; i++) {
                             // The wrapper automatically checks for Dispose
                             // on the observer, so we don't need to check it here.
-                            obs.OnNext(data[i]);
+                            obs.OnNext(data.value[i]);
                         }
 
-                        if (data.length < pageSize) {
+                        if (data.value.length < pageSize) {
                             obs.OnCompleted();
                         } else {
                             index += pageSize;
@@ -683,7 +689,8 @@
             var canceled = false;
 
             var request = source.read(start, pageSize, function (data) {
-                var page = { i: start, c: data.length, d: data };
+                var length = getJsonValueArraryLength(data);
+                var page = { i: start, c: length, d: data };
                 deferred.resolve(page);
             }, function (err) {
                 deferred.reject(err);
@@ -727,32 +734,37 @@
             index = Math.max(index, 0);
 
             var deferred = createDeferred();
-            var arr = [];
+            var returnData = {};
+            returnData.value = [];
             var canceled = false;
             var pendingReadRange = null;
 
             var readMore = function (readIndex, readCount) {
                 if (!canceled) {
-                    if (count >= 0 && arr.length >= count) {
-                        deferred.resolve(arr);
+                    if (count > 0 && returnData.value.length >= count) {
+                        deferred.resolve(returnData);
                     } else {
                         pendingReadRange = that.readRange(readIndex, readCount).then(function (data) {
-                            for (var i = 0, length = data.length; i < length && (count < 0 || arr.length < count); i++) {
+                            if (data["@odata.context"] && !returnData["@odata.context"]) {
+                                returnData["@odata.context"] = data["@odata.context"];
+                            }
+                            
+                            for (var i = 0, length = data.value.length; i < length && (count < 0 || returnData.value.length < count); i++) {
                                 var dataIndex = backwards ? length - i - 1 : i;
-                                var item = data[dataIndex];
+                                var item = data.value[dataIndex];
                                 if (predicate(item)) {
                                     var element = {
                                         index: readIndex + dataIndex,
                                         item: item
                                     };
 
-                                    backwards ? arr.unshift(element) : arr.push(element);
+                                    backwards ? returnData.value.unshift(element) : returnData.value.push(element);
                                 }
                             }
 
                             // Have we reached the end of the collection?
-                            if ((!backwards && data.length < readCount) || (backwards && readIndex <= 0)) {
-                                deferred.resolve(arr);
+                            if ((!backwards && data.value.length < readCount) || (backwards && readIndex <= 0)) {
+                                deferred.resolve(returnData);
                             } else {
                                 var nextIndex = backwards ? Math.max(readIndex - pageSize, 0) : readIndex + readCount;
                                 readMore(nextIndex, pageSize);
@@ -1149,7 +1161,7 @@
                         if (cacheState === CACHE_STATE_IDLE || cacheState === CACHE_STATE_PREFETCH) {
                             // Signal the cache that a read operation is running.
                             changeState(CACHE_STATE_READ);
-                            if (operation.c > 0) {
+                            if (operation.c >= 0) {
                                 // Snap the requested range to a page boundary.
                                 var range = snapToPageBoundaries(operation.i, operation.c, pageSize);
                                 transition(READ_STATE_LOCAL, range.i);
@@ -1164,7 +1176,7 @@
                         // continue processing.
                         // Data is expected to be the read page.
                         appendPage(operation, data);
-                        var len = operation.d.length;
+                        var len = getJsonValueArraryLength(operation.d);
                         // Are we done?
                         if (operation.c === len || data.c < pageSize) {
                             // Update the stats, request for a prefetch operation.

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/odata-atom.js
----------------------------------------------------------------------
diff --git a/JSLib/src/odata-atom.js b/JSLib/src/odata-atom.js
index d92c2a6..e360e3c 100644
--- a/JSLib/src/odata-atom.js
+++ b/JSLib/src/odata-atom.js
@@ -100,9 +100,9 @@
     var atomXmlNs = w3org + "2005/Atom";                    // http://www.w3.org/2005/Atom
     var appXmlNs = w3org + "2007/app";                      // http://www.w3.org/2007/app
 
-    var odataEditMediaPrefix = adoDs + "/edit-media/";        // http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media
-    var odataMediaResourcePrefix = adoDs + "/mediaresource/"; // http://schemas.microsoft.com/ado/2007/08/dataservices/mediaresource
-    var odataRelatedLinksPrefix = adoDs + "/relatedlinks/";   // http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks
+    var odataEditMediaPrefix = adoDs + "/edit-media/";        // http://docs.oasis-open.org/odata/ns/edit-media
+    var odataMediaResourcePrefix = adoDs + "/mediaresource/"; // http://docs.oasis-open.org/odata/ns/mediaresource
+    var odataRelatedLinksPrefix = adoDs + "/relatedlinks/";   // http://docs.oasis-open.org/odata/ns/relatedlinks
 
     var atomAcceptTypes = ["application/atom+xml", "application/atomsvc+xml", "application/xml"];
     var atomMediaType = atomAcceptTypes[0];

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/odata-handler.js
----------------------------------------------------------------------
diff --git a/JSLib/src/odata-handler.js b/JSLib/src/odata-handler.js
index 5f83429..bb83836 100644
--- a/JSLib/src/odata-handler.js
+++ b/JSLib/src/odata-handler.js
@@ -27,7 +27,7 @@
 
     // CONTENT START
 
-    var MAX_DATA_SERVICE_VERSION = "3.0";
+    var MAX_DATA_SERVICE_VERSION = "4.0";
 
     var contentType = function (str) {
         /// <summary>Parses a string into an object with media type and properties.</summary>
@@ -111,8 +111,8 @@
 
         if (request) {
             var headers = request.headers;
-            var dsv = headers["DataServiceVersion"];
-            headers["DataServiceVersion"] = dsv ? maxVersion(dsv, version) : version;
+            var dsv = headers["OData-Version"];
+            headers["OData-Version"] = dsv ? maxVersion(dsv, version) : version;
         }
     };
 
@@ -140,7 +140,7 @@
         /// <param name="requestOrResponse">Object representing a request or a response.</param>
         /// <returns type="String">Data service version; undefined if the header cannot be found.</returns>
 
-        var value = getRequestOrResponseHeader(requestOrResponse, "DataServiceVersion");
+        var value = getRequestOrResponseHeader(requestOrResponse, "OData-Version");
         if (value) {
             var matches = versionRE.exec(value);
             if (matches && matches.length) {
@@ -213,10 +213,10 @@
             request.body = serializeCallback(handler, request.data, writeContext);
 
             if (request.body !== undefined) {
-                fixDataServiceVersionHeader(request, writeContext.dataServiceVersion || "1.0");
+                fixDataServiceVersionHeader(request, writeContext.dataServiceVersion || "4.0");
 
                 fixRequestHeader(request, "Content-Type", contentTypeToString(writeContext.contentType));
-                fixRequestHeader(request, "MaxDataServiceVersion", handler.maxDataServiceVersion);
+                fixRequestHeader(request, "OData-MaxVersion", handler.maxDataServiceVersion);
                 return true;
             }
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/odata-json-light.js
----------------------------------------------------------------------
diff --git a/JSLib/src/odata-json-light.js b/JSLib/src/odata-json-light.js
index 9a10601..bf654ce 100644
--- a/JSLib/src/odata-json-light.js
+++ b/JSLib/src/odata-json-light.js
@@ -73,8 +73,9 @@
     var odataNs = "odata";
     var odataAnnotationPrefix = odataNs + ".";
 
+    var contextUrlAnnotation = "@" + odataAnnotationPrefix + "context";
+
     var bindAnnotation = "@" + odataAnnotationPrefix + "bind";
-    var metadataAnnotation = odataAnnotationPrefix + "metadata";
     var navUrlAnnotation = odataAnnotationPrefix + "navigationLinkUrl";
     var typeAnnotation = odataAnnotationPrefix + "type";
 
@@ -1044,7 +1045,7 @@
         ///     Object with kind and type fields. Null if there is no metadata annotation or the payload info cannot be obtained..
         /// </returns>
 
-        var metadataUri = data[metadataAnnotation];
+        var metadataUri = data[contextUrlAnnotation];
         if (!metadataUri || typeof metadataUri !== "string") {
             return null;
         }
@@ -1144,15 +1145,15 @@
             return data;
         }
 
-        contentTypeOdata = contentTypeOdata || "minimalmetadata";
-        var baseURI = data[metadataAnnotation];
+        contentTypeOdata = contentTypeOdata || "minimal";
+        var baseURI = data[contextUrlAnnotation];
         var payloadInfo = jsonLightPayloadInfo(data, model, inferFeedAsComplexType);
         if (assigned(payloadInfo)) {
             payloadInfo.contentTypeOdata = contentTypeOdata;
         }
         var typeName = null;
         if (payloadInfo) {
-            delete data[metadataAnnotation];
+            delete data[contextUrlAnnotation];
 
             typeName = payloadInfo.type;
             switch (payloadInfo.kind) {
@@ -1171,7 +1172,56 @@
         return jsonLightReadObject(data, payloadInfo, baseURI, model, recognizeDates);
     };
 
-    var jsonLightSerializableMetadata = ["type", "etag", "media_src", "edit_media", "content_type", "media_etag"];
+    var jsonLightSerializableMetadata = ["@odata.type", "@odata.etag", "@odata.mediaEditLink", "@odata.mediaReadLink", "@odata.mediaContentType", "@odata.mediaEtag"];
+
+    var formatJsonLightRequestPayload = function (data) {
+        if (!data) {
+            return data;
+        }
+
+        if (isPrimitive(data)) {
+            return data;
+        }
+
+        if (isArray(data)) {
+            var newArrayData = [];
+            var i, len;
+            for (i = 0, len = data.length; i < len; i++) {
+                newArrayData[i] = formatJsonLightRequestPayload(data[i]);
+            }
+
+            return newArrayData;
+        }
+
+        var newdata = {};
+        for (var property in data) {
+            if (isJsonLightSerializableProperty(property)) {
+                newdata[property] = formatJsonLightRequestPayload(data[property]);
+            }
+        }
+
+        return newdata;
+    };
+
+    var isJsonLightSerializableProperty = function (property) {
+        if (!property) {
+            return false;
+        }
+
+        if (property.indexOf("@odata.") == -1) {
+            return true;
+        }
+
+        var i, len;
+        for (i = 0, len = jsonLightSerializableMetadata.length; i < len; i++) {
+            var name = jsonLightSerializableMetadata[i];
+            if (property.indexOf(name) != -1) {
+                return true;
+            }
+        }
+
+        return false;
+    };
 
     var formatJsonLight = function (obj, context) {
         /// <summary>Converts an object in the library's internal representation to its json light representation.</summary>
@@ -1370,7 +1420,7 @@
         /// <param name="data" type="Object">Object on which the annotation is going to be stored.</param>
 
         if (value !== undefined) {
-            if(target) {
+            if (target) {
                 data[target + "@" + qName] = value;
             }
             else {
@@ -1382,6 +1432,7 @@
     // DATAJS INTERNAL START
     odata.jsonLightReadPayload = jsonLightReadPayload;
     odata.formatJsonLight = formatJsonLight;
+    odata.formatJsonLightRequestPayload = formatJsonLightRequestPayload;
     // DATAJS INTERNAL END
 
     // CONTENT END

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/odata-json.js
----------------------------------------------------------------------
diff --git a/JSLib/src/odata-json.js b/JSLib/src/odata-json.js
index 8f11857..933f980 100644
--- a/JSLib/src/odata-json.js
+++ b/JSLib/src/odata-json.js
@@ -45,6 +45,7 @@
     var parseTimezone = odata.parseTimezone;
     var payloadTypeOf = odata.payloadTypeOf;
     var traverse = odata.traverse;
+    var formatJsonLightRequestPayload = odata.formatJsonLightRequestPayload;
 
     // CONTENT START
 
@@ -132,9 +133,10 @@
         /// <returns type="Boolean">True is the content type indicates a json light payload. False otherwise.</returns>
 
         if (contentType) {
-            var odata = contentType.properties.odata;
-            return odata === "nometadata" || odata === "minimalmetadata" || odata === "fullmetadata";
+            var odata = contentType.properties["odata.metadata"];
+            return odata === "none" || odata === "minimal" || odata === "full";
         }
+
         return false;
     };
 
@@ -233,26 +235,14 @@
         /// <param name="context" type="Object">Object with parsing context.</param>
         /// <returns>An object representation of the OData payload.</returns>
 
-        var recognizeDates = defined(context.recognizeDates, handler.recognizeDates);
-        var inferJsonLightFeedAsObject = defined(context.inferJsonLightFeedAsObject, handler.inferJsonLightFeedAsObject);
-        var model = context.metadata;
         var dataServiceVersion = context.dataServiceVersion;
-        var dateParser = parseJsonDateString;
         var json = (typeof text === "string") ? window.JSON.parse(text) : text;
 
-        if ((maxVersion("3.0", dataServiceVersion) === dataServiceVersion)) {
-            if (isJsonLight(context.contentType)) {
-                return jsonLightReadPayload(json, model, recognizeDates, inferJsonLightFeedAsObject, context.contentType.properties.odata);
-            }
-            dateParser = parseDateTime;
+        if ((maxVersion("4.0", dataServiceVersion) === dataServiceVersion)) {
+            return json;
         }
 
-        json = traverse(json.d, function (key, value) {
-            return jsonApplyMetadata(value, model, dateParser, recognizeDates);
-        });
-
-        json = jsonUpdateDataFromVersion(json, context.dataServiceVersion);
-        return jsonNormalizeData(json, context.response.requestUri);
+        return undefined;
     };
 
     var jsonToString = function (data) {
@@ -283,23 +273,17 @@
         /// <param name="context" type="Object">Object with serialization context.</param>
         /// <returns type="String">The string representation of data.</returns>
 
-        var dataServiceVersion = context.dataServiceVersion || "1.0";
-        var useJsonLight = defined(context.useJsonLight, handler.useJsonLight);
+        var dataServiceVersion = context.dataServiceVersion || "4.0";
         var cType = context.contentType = context.contentType || jsonContentType;
 
         if (cType && cType.mediaType === jsonContentType.mediaType) {
-            var json = data;
-            if (useJsonLight || isJsonLight(cType)) {
-                context.dataServiceVersion = maxVersion(dataServiceVersion, "3.0");
-                json = formatJsonLight(data, context);
-                return jsonToString(json);
-            }
-            if (maxVersion("3.0", dataServiceVersion) === dataServiceVersion) {
-                cType.properties.odata = "verbose";
-                context.contentType = cType;
+            context.dataServiceVersion = maxVersion(dataServiceVersion, "4.0");
+            var newdata = formatJsonLightRequestPayload(data);
+            if (newdata) {
+                return window.JSON.stringify(newdata);
             }
-            return jsonToString(json);
         }
+
         return undefined;
     };
 
@@ -331,32 +315,8 @@
         return isSvcDoc ? normalizeServiceDocument(data, baseURI) : data;
     };
 
-    var jsonUpdateDataFromVersion = function (data, dataVersion) {
-        /// <summary>
-        /// Updates the specified data in the specified version to look
-        /// like the latest supported version.
-        /// </summary>
-        /// <param name="data" optional="false">Data to update.</param>
-        /// <param name="dataVersion" optional="true" type="String">Version the data is in (possibly unknown).</param>
-
-        // Strip the trailing comma if there.
-        if (dataVersion && dataVersion.lastIndexOf(";") === dataVersion.length - 1) {
-            dataVersion = dataVersion.substr(0, dataVersion.length - 1);
-        }
-
-        if (!dataVersion || dataVersion === "1.0") {
-            if (isArray(data)) {
-                data = { results: data };
-            }
-        }
-
-        return data;
-    };
-
     var jsonHandler = handler(jsonParser, jsonSerializer, jsonMediaType, MAX_DATA_SERVICE_VERSION);
     jsonHandler.recognizeDates = false;
-    jsonHandler.useJsonLight = false;
-    jsonHandler.inferJsonLightFeedAsObject = false;
 
     odata.jsonHandler = jsonHandler;
 
@@ -366,7 +326,6 @@
     odata.jsonParser = jsonParser;
     odata.jsonSerializer = jsonSerializer;
     odata.jsonNormalizeData = jsonNormalizeData;
-    odata.jsonUpdateDataFromVersion = jsonUpdateDataFromVersion;
     odata.normalizeServiceDocument = normalizeServiceDocument;
     odata.parseJsonDateString = parseJsonDateString;
     // DATAJS INTERNAL END

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/odata-metadata.js
----------------------------------------------------------------------
diff --git a/JSLib/src/odata-metadata.js b/JSLib/src/odata-metadata.js
index a7ca00a..4978c32 100644
--- a/JSLib/src/odata-metadata.js
+++ b/JSLib/src/odata-metadata.js
@@ -32,15 +32,8 @@
     var xmlnsNS = datajs.xmlnsNS;
     var xmlParse = datajs.xmlParse;
 
-    var createAttributeExtension = odata.createAttributeExtension;
-    var createElementExtension = odata.createElementExtension;
     var edmxNs = odata.edmxNs;
     var edmNs1 = odata.edmNs1;
-    var edmNs1_1 = odata.edmNs1_1;
-    var edmNs1_2 = odata.edmNs1_2;
-    var edmNs2a = odata.edmNs2a;
-    var edmNs2b = odata.edmNs2b;
-    var edmNs3 = odata.edmNs3;
     var handler = odata.handler;
     var MAX_DATA_SERVICE_VERSION = odata.MAX_DATA_SERVICE_VERSION;
     var odataMetaXmlNs = odata.odataMetaXmlNs;
@@ -70,87 +63,136 @@
     };
 
     // It's assumed that all elements may have Documentation children and Annotation elements.
-    // See http://msdn.microsoft.com/en-us/library/bb399292.aspx for a CSDL reference.
+    // See http://docs.oasis-open.org/odata/odata/v4.0/cs01/part3-csdl/odata-v4.0-cs01-part3-csdl.html for a CSDL reference.
     var schema = {
         elements: {
+            Action: schemaElement(
+            /*attributes*/["Name", "IsBound", "EntitySetPath"],
+            /*elements*/["ReturnType", "Parameter*", "Annotation*"]
+            ),
+            ActionImport: schemaElement(
+            /*attributes*/["Name", "Action", "EntitySet", "Annotation*"]
+            ),
+            Annotation: schemaElement(
+            /*attributes*/["Term", "Qualifier", "Binary", "Bool", "Date", "DateTimeOffset", "Decimal", "Duration", "EnumMember", "Float", "Guid", "Int", "String", "TimeOfDay", "AnnotationPath", "NavigationPropertyPath", "Path", "PropertyPath", "UrlRef"],
+            /*elements*/["Binary*", "Bool*", "Date*", "DateTimeOffset*", "Decimal*", "Duration*", "EnumMember*", "Float*", "Guid*", "Int*", "String*", "TimeOfDay*", "And*", "Or*", "Not*", "Eq*", "Ne*", "Gt*", "Ge*", "Lt*", "Le*", "AnnotationPath*", "Apply*", "Cast*", "Collection*", "If*", "IsOf*", "LabeledElement*", "LabeledElementReference*", "Null*", "NavigationPropertyPath*", "Path*", "PropertyPath*", "Record*", "UrlRef*", "Annotation*"]
+            ),
+            AnnotationPath: schemaElement(
+            /*attributes*/null,
+            /*elements*/null,
+            /*text*/true
+            ),
             Annotations: schemaElement(
             /*attributes*/["Target", "Qualifier"],
-            /*elements*/["TypeAnnotation*", "ValueAnnotation*"]
+            /*elements*/["Annotation*"]
             ),
-            Association: schemaElement(
-            /*attributes*/["Name"],
-            /*elements*/["End*", "ReferentialConstraint", "TypeAnnotation*", "ValueAnnotation*"]
+            Apply: schemaElement(
+            /*attributes*/["Function"],
+            /*elements*/["String*", "Path*", "LabeledElement*", "Annotation*"]
             ),
-            AssociationSet: schemaElement(
-            /*attributes*/["Name", "Association"],
-            /*elements*/["End*", "TypeAnnotation*", "ValueAnnotation*"]
+            And: schemaElement(
+            /*attributes*/null,
+            /*elements*/null,
+            /*text*/true
             ),
-            Binary: schemaElement(
+            Or: schemaElement(
             /*attributes*/null,
             /*elements*/null,
             /*text*/true
             ),
-            Bool: schemaElement(
+            Not: schemaElement(
             /*attributes*/null,
             /*elements*/null,
             /*text*/true
             ),
-            Collection: schemaElement(
+            Eq: schemaElement(
             /*attributes*/null,
-            /*elements*/["String*", "Int*", "Float*", "Decimal*", "Bool*", "DateTime*", "DateTimeOffset*", "Guid*", "Binary*", "Time*", "Collection*", "Record*"]
+            /*elements*/null,
+            /*text*/true
             ),
-            CollectionType: schemaElement(
-            /*attributes*/["ElementType", "Nullable", "DefaultValue", "MaxLength", "FixedLength", "Precision", "Scale", "Unicode", "Collation", "SRID"],
-            /*elements*/["CollectionType", "ReferenceType", "RowType", "TypeRef"]
+            Ne: schemaElement(
+            /*attributes*/null,
+            /*elements*/null,
+            /*text*/true
             ),
-            ComplexType: schemaElement(
-            /*attributes*/["Name", "BaseType", "Abstract"],
-            /*elements*/["Property*", "TypeAnnotation*", "ValueAnnotation*"]
+            Gt: schemaElement(
+            /*attributes*/null,
+            /*elements*/null,
+            /*text*/true
             ),
-            DateTime: schemaElement(
+            Ge: schemaElement(
             /*attributes*/null,
             /*elements*/null,
             /*text*/true
             ),
-            DateTimeOffset: schemaElement(
+            Lt: schemaElement(
             /*attributes*/null,
             /*elements*/null,
             /*text*/true
             ),
-            Decimal: schemaElement(
+            Le: schemaElement(
             /*attributes*/null,
             /*elements*/null,
             /*text*/true
             ),
-            DefiningExpression: schemaElement(
+            Binary: schemaElement(
             /*attributes*/null,
             /*elements*/null,
             /*text*/true
             ),
-            Dependent: schemaElement(
-            /*attributes*/["Role"],
-            /*elements*/["PropertyRef*"]
+            Bool: schemaElement(
+            /*attributes*/null,
+            /*elements*/null,
+            /*text*/true
+            ),
+            Cast: schemaElement(
+            /*attributes*/["Type"],
+            /*elements*/["Path*", "Annotation*"]
+            ),
+            Collection: schemaElement(
+            /*attributes*/null,
+            /*elements*/["Binary*", "Bool*", "Date*", "DateTimeOffset*", "Decimal*", "Duration*", "EnumMember*", "Float*", "Guid*", "Int*", "String*", "TimeOfDay*", "And*", "Or*", "Not*", "Eq*", "Ne*", "Gt*", "Ge*", "Lt*", "Le*", "AnnotationPath*", "Apply*", "Cast*", "Collection*", "If*", "IsOf*", "LabeledElement*", "LabeledElementReference*", "Null*", "NavigationPropertyPath*", "Path*", "PropertyPath*", "Record*", "UrlRef*"]
+            ),
+            ComplexType: schemaElement(
+            /*attributes*/["Name", "BaseType", "Abstract", "OpenType"],
+            /*elements*/["Property*", "NavigationProperty*", "Annotation*"]
             ),
-            Documentation: schemaElement(
+            Date: schemaElement(
             /*attributes*/null,
             /*elements*/null,
             /*text*/true
             ),
-            End: schemaElement(
-            /*attributes*/["Type", "Role", "Multiplicity", "EntitySet"],
-            /*elements*/["OnDelete"]
+            DateTimeOffset: schemaElement(
+            /*attributes*/null,
+            /*elements*/null,
+            /*text*/true
+            ),
+            Decimal: schemaElement(
+            /*attributes*/null,
+            /*elements*/null,
+            /*text*/true
+            ),
+            Duration: schemaElement(
+            /*attributes*/null,
+            /*elements*/null,
+            /*text*/true
             ),
             EntityContainer: schemaElement(
             /*attributes*/["Name", "Extends"],
-            /*elements*/["EntitySet*", "AssociationSet*", "FunctionImport*", "TypeAnnotation*", "ValueAnnotation*"]
+            /*elements*/["EntitySet*", "Singleton*", "ActionImport*", "FunctionImport*", "Annotation*"]
             ),
             EntitySet: schemaElement(
-            /*attributes*/["Name", "EntityType"],
-            /*elements*/["TypeAnnotation*", "ValueAnnotation*"]
+            /*attributes*/["Name", "EntityType", "IncludeInServiceDocument"],
+            /*elements*/["NavigationPropertyBinding*", "Annotation*"]
             ),
             EntityType: schemaElement(
-            /*attributes*/["Name", "BaseType", "Abstract", "OpenType"],
-            /*elements*/["Key", "Property*", "NavigationProperty*", "TypeAnnotation*", "ValueAnnotation*"]
+            /*attributes*/["Name", "BaseType", "Abstract", "OpenType", "HasStream"],
+            /*elements*/["Key*", "Property*", "NavigationProperty*", "Annotation*"]
+            ),
+            EnumMember: schemaElement(
+            /*attributes*/null,
+            /*elements*/null,
+            /*text*/true
             ),
             EnumType: schemaElement(
             /*attributes*/["Name", "UnderlyingType", "IsFlags"],
@@ -162,44 +204,65 @@
             /*text*/true
             ),
             Function: schemaElement(
-            /*attributes*/["Name", "ReturnType"],
-            /*elements*/["Parameter*", "DefiningExpression", "ReturnType", "TypeAnnotation*", "ValueAnnotation*"]
+            /*attributes*/["Name", "IsBound", "IsComposable", "EntitySetPath"],
+            /*elements*/["ReturnType", "Parameter*", "Annotation*"]
             ),
             FunctionImport: schemaElement(
-            /*attributes*/["Name", "ReturnType", "EntitySet", "IsSideEffecting", "IsComposable", "IsBindable", "EntitySetPath"],
-            /*elements*/["Parameter*", "ReturnType", "TypeAnnotation*", "ValueAnnotation*"]
+            /*attributes*/["Name", "Function", "EntitySet", "IncludeInServiceDocument", "Annotation*"]
             ),
             Guid: schemaElement(
             /*attributes*/null,
             /*elements*/null,
             /*text*/true
             ),
+            If: schemaElement(
+            /*attributes*/null,
+            /*elements*/["Path*", "String*", "Annotation*"]
+            ),
             Int: schemaElement(
             /*attributes*/null,
             /*elements*/null,
             /*text*/true
             ),
+            IsOf: schemaElement(
+            /*attributes*/["Type", "MaxLength", "Precision", "Scale", "Unicode", "SRID", "DefaultValue", "Annotation*"],
+            /*elements*/["Path*"]
+            ),
             Key: schemaElement(
             /*attributes*/null,
             /*elements*/["PropertyRef*"]
             ),
             LabeledElement: schemaElement(
             /*attributes*/["Name"],
-            /*elements*/["Path", "String", "Int", "Float", "Decimal", "Bool", "DateTime", "DateTimeOffset", "Guid", "Binary", "Time", "Collection", "Record", "LabeledElement", "Null"]
+            /*elements*/["Binary*", "Bool*", "Date*", "DateTimeOffset*", "Decimal*", "Duration*", "EnumMember*", "Float*", "Guid*", "Int*", "String*", "TimeOfDay*", "And*", "Or*", "Not*", "Eq*", "Ne*", "Gt*", "Ge*", "Lt*", "Le*", "AnnotationPath*", "Apply*", "Cast*", "Collection*", "If*", "IsOf*", "LabeledElement*", "LabeledElementReference*", "Null*", "NavigationPropertyPath*", "Path*", "PropertyPath*", "Record*", "UrlRef*", "Annotation*"]
+            ),
+            LabeledElementReference: schemaElement(
+            /*attributes*/["Term"],
+            /*elements*/["Binary*", "Bool*", "Date*", "DateTimeOffset*", "Decimal*", "Duration*", "EnumMember*", "Float*", "Guid*", "Int*", "String*", "TimeOfDay*", "And*", "Or*", "Not*", "Eq*", "Ne*", "Gt*", "Ge*", "Lt*", "Le*", "AnnotationPath*", "Apply*", "Cast*", "Collection*", "If*", "IsOf*", "LabeledElement*", "LabeledElementReference*", "Null*", "NavigationPropertyPath*", "Path*", "PropertyPath*", "Record*", "UrlRef*"]
             ),
             Member: schemaElement(
-            /*attributes*/["Name", "Value"]
+            /*attributes*/["Name", "Value"],
+            /*element*/["Annotation*"]
             ),
             NavigationProperty: schemaElement(
-            /*attributes*/["Name", "Relationship", "ToRole", "FromRole", "ContainsTarget"],
-            /*elements*/["TypeAnnotation*", "ValueAnnotation*"]
+            /*attributes*/["Name", "Type", "Nullable", "Partner", "ContainsTarget"],
+            /*elements*/["ReferentialConstraint*", "OnDelete*", "Annotation*"]
+            ),
+            NavigationPropertyBinding: schemaElement(
+            /*attributes*/["Path", "Target"]
+            ),
+            NavigationPropertyPath: schemaElement(
+            /*attributes*/null,
+            /*elements*/null,
+            /*text*/true
             ),
             Null: schemaElement(
             /*attributes*/null,
-            /*elements*/null
+            /*elements*/["Annotation*"]
             ),
             OnDelete: schemaElement(
-            /*attributes*/["Action"]
+            /*attributes*/["Action"],
+            /*elements*/["Annotation*"]
             ),
             Path: schemaElement(
             /*attributes*/null,
@@ -207,37 +270,34 @@
             /*text*/true
             ),
             Parameter: schemaElement(
-            /*attributes*/["Name", "Type", "Mode", "Nullable", "DefaultValue", "MaxLength", "FixedLength", "Precision", "Scale", "Unicode", "Collation", "ConcurrencyMode", "SRID"],
-            /*elements*/["CollectionType", "ReferenceType", "RowType", "TypeRef", "TypeAnnotation*", "ValueAnnotation*"]
-            ),
-            Principal: schemaElement(
-            /*attributes*/["Role"],
-            /*elements*/["PropertyRef*"]
+            /*attributes*/["Name", "Type", "Nullable", "MaxLength", "Precision", "Scale", "SRID"],
+            /*elements*/["Annotation*"]
             ),
             Property: schemaElement(
-            /*attributes*/["Name", "Type", "Nullable", "DefaultValue", "MaxLength", "FixedLength", "Precision", "Scale", "Unicode", "Collation", "ConcurrencyMode", "CollectionKind", "SRID"],
-            /*elements*/["CollectionType", "ReferenceType", "RowType", "TypeAnnotation*", "ValueAnnotation*"]
+            /*attributes*/["Name", "Type", "Nullable", "MaxLength", "Precision", "Scale", "Unicode", "SRID", "DefaultValue"],
+            /*elements*/["Annotation*"]
+            ),
+            PropertyPath: schemaElement(
+            /*attributes*/null,
+            /*elements*/null,
+            /*text*/true
             ),
             PropertyRef: schemaElement(
-            /*attributes*/["Name"]
+            /*attributes*/["Name", "Alias"]
             ),
             PropertyValue: schemaElement(
-            /*attributes*/["Property", "Path", "String", "Int", "Float", "Decimal", "Bool", "DateTime", "DateTimeOffset", "Guid", "Binary", "Time"],
-            /*Elements*/["Path", "String", "Int", "Float", "Decimal", "Bool", "DateTime", "DateTimeOffset", "Guid", "Binary", "Time", "Collection", "Record", "LabeledElement", "Null"]
+            /*attributes*/["Property", "Path"],
+            /*elements*/["Binary*", "Bool*", "Date*", "DateTimeOffset*", "Decimal*", "Duration*", "EnumMember*", "Float*", "Guid*", "Int*", "String*", "TimeOfDay*", "And*", "Or*", "Not*", "Eq*", "Ne*", "Gt*", "Ge*", "Lt*", "Le*", "AnnotationPath*", "Apply*", "Cast*", "Collection*", "If*", "IsOf*", "LabeledElement*", "LabeledElementReference*", "Null*", "NavigationPropertyPath*", "Path*", "PropertyPath*", "Record*", "UrlRef*", "Annotation*"]
             ),
-            ReferenceType: schemaElement(
-            /*attributes*/["Type"]
+            Record: schemaElement(
+            /*attributes*/null,
+            /*Elements*/["PropertyValue*", "Property*", "Annotation*"]
             ),
             ReferentialConstraint: schemaElement(
-            /*attributes*/null,
-            /*elements*/["Principal", "Dependent"]
+            /*attributes*/["Property", "ReferencedProperty", "Annotation*"]
             ),
             ReturnType: schemaElement(
-            /*attributes*/["ReturnType", "Type", "EntitySet"],
-            /*elements*/["CollectionType", "ReferenceType", "RowType"]
-            ),
-            RowType: schemaElement(
-            /*elements*/["Property*"]
+            /*attributes*/["Type", "Nullable", "MaxLength", "Precision", "Scale", "SRID"]
             ),
             String: schemaElement(
             /*attributes*/null,
@@ -246,65 +306,56 @@
             ),
             Schema: schemaElement(
             /*attributes*/["Namespace", "Alias"],
-            /*elements*/["Using*", "EntityContainer*", "EntityType*", "Association*", "ComplexType*", "Function*", "ValueTerm*", "Annotations*"]
+            /*elements*/["Action*", "Annotations*", "Annotation*", "ComplexType*", "EntityContainer", "EntityType*", "EnumType*", "Function*", "Term*", "TypeDefinition*", "Annotation*"]
+            ),
+            Singleton: schemaElement(
+            /*attributes*/["Name", "Type"],
+            /*elements*/["NavigationPropertyBinding*", "Annotation*"]
+            ),
+            Term: schemaElement(
+            /*attributes*/["Name", "Type", "BaseTerm", "DefaultValue ", "AppliesTo", "Nullable", "MaxLength", "Precision", "Scale", "SRID"],
+            /*elements*/["Annotation*"]
             ),
-            Time: schemaElement(
+            TimeOfDay: schemaElement(
             /*attributes*/null,
             /*elements*/null,
             /*text*/true
             ),
-            TypeAnnotation: schemaElement(
-            /*attributes*/["Term", "Qualifier"],
-            /*elements*/["PropertyValue*"]
+            TypeDefinition: schemaElement(
+            /*attributes*/["Name", "UnderlyingType", "MaxLength", "Unicode", "Precision", "Scale", "SRID"],
+            /*elements*/["Annotation*"]
             ),
-            TypeRef: schemaElement(
-            /*attributes*/["Type", "Nullable", "DefaultValue", "MaxLength", "FixedLength", "Precision", "Scale", "Unicode", "Collation", "SRID"]
-            ),
-            Using: schemaElement(
-            /*attributes*/["Namespace", "Alias"]
-            ),
-            ValueAnnotation: schemaElement(
-            /*attributes*/["Term", "Qualifier", "Path", "String", "Int", "Float", "Decimal", "Bool", "DateTime", "DateTimeOffset", "Guid", "Binary", "Time"],
-            /*Elements*/["Path", "String", "Int", "Float", "Decimal", "Bool", "DateTime", "DateTimeOffset", "Guid", "Binary", "Time", "Collection", "Record", "LabeledElement", "Null"]
-            ),
-            ValueTerm: schemaElement(
-            /*attributes*/["Name", "Type"],
-            /*elements*/["TypeAnnotation*", "ValueAnnotation*"]
+            UrlRef: schemaElement(
+            /*attributes*/null,
+            /*elements*/["Binary*", "Bool*", "Date*", "DateTimeOffset*", "Decimal*", "Duration*", "EnumMember*", "Float*", "Guid*", "Int*", "String*", "TimeOfDay*", "And*", "Or*", "Not*", "Eq*", "Ne*", "Gt*", "Ge*", "Lt*", "Le*", "AnnotationPath*", "Apply*", "Cast*", "Collection*", "If*", "IsOf*", "LabeledElement*", "LabeledElementReference*", "Null*", "NavigationPropertyPath*", "Path*", "PropertyPath*", "Record*", "UrlRef*", "Annotation*"]
             ),
 
             // See http://msdn.microsoft.com/en-us/library/dd541238(v=prot.10) for an EDMX reference.
             Edmx: schemaElement(
             /*attributes*/["Version"],
-            /*elements*/["DataServices", "Reference*", "AnnotationsReference*"],
+            /*elements*/["DataServices", "Reference*"],
             /*text*/false,
             /*ns*/edmxNs
             ),
             DataServices: schemaElement(
-            /*attributes*/null,
+            /*attributes*/["m:MaxDataServiceVersion", "m:DataServiceVersion"],
             /*elements*/["Schema*"],
             /*text*/false,
             /*ns*/edmxNs
+            ),
+            Reference: schemaElement(
+            /*attributes*/["Uri"],
+            /*elements*/["Include*", "IncludeAnnotations*", "Annotation*"]
+            ),
+            Include: schemaElement(
+            /*attributes*/["Namespace", "Alias"]
+            ),
+            IncludeAnnotations: schemaElement(
+            /*attributes*/["TermNamespace", "Qualifier", "TargetNamespace"]
             )
         }
     };
 
-    // See http://msdn.microsoft.com/en-us/library/ee373839.aspx for a feed customization reference.
-    var customizationAttributes = ["m:FC_ContentKind", "m:FC_KeepInContent", "m:FC_NsPrefix", "m:FC_NsUri", "m:FC_SourcePath", "m:FC_TargetPath"];
-    schema.elements.Property.attributes = schema.elements.Property.attributes.concat(customizationAttributes);
-    schema.elements.EntityType.attributes = schema.elements.EntityType.attributes.concat(customizationAttributes);
-
-    // See http://msdn.microsoft.com/en-us/library/dd541284(PROT.10).aspx for an EDMX reference.
-    schema.elements.Edmx = { attributes: ["Version"], elements: ["DataServices"], ns: edmxNs };
-    schema.elements.DataServices = { elements: ["Schema*"], ns: edmxNs };
-
-    // See http://msdn.microsoft.com/en-us/library/dd541233(v=PROT.10) for Conceptual Schema Definition Language Document for Data Services.
-    schema.elements.EntityContainer.attributes.push("m:IsDefaultEntityContainer");
-    schema.elements.Property.attributes.push("m:MimeType");
-    schema.elements.FunctionImport.attributes.push("m:HttpMethod");
-    schema.elements.FunctionImport.attributes.push("m:IsAlwaysBindable");
-    schema.elements.EntityType.attributes.push("m:HasStream");
-    schema.elements.DataServices.attributes = ["m:DataServiceVersion", "m:MaxDataServiceVersion"];
-
     var scriptCase = function (text) {
         /// <summary>Converts a Pascal-case identifier into a camel-case identifier.</summary>
         /// <param name="text" type="String">Text to convert.</param>
@@ -333,10 +384,6 @@
         /// <param name="candidateName">XML element name to consider.</param>
         /// <returns type="Object">The schema that describes the specified element; null if not found.</returns>
 
-        if (candidateName === "Documentation") {
-            return { isArray: true, propertyName: "documentation" };
-        }
-
         var elements = parentSchema.elements;
         if (!elements) {
             return null;
@@ -360,23 +407,12 @@
         return null;
     };
 
-    // This regular expression is used to detect a feed customization element
-    // after we've normalized it into the 'm' prefix. It starts with m:FC_,
-    // followed by other characters, and ends with _ and a number.
-    // The captures are 0 - whole string, 1 - name as it appears in internal table.
-    var isFeedCustomizationNameRE = /^(m:FC_.*)_[0-9]+$/;
-
-    var isEdmNamespace = function (nsURI) {
+    var isEdmNamespace = function (nsUri) {
         /// <summary>Checks whether the specifies namespace URI is one of the known CSDL namespace URIs.</summary>
-        /// <param name="nsURI" type="String">Namespace URI to check.</param>
+        /// <param name="nsUri" type="String">Namespace URI to check.</param>
         /// <returns type="Boolean">true if nsURI is a known CSDL namespace; false otherwise.</returns>
 
-        return nsURI === edmNs1 ||
-               nsURI === edmNs1_1 ||
-               nsURI === edmNs1_2 ||
-               nsURI === edmNs2a ||
-               nsURI === edmNs2b ||
-               nsURI === edmNs3;
+        return nsUri === edmNs1;
     };
 
     var parseConceptualModelElement = function (element) {
@@ -400,7 +436,6 @@
         }
 
         var item = {};
-        var extensions = [];
         var attributes = elementSchema.attributes || [];
         xmlAttributes(element, function (attribute) {
 
@@ -426,23 +461,10 @@
             if (schemaName !== null) {
                 schemaName += localName;
 
-                // Feed customizations for complex types have additional
-                // attributes with a suffixed counter starting at '1', so
-                // take that into account when doing the lookup.
-                var match = isFeedCustomizationNameRE.exec(schemaName);
-                if (match) {
-                    schemaName = match[1];
-                }
-
                 if (contains(attributes, schemaName)) {
-                    handled = true;
                     item[scriptCase(localName)] = value;
                 }
             }
-
-            if (!handled) {
-                extensions.push(createAttributeExtension(attribute));
-            }
         });
 
         xmlChildElements(element, function (child) {
@@ -459,8 +481,6 @@
                 } else {
                     item[childSchema.propertyName] = parseConceptualModelElement(child);
                 }
-            } else {
-                extensions.push(createElementExtension(child));
             }
         });
 
@@ -468,10 +488,6 @@
             item.text = xmlInnerText(element);
         }
 
-        if (extensions.length) {
-            item.extensions = extensions;
-        }
-
         return item;
     };
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/odata-net.js
----------------------------------------------------------------------
diff --git a/JSLib/src/odata-net.js b/JSLib/src/odata-net.js
index ad9b8dd..35e3d33 100644
--- a/JSLib/src/odata-net.js
+++ b/JSLib/src/odata-net.js
@@ -279,14 +279,15 @@
                             data = window.JSON.parse(window.JSON.stringify(data));
                         }
 
-
                         var headers;
-                        // Adding dataServiceVersion in case of json light ( data.d doesn't exist )
-                        if (data.d === undefined) {
-                            headers = { "Content-Type": "application/json;odata=minimalmetadata", dataServiceVersion: "3.0" };
+                        if (!formatQueryString || formatQueryString == "$format=json") {
+                            headers = { "Content-Type": "application/json;odata.metadata=minimal", "OData-Version": "4.0" };
                         } else {
-                            headers = { "Content-Type": "application/json" };
+                            // the formatQueryString should be in the format of "$format=xxx", xxx should be one of the application/json;odata.metadata=minimal(none or full)
+                            // set the content-type with the string xxx which stars from index 8.
+                            headers = { "Content-Type": formatQueryString.substring(8), "OData-Version": "4.0" };
                         }
+
                         // Call the success callback in the context of the parent window, instead of the IFRAME
                         delay(function () {
                             removeIFrame(iframe);
@@ -300,7 +301,7 @@
                 timeoutId = window.setTimeout(handleTimeout, timeoutMS);
 
                 var queryStringParams = callbackParameterName + "=parent." + name;
-                if (this.formatQueryString) {
+                if (formatQueryString) {
                     queryStringParams += "&" + formatQueryString;
                 }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/odata-utils.js
----------------------------------------------------------------------
diff --git a/JSLib/src/odata-utils.js b/JSLib/src/odata-utils.js
index ad2cf00..066bc50 100644
--- a/JSLib/src/odata-utils.js
+++ b/JSLib/src/odata-utils.js
@@ -726,10 +726,27 @@
     };
 
     var normalHeaders = {
-        "accept": "Accept",
+        // Headers shared by request and response
         "content-type": "Content-Type",
-        "dataserviceversion": "DataServiceVersion",
-        "maxdataserviceversion": "MaxDataServiceVersion"
+        "content-encoding": "Content-Encoding",
+        "content-length": "Content-Length",
+        "odata-version": "OData-Version",
+        
+        // Headers used by request
+        "accept": "Accept",
+        "accept-charset": "Accept-Charset",
+        "if-match": "If-Match",
+        "if-none-match": "If-None-Match",
+        "odata-isolation": "OData-Isolation",
+        "odata-maxversion": "OData-MaxVersion",
+        "prefer": "Prefer",
+        
+        // Headers used by response
+        "etag": "ETag",
+        "location": "Location",
+        "odata-entityid": "OData-EntityId",
+        "preference-applied": "Preference-Applied",
+        "retry-after": "Retry-After"
     };
 
     var normalizeHeaders = function (headers) {
@@ -982,8 +999,8 @@
             handler.write(request, context);
         }
 
-        if (!assigned(request.headers.MaxDataServiceVersion)) {
-            request.headers.MaxDataServiceVersion = handler.maxDataServiceVersion || "1.0";
+        if (!assigned(request.headers["OData-MaxVersion"])) {
+            request.headers["OData-MaxVersion"] = handler.maxDataServiceVersion || "4.0";
         }
     };
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/odata-xml.js
----------------------------------------------------------------------
diff --git a/JSLib/src/odata-xml.js b/JSLib/src/odata-xml.js
index b2d00f6..ef974af 100644
--- a/JSLib/src/odata-xml.js
+++ b/JSLib/src/odata-xml.js
@@ -117,24 +117,16 @@
 
     var xmlMediaType = "application/xml";
 
-    var ado = http + "schemas.microsoft.com/ado/";      // http://schemas.microsoft.com/ado/
-    var adoDs = ado + "2007/08/dataservices";           // http://schemas.microsoft.com/ado/2007/08/dataservices
+    var ado = http + "docs.oasis-open.org/odata/";      // http://docs.oasis-open.org/odata/
+    var adoDs = ado + "ns";                             // http://docs.oasis-open.org/odata/ns
 
-    var edmxNs = ado + "2007/06/edmx";                  // http://schemas.microsoft.com/ado/2007/06/edmx
-    var edmNs1 = ado + "2006/04/edm";                   // http://schemas.microsoft.com/ado/2006/04/edm
-    var edmNs1_1 = ado + "2007/05/edm";                 // http://schemas.microsoft.com/ado/2007/05/edm
-    var edmNs1_2 = ado + "2008/01/edm";                 // http://schemas.microsoft.com/ado/2008/01/edm
+    var edmxNs = adoDs + "/edmx";                       // http://docs.oasis-open.org/odata/ns/edmx
+    var edmNs1 = adoDs + "/edm";                        // http://docs.oasis-open.org/odata/ns/edm
 
-    // There are two valid namespaces for Edm 2.0
-    var edmNs2a = ado + "2008/09/edm";                  // http://schemas.microsoft.com/ado/2008/09/edm
-    var edmNs2b = ado + "2009/08/edm";                  // http://schemas.microsoft.com/ado/2009/08/edm
-
-    var edmNs3 = ado + "2009/11/edm";                   // http://schemas.microsoft.com/ado/2009/11/edm
-
-    var odataXmlNs = adoDs;                             // http://schemas.microsoft.com/ado/2007/08/dataservices
-    var odataMetaXmlNs = adoDs + "/metadata";           // http://schemas.microsoft.com/ado/2007/08/dataservices/metadata
-    var odataRelatedPrefix = adoDs + "/related/";       // http://schemas.microsoft.com/ado/2007/08/dataservices/related
-    var odataScheme = adoDs + "/scheme";                // http://schemas.microsoft.com/ado/2007/08/dataservices/scheme
+    var odataXmlNs = adoDs;                             // http://docs.oasis-open.org/odata/ns
+    var odataMetaXmlNs = adoDs + "/metadata";           // http://docs.oasis-open.org/odata/ns/metadata
+    var odataRelatedPrefix = adoDs + "/related/";       // http://docs.oasis-open.org/odata/ns/related
+    var odataScheme = adoDs + "/scheme";                // http://docs.oasis-open.org/odata/ns/scheme
 
     var odataPrefix = "d";
     var odataMetaPrefix = "m";
@@ -621,7 +613,7 @@
 
         var propertyValue = xmlNewODataPrimitiveValue(value, typeName);
         var property = xmlNewODataProperty(dom, name, typeName, propertyValue);
-        return xmlNewODataElementInfo(property, /*dataServiceVersion*/"1.0");
+        return xmlNewODataElementInfo(property, /*dataServiceVersion*/"4.0");
     };
 
     var xmlNewODataNullProperty = function (dom, name, typeName, model) {
@@ -673,7 +665,7 @@
 
             xmlAppendChild(xmlProperty, item.element);
         }
-        return xmlNewODataElementInfo(xmlProperty, /*dataServiceVersion*/"3.0");
+        return xmlNewODataElementInfo(xmlProperty, /*dataServiceVersion*/"4.0");
     };
 
     var xmlNewODataComplexProperty = function (dom, name, value, typeName, propertyMetadata, propertyModel, model) {
@@ -694,7 +686,7 @@
         var complexTypePropertiesMetadata = propertyMetadata.properties || {};
         var complexTypeModel = lookupComplexType(typeName, model) || {};
 
-        var dataServiceVersion = "1.0";
+        var dataServiceVersion = "4.0";
 
         for (var key in value) {
             if (key !== "__metadata") {
@@ -726,7 +718,7 @@
         var gmlRoot = gmlNewODataSpatialValue(dom, value, geoJsonType, isGeography);
         var xmlProperty = xmlNewODataProperty(dom, name, typeName, gmlRoot);
 
-        return xmlNewODataElementInfo(xmlProperty, "3.0");
+        return xmlNewODataElementInfo(xmlProperty, "4.0");
     };
 
     var xmlNewODataDataElement = function (dom, name, value, dataItemMetadata, dataItemModel, model) {
@@ -825,11 +817,6 @@
     odata.createElementExtension = createElementExtension;
     odata.edmxNs = edmxNs;
     odata.edmNs1 = edmNs1;
-    odata.edmNs1_1 = edmNs1_1;
-    odata.edmNs1_2 = edmNs1_2
-    odata.edmNs2a = edmNs2a;
-    odata.edmNs2b = edmNs2b;
-    odata.edmNs3 = edmNs3;
     odata.odataMetaXmlNs = odataMetaXmlNs;
     odata.odataMetaPrefix = odataMetaPrefix;
     odata.odataXmlNs = odataXmlNs;

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/odata.js
----------------------------------------------------------------------
diff --git a/JSLib/src/odata.js b/JSLib/src/odata.js
index 98b80e2..29f3955 100644
--- a/JSLib/src/odata.js
+++ b/JSLib/src/odata.js
@@ -30,8 +30,9 @@
     var metadataParser = odata.metadataParser;
 
     // CONTENT START
-
-    var handlers = [odata.jsonHandler, odata.atomHandler, odata.xmlHandler, odata.textHandler];
+    
+    // to do: disable atom scenario
+    var handlers = [odata.jsonHandler/*, odata.atomHandler*/, odata.xmlHandler, odata.textHandler];
 
     var dispatchHandler = function (handlerMethod, requestOrResponse, context) {
         /// <summary>Dispatches an operation to handlers.</summary>
@@ -77,7 +78,7 @@
         },
 
         maxDataServiceVersion: MAX_DATA_SERVICE_VERSION,
-        accept: "application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7, application/json;q=0.5, */*;q=0.1"
+        accept: "application/json;q=0.9, application/atomsvc+xml;q=0.8, */*;q=0.1"
     };
 
     odata.defaultMetadata = [];
@@ -121,8 +122,6 @@
         request.callbackParameterName = defined(request.callbackParameterName, odata.defaultHttpClient.callbackParameterName);
         request.formatQueryString = defined(request.formatQueryString, odata.defaultHttpClient.formatQueryString);
         request.enableJsonpCallback = defined(request.enableJsonpCallback, odata.defaultHttpClient.enableJsonpCallback);
-        request.useJsonLight = defined(request.useJsonLight, odata.jsonHandler.enableJsonpCallback);
-        request.inferJsonLightFeedAsObject = defined(request.inferJsonLightFeedAsObject, odata.jsonHandler.inferJsonLightFeedAsObject);
 
         // Create the base context for read/write operations, also specifying complete settings.
         var context = {
@@ -130,9 +129,7 @@
             recognizeDates: request.recognizeDates,
             callbackParameterName: request.callbackParameterName,
             formatQueryString: request.formatQueryString,
-            enableJsonpCallback: request.enableJsonpCallback,
-            useJsonLight: request.useJsonLight,
-            inferJsonLightFeedAsObject: request.inferJsonLightFeedAsObject
+            enableJsonpCallback: request.enableJsonpCallback
         };
 
         try {

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/src/utils.js
----------------------------------------------------------------------
diff --git a/JSLib/src/utils.js b/JSLib/src/utils.js
index 3dd3a49..3a6da46 100644
--- a/JSLib/src/utils.js
+++ b/JSLib/src/utils.js
@@ -461,6 +461,60 @@
         }
         return binaryString;
     };
+
+    var getJsonValueArraryLength = function (data) {
+        if (data && data.value) {
+            return data.value.length;
+        }
+
+        return 0;
+    };
+
+    var sliceJsonValueArray = function (data, start, end) {
+        if (data == undefined || data.value == undefined) {
+            return data;
+        }
+
+        if (start < 0) {
+            start = 0;
+        }
+
+        var length = getJsonValueArraryLength(data);
+        if (length < end) {
+            end = length;
+        }
+
+        var newdata = {};
+        for (var property in data) {
+            if (property == "value") {
+                newdata[property] = data[property].slice(start, end);
+            } else {
+                newdata[property] = data[property];
+            }
+        }
+
+        return newdata;
+    };
+
+    var concatJsonValueArray = function (data, concatData) {
+        if (concatData == undefined || concatData.value == undefined) {
+            return data;
+        }
+
+        if (data == undefined || Object.keys(data).length == 0) {
+            return concatData;
+        }
+
+        if (data.value == undefined) {
+            data.value = concatData.value;
+            return data;
+        }
+
+        data.value = data.value.concat(concatData.value);
+
+        return data;
+    };
+
     // DATAJS INTERNAL START
 
     datajs.activeXObject = activeXObject;
@@ -484,6 +538,9 @@
     datajs.undefinedDefault = undefinedDefault;
     datajs.decodeBase64 = decodeBase64;
     datajs.convertByteArrayToHexString = convertByteArrayToHexString;
+    datajs.getJsonValueArraryLength = getJsonValueArraryLength;
+    datajs.sliceJsonValueArray = sliceJsonValueArray;
+    datajs.concatJsonValueArray = concatJsonValueArray;
     // DATAJS INTERNAL END
 
     // CONTENT END

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/tests/code/ReflectionDataContext.cs
----------------------------------------------------------------------
diff --git a/JSLib/tests/code/ReflectionDataContext.cs b/JSLib/tests/code/ReflectionDataContext.cs
index 762b56f..eb70949 100644
--- a/JSLib/tests/code/ReflectionDataContext.cs
+++ b/JSLib/tests/code/ReflectionDataContext.cs
@@ -17,8 +17,8 @@ namespace DataJS.Tests
     using System.Collections;
     using System.Collections.Generic;
     using System.Collections.ObjectModel;
-    using System.Data.Services;
-    using System.Data.Services.Common;
+    using Microsoft.OData.Service;
+    using Microsoft.OData.Service.Common;
     using System.Globalization;
     using System.Linq;
     using System.Reflection;

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/80db48ba/JSLib/tests/code/atomreader.cs
----------------------------------------------------------------------
diff --git a/JSLib/tests/code/atomreader.cs b/JSLib/tests/code/atomreader.cs
index 6391d87..1b4e762 100644
--- a/JSLib/tests/code/atomreader.cs
+++ b/JSLib/tests/code/atomreader.cs
@@ -9,7 +9,7 @@ namespace DataJS.Tests
     using System.IO;
     using System.Linq;
     using System.ServiceModel.Syndication;
-    using System.Spatial;
+    using Microsoft.Spatial;
     using System.Xml;
     using System.Xml.Linq;
 


Mime
View raw message