From b952d9b4e4e927c2be360f231c44271d96752689 Mon Sep 17 00:00:00 2001
From: DinakarSF4212 <147583019+DinakarSF4212@users.noreply.github.com>
Date: Thu, 12 Mar 2026 20:27:05 +0530
Subject: [PATCH 1/6] 1015405: Add "Web Services" Section for Spreadsheet
Open/Save in ASP.NET Core & MVC
---
Document-Processing-toc.html | 7 +
.../webservice-using-aspnetcore.md | 120 +++++++++++++
.../webservice-using-aspnetmvc.md | 125 +++++++++++++
.../web-services/webservice-using-wcf.md | 168 ++++++++++++++++++
4 files changed, 420 insertions(+)
create mode 100644 Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
create mode 100644 Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
create mode 100644 Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html
index fcb4c4de4..6329ef0dc 100644
--- a/Document-Processing-toc.html
+++ b/Document-Processing-toc.html
@@ -5394,6 +5394,13 @@
Using with SharePoint Framework (SPFx)
+ Web Services
+
+
Open Excel Files
- From AWS S3
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
new file mode 100644
index 000000000..ca01724c0
--- /dev/null
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
@@ -0,0 +1,120 @@
+# Connecting Local Web Services for Spreadsheet Open and Save in ASP.NET Core
+
+This guide demonstrates how to prepare and connect local web services for spreadsheet open and save operations using ASP.NET Core.
+
+By default, the Syncfusion Spreadsheet component uses Syncfusion®-hosted endpoints for file operations:
+
+```ts
+openUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/open',
+saveUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/save'
+```
+
+However, these demo services are intended only for **demonstration purposes** and are not recommended for **production or development environments**.
+
+**Benefits of hosting your own service:**
+- **Full Control** – Manage your data and processes locally.
+- **Better Performance** – Reduce latency with local or private hosting.
+- **Security** – Keep sensitive files within your infrastructure.
+- **Reliability** – Remain independent of Syncfusion's service availability.
+- **Customization** – Add custom business logic and workflows.
+- **Compliance** – Meet regulatory and data residency requirements.
+
+## Create a New ASP.NET Core Web API Project
+
+To create a new ASP.NET Core Web API project, follow the steps in the link below:
+
+[Tutorial: Create a controller-based web API with ASP.NET Core | Microsoft Learn](https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-10.0&source=recommendations&tabs=visual-studio#create-a-web-api-project)
+
+## Dependencies
+
+Open and save helper functions are provided in the
+[`Syncfusion.EJ2.Spreadsheet.AspNet.Core`](https://www.nuget.org/packages/Syncfusion.EJ2.Spreadsheet.AspNet.Core#dependencies-body-tab) package, which is available in Essential Studio and on [nuget.org](https://www.nuget.org/packages/Syncfusion.EJ2.Spreadsheet.AspNet.Core#readme-body-tab).
+
+## Add Open and Save Controllers
+
+Once the Web API is created, add the following Open and Save controller code to your controller file to enable open and save actions:
+
+```csharp
+// Open action
+[HttpPost]
+[Route("Open")]
+public IActionResult Open([FromForm] IFormCollection openRequest)
+{
+ OpenRequest open = new OpenRequest();
+ open.File = openRequest.Files[0];
+ return Content(Workbook.Open(open));
+}
+
+// Save action
+[HttpPost]
+[Route("Save")]
+public IActionResult Save([FromForm] SaveSettings saveSettings)
+{
+ return Workbook.Save(saveSettings);
+}
+```
+
+## Run the Web API Project
+
+After adding the controller code, build and run the Web API project by following the instructions in the link below:
+
+[Run the ASP.NET Core Web API project](https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-10.0&source=recommendations&tabs=visual-studio#run-the-project)
+
+## Configuring the Client-Side URLs
+
+Once your local service is running, configure your client app to use the local endpoints:
+
+```jsx
+
+```
+
+## Configuring File Size Limits
+
+When working with large Excel files, it is important to configure file size limits to prevent server-side exceptions.
+
+**web.config**
+```xml
+
+
+
+
+
+
+
+
+
+
+
+```
+
+**Program.cs:**
+```csharp
+builder.Services.Configure(options =>
+{
+ options.MultipartBodyLengthLimit = int.MaxValue;
+ options.ValueLengthLimit = int.MaxValue;
+});
+```
+
+## Configure CORS (Cross-Origin Resource Sharing)
+
+Edit `Program.cs` to enable CORS for your application:
+
+```csharp
+var MyAllowSpecificOrigins = "AllowAllOrigins";
+builder.Services.AddCors(options =>
+{
+ options.AddPolicy(MyAllowSpecificOrigins, builder =>
+ {
+ builder.AllowAnyOrigin()
+ .AllowAnyMethod()
+ .AllowAnyHeader();
+ });
+});
+
+var app = builder.Build();
+app.UseCors(MyAllowSpecificOrigins);
+```
\ No newline at end of file
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
new file mode 100644
index 000000000..3145cfd49
--- /dev/null
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
@@ -0,0 +1,125 @@
+# Connecting Local Web Services for Spreadsheet Open and Save in ASP.NET MVC
+
+This guide demonstrates how to prepare and connect local web services for spreadsheet open and save operations using **ASP.NET MVC**.
+
+By default, the Syncfusion Spreadsheet component uses Syncfusion hosted endpoints for file operations:
+
+```ts
+openUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/open',
+saveUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/save'
+```
+
+However, these demo services are intended only for **demonstration purposes** and are not recommended for **production or development environments**.
+
+**Benefits of hosting your own service:**
+- **Full Control** – Manage your data and processes locally.
+- **Better Performance** – Reduce latency with local or private hosting.
+- **Security** – Keep sensitive files within your infrastructure.
+- **Reliability** – Remain independent of Syncfusion's service availability.
+- **Customization** – Add custom business logic and workflows.
+- **Compliance** – Meet regulatory and data residency requirements.
+
+## Create a New ASP.NET MVC Project
+
+To create a new ASP.NET MVC project follow the steps mentioned in the link below.
+
+[Getting Started with ASP.NET MVC 5 | Microsoft Learn](https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/introduction/getting-started)
+
+## Dependencies
+
+Following list of dependencies required for Spreadsheet open and save operations.
+
+| **Platforms** | **Assembly** | **Nuget Package** |
+| ----- | ----- | ----- |
+| ASP.NET MVC5 | Syncfusion.EJ2.MVC5
Syncfusion.EJ2.Spreadsheet.AspNet.MVC5
Syncfusion.Compression.Base
Syncfusion.XlsIO.AspNet.Mvc5
Syncfusion.ExcelToPdfConverter.AspNet.Mvc5
| [Syncfusion.EJ2.Spreadsheet.AspNet.MVC5](https://www.nuget.org/packages/Syncfusion.EJ2.Spreadsheet.AspNet.MVC5)
[Syncfusion.ExcelToPdfConverter.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.ExcelToPdfConverter.AspNet.Mvc5) |
+
+## Add Open and Save Actions in Controller
+
+Once the MVC project is created, add the following Open and Save action methods to your controller (e.g., `SpreadsheetController`) to enable open and save actions:
+
+```csharp
+using System.Web;
+using System.Web.Mvc;
+using Syncfusion.EJ2.Spreadsheet;
+
+public class SpreadsheetController : Controller
+{
+ // Open action
+ [HttpPost]
+ public ActionResult Open()
+ {
+ OpenRequest open = new OpenRequest();
+ open.File = Request.Files[0];
+ return Content(Workbook.Open(open));
+ }
+
+ // Save action
+ [HttpPost]
+ public ActionResult Save(SaveSettings saveSettings)
+ {
+ return Workbook.Save(saveSettings);
+ }
+}
+```
+
+## Run the MVC Project
+
+After adding the controller code, build and run the MVC project (F5 or Ctrl+F5 in Visual Studio).
+
+## Configuring the Client-Side URLs
+
+Once your local service is running, configure your client app to use the local endpoints:
+
+```jsx
+
+```
+
+## Configuring File Size Limits
+
+When working with large Excel files, it is important to configure file size limits to prevent server-side exceptions.
+
+**web.config**
+```xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+## Configure CORS (Cross-Origin Resource Sharing)
+
+Cross-Origin Resource Sharing (CORS) allows your ASP.NET MVC application to accept requests from other domains (such as when your client app and server are running on different ports or hosts).
+
+**How to Enable CORS in ASP.NET MVC**
+
+1. Open `Global.asax.cs` in your project.
+2. Add the following code to the `Application_BeginRequest` method.
+
+```csharp
+protected void Application_BeginRequest()
+{
+ // Allow all origins. For production, specify allowed origins instead of '*'.
+ HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*");
+ HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
+ HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept");
+
+ // Handle preflight requests
+ if (HttpContext.Current.Request.HttpMethod == "OPTIONS")
+ {
+ HttpContext.Current.Response.End();
+ }
+}
+```
\ No newline at end of file
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
new file mode 100644
index 000000000..e1c2d937b
--- /dev/null
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
@@ -0,0 +1,168 @@
+# Connecting Local Web Services for Spreadsheet Open and Save in WCF
+
+This guide demonstrates how to prepare and connect local web services for spreadsheet open and save operations using **WCF (Windows Communication Foundation)**.
+
+By default, the Syncfusion Spreadsheet component uses Syncfusion®-hosted endpoints for file operations:
+
+```ts
+openUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/open',
+saveUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/save'
+```
+
+However, these demo services are intended only for **demonstration purposes** and are not recommended for **production or development environments**.
+
+**Benefits of hosting your own service:**
+- **Full Control** – Manage your data and processes locally.
+- **Better Performance** – Reduce latency with local or private hosting.
+- **Security** – Keep sensitive files within your infrastructure.
+- **Reliability** – Remain independent of Syncfusion's service availability.
+- **Customization** – Add custom business logic and workflows.
+- **Compliance** – Meet regulatory and data residency requirements.
+
+## Create a New WCF Service Library Project
+
+To create a new WCF Service Library project, follow the steps in the link below:
+
+[Tutorial: Get started with WCF application | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/framework/wcf/how-to-create-a-wcf-service)
+
+## Dependencies
+
+To process Excel files, you can use libraries such as [Syncfusion XlsIO](https://www.syncfusion.com/products/file-formats/xlsio) or [EPPlus](https://www.epplussoftware.com/). Add the required NuGet package to your project for spreadsheet file handling.
+
+## Add Open and Save Service Methods
+
+Once the WCF service is created, define the service contract and implement the Open and Save methods as shown below:
+
+**Service Contract (Interface):**
+```csharp
+using System.ServiceModel;
+using System.ServiceModel.Web;
+using System.IO;
+
+[ServiceContract]
+public interface ISpreadsheetService
+{
+ // Open action (accepts file upload as stream)
+ [OperationContract]
+ [WebInvoke(Method = "POST", UriTemplate = "/Open", BodyStyle = WebMessageBodyStyle.Bare)]
+ Stream Open(Stream fileStream);
+
+ // Save action (accepts file upload as stream)
+ [OperationContract]
+ [WebInvoke(Method = "POST", UriTemplate = "/Save", BodyStyle = WebMessageBodyStyle.Bare)]
+ Stream Save(Stream fileStream);
+}
+```
+
+**Service Implementation:**
+```csharp
+public class SpreadsheetService : ISpreadsheetService
+{
+ public Stream Open(Stream fileStream)
+ {
+ // Here, you would process the uploaded file stream (e.g., using Syncfusion XlsIO)
+ // For demonstration, just return the same stream or a processed file stream
+ // Example: Save the uploaded file to disk, then return a processed file as stream
+
+ string tempPath = Path.GetTempFileName();
+ using (var file = File.Create(tempPath))
+ {
+ fileStream.CopyTo(file);
+ }
+
+ // Process the file as needed, then return the result as a stream
+ // For now, just return the uploaded file
+ return new FileStream(tempPath, FileMode.Open, FileAccess.Read);
+ }
+
+ public Stream Save(Stream fileStream)
+ {
+ // Save the uploaded file to disk (or process as needed)
+ string savePath = Path.Combine("C:\\SpreadsheetUploads", $"Saved_{Guid.NewGuid()}.xlsx");
+ Directory.CreateDirectory(Path.GetDirectoryName(savePath));
+ using (var file = File.Create(savePath))
+ {
+ fileStream.CopyTo(file);
+ }
+
+ // Return a simple confirmation message as a stream
+ var result = System.Text.Encoding.UTF8.GetBytes("File saved successfully.");
+ return new MemoryStream(result);
+ }
+}
+```
+
+## Configure the WCF Service
+
+Edit `App.config` to expose the service over HTTP:
+
+```xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+## Run the WCF Service
+
+After adding the service code, build and run the WCF Service Library project. You can use the WCF Test Client to test the Open and Save methods.
+
+For more details, see:
+[Run a WCF service in Visual Studio](https://learn.microsoft.com/en-us/dotnet/framework/wcf/how-to-host-and-run-a-basic-wcf-service)
+
+## Configuring the Client-Side URLs
+
+Once your local service is running, configure your client app to use the local endpoints. For example:
+
+```jsx
+
+```
+
+## Configuring File Size Limits
+
+When working with large Excel files, configure file size limits to prevent server-side exceptions.
+
+**web.config** (if hosting in IIS):
+```xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+## Configure CORS (Cross-Origin Resource Sharing)
+
+If your client and WCF service are hosted on different domains or ports, enable CORS. For WCF, you may need to add custom headers in the response or use a message inspector. See:
+
+[Enable CORS in WCF](https://learn.microsoft.com/en-us/answers/questions/116964/how-to-enable-cors-in-wcf-service)
+
+This guide helps you set up a WCF web service for spreadsheet open and save operations, similar to the ASP.NET Core approach, but using WCF for legacy or enterprise scenarios.
From c2ea9bcdcd0e43a1c4c6449ed681adf77a02ad9f Mon Sep 17 00:00:00 2001
From: DinakarSF4212 <147583019+DinakarSF4212@users.noreply.github.com>
Date: Fri, 13 Mar 2026 13:04:12 +0530
Subject: [PATCH 2/6] 1015405: Resolved CI errors.
---
.../web-services/webservice-using-aspnetcore.md | 11 ++++++++++-
.../web-services/webservice-using-aspnetmvc.md | 11 ++++++++++-
.../React/web-services/webservice-using-wcf.md | 13 +++++++++++--
3 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
index ca01724c0..2c8a3149e 100644
--- a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
@@ -1,4 +1,13 @@
-# Connecting Local Web Services for Spreadsheet Open and Save in ASP.NET Core
+---
+layout: post
+title: Web Services using ASP.NET Core in React Spreadsheet | Syncfusion
+description: Learn here all about web services using ASP.NET Core in React Spreadsheet component of Syncfusion Essential JS 2 and more.
+control: Web Services
+platform: document-processing
+documentation: ug
+---
+
+# Connecting Web Services for Spreadsheet Open and Save in ASP.NET Core
This guide demonstrates how to prepare and connect local web services for spreadsheet open and save operations using ASP.NET Core.
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
index 3145cfd49..f40ac1574 100644
--- a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
@@ -1,4 +1,13 @@
-# Connecting Local Web Services for Spreadsheet Open and Save in ASP.NET MVC
+---
+layout: post
+title: Web Services using ASP.NET MVC in React Spreadsheet | Syncfusion
+description: Learn here all about web services using ASP.NET MVC in React Spreadsheet component of Syncfusion Essential JS 2 and more.
+control: Web Services
+platform: document-processing
+documentation: ug
+---
+
+# Connecting Web Services for Spreadsheet Open and Save in ASP.NET MVC
This guide demonstrates how to prepare and connect local web services for spreadsheet open and save operations using **ASP.NET MVC**.
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
index e1c2d937b..4fe2c1974 100644
--- a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
@@ -1,8 +1,17 @@
-# Connecting Local Web Services for Spreadsheet Open and Save in WCF
+---
+layout: post
+title: Web Services using WCF in React Spreadsheet | Syncfusion
+description: Learn here all about web services using WCF in React Spreadsheet component of Syncfusion Essential JS 2 and more.
+control: Web Services
+platform: document-processing
+documentation: ug
+---
+
+# Connecting Web Services for Spreadsheet Open and Save in WCF
This guide demonstrates how to prepare and connect local web services for spreadsheet open and save operations using **WCF (Windows Communication Foundation)**.
-By default, the Syncfusion Spreadsheet component uses Syncfusion®-hosted endpoints for file operations:
+By default, the Syncfusion Spreadsheet component uses Syncfusion-hosted endpoints for file operations:
```ts
openUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/open',
From 6c56b1ba03bbca6f0f98065f8871023a79dfd3e2 Mon Sep 17 00:00:00 2001
From: DinakarSF4212 <147583019+DinakarSF4212@users.noreply.github.com>
Date: Fri, 13 Mar 2026 13:46:19 +0530
Subject: [PATCH 3/6] 1015405: Added changes to the WCF sections and resolved
the CI errors.
---
.../web-services/webservice-using-wcf.md | 76 +++++++++++++++++--
1 file changed, 71 insertions(+), 5 deletions(-)
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
index 4fe2c1974..aabf86fc5 100644
--- a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
@@ -32,7 +32,7 @@ However, these demo services are intended only for **demonstration purposes** an
To create a new WCF Service Library project, follow the steps in the link below:
-[Tutorial: Get started with WCF application | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/framework/wcf/how-to-create-a-wcf-service)
+[Tutorial: Host and run a basic Windows Communication Foundation service - WCF | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/framework/wcf/how-to-host-and-run-a-basic-wcf-service)
## Dependencies
@@ -168,10 +168,76 @@ When working with large Excel files, configure file size limits to prevent serve
```
-## Configure CORS (Cross-Origin Resource Sharing)
+# Configure CORS (Cross-Origin Resource Sharing)
-If your client and WCF service are hosted on different domains or ports, enable CORS. For WCF, you may need to add custom headers in the response or use a message inspector. See:
+If your client and WCF service are hosted on different domains or ports, you must enable CORS to allow cross-origin requests from browsers. In WCF, this can be achieved by adding custom headers using a message inspector and endpoint behavior.
-[Enable CORS in WCF](https://learn.microsoft.com/en-us/answers/questions/116964/how-to-enable-cors-in-wcf-service)
+### Steps to Enable CORS in WCF
-This guide helps you set up a WCF web service for spreadsheet open and save operations, similar to the ASP.NET Core approach, but using WCF for legacy or enterprise scenarios.
+**1. Create a CORS Message Inspector:**
+```csharp
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel;
+
+public class CorsEnabledMessageInspector : IDispatchMessageInspector
+{
+ public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
+ {
+ return null;
+ }
+
+ public void BeforeSendReply(ref Message reply, object correlationState)
+ {
+ var httpHeader = reply.Properties[HttpResponseMessageProperty.Name] as HttpResponseMessageProperty;
+ if (httpHeader == null)
+ {
+ httpHeader = new HttpResponseMessageProperty();
+ reply.Properties.Add(HttpResponseMessageProperty.Name, httpHeader);
+ }
+ httpHeader.Headers.Add("Access-Control-Allow-Origin", "*");
+ httpHeader.Headers.Add("Access-Control-Allow-Methods", "POST, OPTIONS");
+ httpHeader.Headers.Add("Access-Control-Allow-Headers", "Content-Type, Accept");
+ }
+}
+```
+
+**2. Create a CORS Endpoint Behavior:**
+```csharp
+public class CorsEnabledBehavior : Attribute, IEndpointBehavior
+{
+ public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) { }
+ public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) { }
+ public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
+ {
+ endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new CorsEnabledMessageInspector());
+ }
+ public void Validate(ServiceEndpoint endpoint) { }
+}
+```
+
+**3. Apply the Behavior to Your Service:**
+Add the `[CorsEnabledBehavior]` attribute to your service class:
+```csharp
+[CorsEnabledBehavior]
+public class SpreadsheetService : ISpreadsheetService
+{
+ // ...existing code...
+}
+```
+
+**4. (Optional) Handle Preflight (OPTIONS) Requests:**
+If your client sends OPTIONS requests, add a handler in your service contract and implementation:
+```csharp
+[OperationContract]
+[WebInvoke(Method = "OPTIONS", UriTemplate = "*")]
+void Options();
+
+public void Options()
+{
+ // No implementation needed; CORS headers are added by the inspector.
+}
+```
+
+With these additions, your WCF service will support CORS for cross-origin requests, allowing your React Spreadsheet client to communicate with the service without CORS errors.
From 9247cf88839c3f9839c77557406c9e814edb47fb Mon Sep 17 00:00:00 2001
From: DinakarSF4212 <147583019+DinakarSF4212@users.noreply.github.com>
Date: Fri, 13 Mar 2026 14:00:18 +0530
Subject: [PATCH 4/6] 1015405: Resolved CI errors.
---
.../Spreadsheet/React/web-services/webservice-using-wcf.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
index aabf86fc5..97242086f 100644
--- a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
@@ -168,7 +168,7 @@ When working with large Excel files, configure file size limits to prevent serve
```
-# Configure CORS (Cross-Origin Resource Sharing)
+## Configure CORS (Cross-Origin Resource Sharing)
If your client and WCF service are hosted on different domains or ports, you must enable CORS to allow cross-origin requests from browsers. In WCF, this can be achieved by adding custom headers using a message inspector and endpoint behavior.
From 7fa08fab37df63990b1ad3e5e0092b29e9559c34 Mon Sep 17 00:00:00 2001
From: DinakarSF4212 <147583019+DinakarSF4212@users.noreply.github.com>
Date: Tue, 17 Mar 2026 14:48:38 +0530
Subject: [PATCH 5/6] 1015405: Review comments addressed.
---
Document-Processing-toc.html | 1 -
.../webservice-using-aspnetcore.md | 113 ++++----
.../webservice-using-aspnetmvc.md | 94 +++----
.../web-services/webservice-using-wcf.md | 243 ------------------
4 files changed, 112 insertions(+), 339 deletions(-)
delete mode 100644 Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html
index 6645349f3..ed214da7a 100644
--- a/Document-Processing-toc.html
+++ b/Document-Processing-toc.html
@@ -5461,7 +5461,6 @@
Open Excel Files
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
index 2c8a3149e..8da09e7d0 100644
--- a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
@@ -9,39 +9,40 @@ documentation: ug
# Connecting Web Services for Spreadsheet Open and Save in ASP.NET Core
-This guide demonstrates how to prepare and connect local web services for spreadsheet open and save operations using ASP.NET Core.
+This guide explains how to set up and connect local web services for open and save operations in the Syncfusion Spreadsheet component using ASP.NET Core.
-By default, the Syncfusion Spreadsheet component uses Syncfusion®-hosted endpoints for file operations:
+## Overview
+
+By default, the Syncfusion Spreadsheet component uses Syncfusion-hosted endpoints for file operations:
```ts
openUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/open',
saveUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/save'
```
-However, these demo services are intended only for **demonstration purposes** and are not recommended for **production or development environments**.
+These demo services are intended solely for demonstration purposes and are not recommended for production or development environments.
-**Benefits of hosting your own service:**
-- **Full Control** – Manage your data and processes locally.
-- **Better Performance** – Reduce latency with local or private hosting.
-- **Security** – Keep sensitive files within your infrastructure.
-- **Reliability** – Remain independent of Syncfusion's service availability.
-- **Customization** – Add custom business logic and workflows.
-- **Compliance** – Meet regulatory and data residency requirements.
+## How-To Guide: Create a Local ASP.NET Core Web API
-## Create a New ASP.NET Core Web API Project
+### Create a New ASP.NET Core Web API Project
-To create a new ASP.NET Core Web API project, follow the steps in the link below:
+Follow the official Microsoft tutorial to create a controller-based Web API project:
[Tutorial: Create a controller-based web API with ASP.NET Core | Microsoft Learn](https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-10.0&source=recommendations&tabs=visual-studio#create-a-web-api-project)
-## Dependencies
+### Install Required Dependencies
+
+For spreadsheet open and save operations, install the following NuGet packages:
+
+| Platform | Assembly | NuGet Package |
+|---------------|------------------------------------------|---------------|
+| ASP.NET Core | Syncfusion.EJ2.AspNet.Core
Syncfusion.XlsIORenderer.Net.Core | [Syncfusion.EJ2.AspNet.Core](https://www.nuget.org/packages/Syncfusion.EJ2.AspNet.Core)
[Syncfusion.XlsIORenderer.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIORenderer.Net.Core) |
-Open and save helper functions are provided in the
-[`Syncfusion.EJ2.Spreadsheet.AspNet.Core`](https://www.nuget.org/packages/Syncfusion.EJ2.Spreadsheet.AspNet.Core#dependencies-body-tab) package, which is available in Essential Studio and on [nuget.org](https://www.nuget.org/packages/Syncfusion.EJ2.Spreadsheet.AspNet.Core#readme-body-tab).
+For more details, see the [dependencies section on nuget.org](https://www.nuget.org/packages/Syncfusion.EJ2.Spreadsheet.AspNet.Core#dependencies-body-tab).
-## Add Open and Save Controllers
+### Add Open and Save Controllers
-Once the Web API is created, add the following Open and Save controller code to your controller file to enable open and save actions:
+Add the following controller actions to enable open and save functionality:
```csharp
// Open action
@@ -49,9 +50,12 @@ Once the Web API is created, add the following Open and Save controller code to
[Route("Open")]
public IActionResult Open([FromForm] IFormCollection openRequest)
{
- OpenRequest open = new OpenRequest();
+ OpenRequest open = new OpenRequest();
+ if (openRequest.Files.Count > 0) {
open.File = openRequest.Files[0];
return Content(Workbook.Open(open));
+ }
+ return BadRequest("No file uploaded.");
}
// Save action
@@ -59,30 +63,13 @@ public IActionResult Open([FromForm] IFormCollection openRequest)
[Route("Save")]
public IActionResult Save([FromForm] SaveSettings saveSettings)
{
- return Workbook.Save(saveSettings);
+ return Workbook.Save(saveSettings);
}
```
-## Run the Web API Project
+### Configure File Size Limits
-After adding the controller code, build and run the Web API project by following the instructions in the link below:
-
-[Run the ASP.NET Core Web API project](https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-10.0&source=recommendations&tabs=visual-studio#run-the-project)
-
-## Configuring the Client-Side URLs
-
-Once your local service is running, configure your client app to use the local endpoints:
-
-```jsx
-
-```
-
-## Configuring File Size Limits
-
-When working with large Excel files, it is important to configure file size limits to prevent server-side exceptions.
+To support large Excel files, configure file size limits in your server settings.
**web.config**
```xml
@@ -99,31 +86,57 @@ When working with large Excel files, it is important to configure file size limi
```
-**Program.cs:**
+**Program.cs**
```csharp
builder.Services.Configure(options =>
{
- options.MultipartBodyLengthLimit = int.MaxValue;
- options.ValueLengthLimit = int.MaxValue;
+ options.MultipartBodyLengthLimit = int.MaxValue;
+ options.ValueLengthLimit = int.MaxValue;
+});
+
+builder.WebHost.ConfigureKestrel(options =>
+{
+ options.Limits.MaxRequestBodySize = int.MaxValue;
});
```
-## Configure CORS (Cross-Origin Resource Sharing)
+### Enable CORS (Cross-Origin Resource Sharing)
-Edit `Program.cs` to enable CORS for your application:
+Edit `Program.cs` to allow cross-origin requests:
```csharp
var MyAllowSpecificOrigins = "AllowAllOrigins";
builder.Services.AddCors(options =>
{
- options.AddPolicy(MyAllowSpecificOrigins, builder =>
- {
- builder.AllowAnyOrigin()
- .AllowAnyMethod()
- .AllowAnyHeader();
- });
+ options.AddPolicy(MyAllowSpecificOrigins, builder =>
+ {
+ builder.AllowAnyOrigin()
+ .AllowAnyMethod()
+ .AllowAnyHeader();
+ });
});
var app = builder.Build();
app.UseCors(MyAllowSpecificOrigins);
-```
\ No newline at end of file
+```
+
+### Run the Web API Project
+
+Build and run your Web API project. For detailed instructions, refer to:
+
+[Run the ASP.NET Core Web API project](https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-10.0&source=recommendations&tabs=visual-studio#run-the-project)
+
+---
+
+### Configuring the Client-Side URLs
+
+After your local service is running, configure your client application to use the local endpoints:
+
+```js
+
+```
+
+For more information, refer to the following [blog post](https://www.syncfusion.com/blogs/post/host-spreadsheet-open-and-save-services).
\ No newline at end of file
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
index f40ac1574..e794fc9f7 100644
--- a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
@@ -7,44 +7,41 @@ platform: document-processing
documentation: ug
---
+
# Connecting Web Services for Spreadsheet Open and Save in ASP.NET MVC
-This guide demonstrates how to prepare and connect local web services for spreadsheet open and save operations using **ASP.NET MVC**.
+This guide explains how to set up and connect local web services for open and save operations in the Syncfusion Spreadsheet component using **ASP.NET MVC**.
+
+## Overview
-By default, the Syncfusion Spreadsheet component uses Syncfusion hosted endpoints for file operations:
+By default, the Syncfusion Spreadsheet component uses Syncfusion-hosted endpoints for file operations:
```ts
openUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/open',
saveUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/save'
```
-However, these demo services are intended only for **demonstration purposes** and are not recommended for **production or development environments**.
+These demo services are intended solely for demonstration purposes and are not recommended for production or development environments.
-**Benefits of hosting your own service:**
-- **Full Control** – Manage your data and processes locally.
-- **Better Performance** – Reduce latency with local or private hosting.
-- **Security** – Keep sensitive files within your infrastructure.
-- **Reliability** – Remain independent of Syncfusion's service availability.
-- **Customization** – Add custom business logic and workflows.
-- **Compliance** – Meet regulatory and data residency requirements.
+## How-To Guide: Create a Local ASP.NET MVC Web Service
-## Create a New ASP.NET MVC Project
+### Create a New ASP.NET MVC Project
-To create a new ASP.NET MVC project follow the steps mentioned in the link below.
+Follow the official Microsoft tutorial to create an ASP.NET MVC 5 project:
[Getting Started with ASP.NET MVC 5 | Microsoft Learn](https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/introduction/getting-started)
-## Dependencies
+### Install Required Dependencies
-Following list of dependencies required for Spreadsheet open and save operations.
+For spreadsheet open and save operations, install the following NuGet packages:
-| **Platforms** | **Assembly** | **Nuget Package** |
-| ----- | ----- | ----- |
-| ASP.NET MVC5 | Syncfusion.EJ2.MVC5
Syncfusion.EJ2.Spreadsheet.AspNet.MVC5
Syncfusion.Compression.Base
Syncfusion.XlsIO.AspNet.Mvc5
Syncfusion.ExcelToPdfConverter.AspNet.Mvc5
| [Syncfusion.EJ2.Spreadsheet.AspNet.MVC5](https://www.nuget.org/packages/Syncfusion.EJ2.Spreadsheet.AspNet.MVC5)
[Syncfusion.ExcelToPdfConverter.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.ExcelToPdfConverter.AspNet.Mvc5) |
+| Platform | Assembly | NuGet Package |
+|---------------|------------------------------------------|---------------|
+| ASP.NET MVC5 | Syncfusion.XlsIO.AspNet.Mvc5
Syncfusion.ExcelToPdfConverter.AspNet.Mvc5
Syncfusion.Pdf.AspNet.Mvc5
Syncfusion.ExcelChartToImageConverter.AspNet.Mvc5
Syncfusion.EJ2.MVC5 | [Syncfusion.XlsIO.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.XlsIO.AspNet.Mvc5)
[Syncfusion.ExcelToPdfConverter.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.ExcelToPdfConverter.AspNet.Mvc5)
[Syncfusion.Pdf.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.Pdf.AspNet.Mvc5/)
[Syncfusion.ExcelChartToImageConverter.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.ExcelChartToImageConverter.AspNet.Mvc5)
[Syncfusion.EJ2.MVC5](https://www.nuget.org/packages/Syncfusion.EJ2.MVC5) |
-## Add Open and Save Actions in Controller
+### Add Open and Save Actions in Controller
-Once the MVC project is created, add the following Open and Save action methods to your controller (e.g., `SpreadsheetController`) to enable open and save actions:
+Add the following action methods to your controller (e.g., `SpreadsheetController`) to enable open and save functionality:
```csharp
using System.Web;
@@ -55,40 +52,28 @@ public class SpreadsheetController : Controller
{
// Open action
[HttpPost]
- public ActionResult Open()
+ public ActionResult Open(OpenRequest openRequest)
{
- OpenRequest open = new OpenRequest();
- open.File = Request.Files[0];
- return Content(Workbook.Open(open));
+ if (openRequest != null && openRequest.File != null)
+ {
+ var result = Workbook.Open(openRequest);
+ return Content(result);
+ }
+ return new HttpStatusCodeResult(400, "No file uploaded.");
}
// Save action
[HttpPost]
- public ActionResult Save(SaveSettings saveSettings)
+ public void Save(SaveSettings saveSettings)
{
- return Workbook.Save(saveSettings);
+ Workbook.Save(saveSettings);
}
}
```
-## Run the MVC Project
-
-After adding the controller code, build and run the MVC project (F5 or Ctrl+F5 in Visual Studio).
-
-## Configuring the Client-Side URLs
-
-Once your local service is running, configure your client app to use the local endpoints:
-
-```jsx
-
-```
-
-## Configuring File Size Limits
+### Configure File Size Limits
-When working with large Excel files, it is important to configure file size limits to prevent server-side exceptions.
+To support large Excel files, configure file size limits in your server settings.
**web.config**
```xml
@@ -108,14 +93,14 @@ When working with large Excel files, it is important to configure file size limi
```
-## Configure CORS (Cross-Origin Resource Sharing)
+### Enable CORS (Cross-Origin Resource Sharing)
Cross-Origin Resource Sharing (CORS) allows your ASP.NET MVC application to accept requests from other domains (such as when your client app and server are running on different ports or hosts).
**How to Enable CORS in ASP.NET MVC**
1. Open `Global.asax.cs` in your project.
-2. Add the following code to the `Application_BeginRequest` method.
+2. Add the following code to the `Application_BeginRequest` method:
```csharp
protected void Application_BeginRequest()
@@ -131,4 +116,23 @@ protected void Application_BeginRequest()
HttpContext.Current.Response.End();
}
}
-```
\ No newline at end of file
+```
+
+### Run the MVC Project
+
+After adding the controller code, build and run the MVC project (F5 or Ctrl+F5 in Visual Studio).
+
+---
+
+### Configuring the Client-Side URLs
+
+Once your local service is running, configure your client application to use the local endpoints:
+
+```js
+
+```
+
+For more information, refer to the following [blog post](https://www.syncfusion.com/blogs/post/host-spreadsheet-open-and-save-services).
\ No newline at end of file
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
deleted file mode 100644
index 97242086f..000000000
--- a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-wcf.md
+++ /dev/null
@@ -1,243 +0,0 @@
----
-layout: post
-title: Web Services using WCF in React Spreadsheet | Syncfusion
-description: Learn here all about web services using WCF in React Spreadsheet component of Syncfusion Essential JS 2 and more.
-control: Web Services
-platform: document-processing
-documentation: ug
----
-
-# Connecting Web Services for Spreadsheet Open and Save in WCF
-
-This guide demonstrates how to prepare and connect local web services for spreadsheet open and save operations using **WCF (Windows Communication Foundation)**.
-
-By default, the Syncfusion Spreadsheet component uses Syncfusion-hosted endpoints for file operations:
-
-```ts
-openUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/open',
-saveUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/save'
-```
-
-However, these demo services are intended only for **demonstration purposes** and are not recommended for **production or development environments**.
-
-**Benefits of hosting your own service:**
-- **Full Control** – Manage your data and processes locally.
-- **Better Performance** – Reduce latency with local or private hosting.
-- **Security** – Keep sensitive files within your infrastructure.
-- **Reliability** – Remain independent of Syncfusion's service availability.
-- **Customization** – Add custom business logic and workflows.
-- **Compliance** – Meet regulatory and data residency requirements.
-
-## Create a New WCF Service Library Project
-
-To create a new WCF Service Library project, follow the steps in the link below:
-
-[Tutorial: Host and run a basic Windows Communication Foundation service - WCF | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/framework/wcf/how-to-host-and-run-a-basic-wcf-service)
-
-## Dependencies
-
-To process Excel files, you can use libraries such as [Syncfusion XlsIO](https://www.syncfusion.com/products/file-formats/xlsio) or [EPPlus](https://www.epplussoftware.com/). Add the required NuGet package to your project for spreadsheet file handling.
-
-## Add Open and Save Service Methods
-
-Once the WCF service is created, define the service contract and implement the Open and Save methods as shown below:
-
-**Service Contract (Interface):**
-```csharp
-using System.ServiceModel;
-using System.ServiceModel.Web;
-using System.IO;
-
-[ServiceContract]
-public interface ISpreadsheetService
-{
- // Open action (accepts file upload as stream)
- [OperationContract]
- [WebInvoke(Method = "POST", UriTemplate = "/Open", BodyStyle = WebMessageBodyStyle.Bare)]
- Stream Open(Stream fileStream);
-
- // Save action (accepts file upload as stream)
- [OperationContract]
- [WebInvoke(Method = "POST", UriTemplate = "/Save", BodyStyle = WebMessageBodyStyle.Bare)]
- Stream Save(Stream fileStream);
-}
-```
-
-**Service Implementation:**
-```csharp
-public class SpreadsheetService : ISpreadsheetService
-{
- public Stream Open(Stream fileStream)
- {
- // Here, you would process the uploaded file stream (e.g., using Syncfusion XlsIO)
- // For demonstration, just return the same stream or a processed file stream
- // Example: Save the uploaded file to disk, then return a processed file as stream
-
- string tempPath = Path.GetTempFileName();
- using (var file = File.Create(tempPath))
- {
- fileStream.CopyTo(file);
- }
-
- // Process the file as needed, then return the result as a stream
- // For now, just return the uploaded file
- return new FileStream(tempPath, FileMode.Open, FileAccess.Read);
- }
-
- public Stream Save(Stream fileStream)
- {
- // Save the uploaded file to disk (or process as needed)
- string savePath = Path.Combine("C:\\SpreadsheetUploads", $"Saved_{Guid.NewGuid()}.xlsx");
- Directory.CreateDirectory(Path.GetDirectoryName(savePath));
- using (var file = File.Create(savePath))
- {
- fileStream.CopyTo(file);
- }
-
- // Return a simple confirmation message as a stream
- var result = System.Text.Encoding.UTF8.GetBytes("File saved successfully.");
- return new MemoryStream(result);
- }
-}
-```
-
-## Configure the WCF Service
-
-Edit `App.config` to expose the service over HTTP:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
-## Run the WCF Service
-
-After adding the service code, build and run the WCF Service Library project. You can use the WCF Test Client to test the Open and Save methods.
-
-For more details, see:
-[Run a WCF service in Visual Studio](https://learn.microsoft.com/en-us/dotnet/framework/wcf/how-to-host-and-run-a-basic-wcf-service)
-
-## Configuring the Client-Side URLs
-
-Once your local service is running, configure your client app to use the local endpoints. For example:
-
-```jsx
-
-```
-
-## Configuring File Size Limits
-
-When working with large Excel files, configure file size limits to prevent server-side exceptions.
-
-**web.config** (if hosting in IIS):
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
-## Configure CORS (Cross-Origin Resource Sharing)
-
-If your client and WCF service are hosted on different domains or ports, you must enable CORS to allow cross-origin requests from browsers. In WCF, this can be achieved by adding custom headers using a message inspector and endpoint behavior.
-
-### Steps to Enable CORS in WCF
-
-**1. Create a CORS Message Inspector:**
-```csharp
-using System.ServiceModel.Dispatcher;
-using System.ServiceModel.Channels;
-using System.ServiceModel.Description;
-using System.ServiceModel;
-
-public class CorsEnabledMessageInspector : IDispatchMessageInspector
-{
- public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
- {
- return null;
- }
-
- public void BeforeSendReply(ref Message reply, object correlationState)
- {
- var httpHeader = reply.Properties[HttpResponseMessageProperty.Name] as HttpResponseMessageProperty;
- if (httpHeader == null)
- {
- httpHeader = new HttpResponseMessageProperty();
- reply.Properties.Add(HttpResponseMessageProperty.Name, httpHeader);
- }
- httpHeader.Headers.Add("Access-Control-Allow-Origin", "*");
- httpHeader.Headers.Add("Access-Control-Allow-Methods", "POST, OPTIONS");
- httpHeader.Headers.Add("Access-Control-Allow-Headers", "Content-Type, Accept");
- }
-}
-```
-
-**2. Create a CORS Endpoint Behavior:**
-```csharp
-public class CorsEnabledBehavior : Attribute, IEndpointBehavior
-{
- public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) { }
- public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) { }
- public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
- {
- endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new CorsEnabledMessageInspector());
- }
- public void Validate(ServiceEndpoint endpoint) { }
-}
-```
-
-**3. Apply the Behavior to Your Service:**
-Add the `[CorsEnabledBehavior]` attribute to your service class:
-```csharp
-[CorsEnabledBehavior]
-public class SpreadsheetService : ISpreadsheetService
-{
- // ...existing code...
-}
-```
-
-**4. (Optional) Handle Preflight (OPTIONS) Requests:**
-If your client sends OPTIONS requests, add a handler in your service contract and implementation:
-```csharp
-[OperationContract]
-[WebInvoke(Method = "OPTIONS", UriTemplate = "*")]
-void Options();
-
-public void Options()
-{
- // No implementation needed; CORS headers are added by the inspector.
-}
-```
-
-With these additions, your WCF service will support CORS for cross-origin requests, allowing your React Spreadsheet client to communicate with the service without CORS errors.
From 32840af2b2d980236c39c530313b0bb8d54007b6 Mon Sep 17 00:00:00 2001
From: DinakarSF4212 <147583019+DinakarSF4212@users.noreply.github.com>
Date: Tue, 17 Mar 2026 20:45:12 +0530
Subject: [PATCH 6/6] 1015405: Review comments addressed.
---
.../web-services/webservice-using-aspnetcore.md | 16 ++++++++++++----
.../web-services/webservice-using-aspnetmvc.md | 16 ++++++++++++----
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
index 8da09e7d0..e3d7a0f0d 100644
--- a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetcore.md
@@ -51,7 +51,7 @@ Add the following controller actions to enable open and save functionality:
public IActionResult Open([FromForm] IFormCollection openRequest)
{
OpenRequest open = new OpenRequest();
- if (openRequest.Files.Count > 0) {
+ if (openRequest.Files && openRequest.Files.Count > 0) {
open.File = openRequest.Files[0];
return Content(Workbook.Open(open));
}
@@ -63,7 +63,9 @@ public IActionResult Open([FromForm] IFormCollection openRequest)
[Route("Save")]
public IActionResult Save([FromForm] SaveSettings saveSettings)
{
- return Workbook.Save(saveSettings);
+ if(saveSettings && saveSettings.JSONData) {
+ return Workbook.Save(saveSettings);
+ }
}
```
@@ -130,7 +132,7 @@ Build and run your Web API project. For detailed instructions, refer to:
### Configuring the Client-Side URLs
-After your local service is running, configure your client application to use the local endpoints:
+Once your local service is launched, configure the openUrl and saveUrl properties in client application to use the local endpoints.
```js
```
-For more information, refer to the following [blog post](https://www.syncfusion.com/blogs/post/host-spreadsheet-open-and-save-services).
\ No newline at end of file
+For more information, refer to the following [blog post](https://www.syncfusion.com/blogs/post/host-spreadsheet-open-and-save-services).
+
+## See Also
+
+* [Docker Image Overview](../server-deployment/spreadsheet-server-docker-image-overview)
+* [Open Excel Files](../open-excel-files)
+* [Save Excel Files](../save-excel-files)
\ No newline at end of file
diff --git a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
index e794fc9f7..c621e5b2b 100644
--- a/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
+++ b/Document-Processing/Excel/Spreadsheet/React/web-services/webservice-using-aspnetmvc.md
@@ -66,7 +66,9 @@ public class SpreadsheetController : Controller
[HttpPost]
public void Save(SaveSettings saveSettings)
{
- Workbook.Save(saveSettings);
+ if(saveSettings && saveSettings.JSONData) {
+ Workbook.Save(saveSettings);
+ }
}
}
```
@@ -120,13 +122,13 @@ protected void Application_BeginRequest()
### Run the MVC Project
-After adding the controller code, build and run the MVC project (F5 or Ctrl+F5 in Visual Studio).
+After adding the controller codes and above mentioned configurations, build and run the MVC project (F5 or Ctrl+F5 in Visual Studio).
---
### Configuring the Client-Side URLs
-Once your local service is running, configure your client application to use the local endpoints:
+Once your local service is launched, configure the openUrl and saveUrl properties in client application to use the local endpoints.
```js
```
-For more information, refer to the following [blog post](https://www.syncfusion.com/blogs/post/host-spreadsheet-open-and-save-services).
\ No newline at end of file
+For more information, refer to the following [blog post](https://www.syncfusion.com/blogs/post/host-spreadsheet-open-and-save-services).
+
+## See Also
+
+* [Docker Image Overview](../server-deployment/spreadsheet-server-docker-image-overview)
+* [Open Excel Files](../open-excel-files)
+* [Save Excel Files](../save-excel-files)
\ No newline at end of file