Commit d213240e authored by mohammad.salama's avatar mohammad.salama

Fixed Parsing Error, All Working Fine, All Tested, https Enabled

parent 9bab51ec
...@@ -20,13 +20,23 @@ namespace HTTPEndUser ...@@ -20,13 +20,23 @@ namespace HTTPEndUser
try try
{ {
HttpResponseMessage reply = await client.PostAsync("http://localhost:7095/queue-msg", payload); HttpResponseMessage rr = await client.PostAsync("http://localhost:7095/queue-msg", payload);
string json = await rr.Content.ReadAsStringAsync();
Reply reply = JsonSerializer.Deserialize<Reply>(json);
if (reply.replyCode.Contains("OK" , StringComparison.OrdinalIgnoreCase))
{
Response.Text = "Response : " + reply.replyCode + "\n"+reply.requestID;
Response.ForeColor = Color.Green;
}
else
{
Response.Text = "Response : " + reply.replyCode + "\n"+reply.requestID;
Response.ForeColor = Color.Red;
}
Response.Text = "Respose : " + reply.Content.ToString();
Response.ForeColor = Color.Green;
//Console.WriteLine(reply.Content.ToString());
} }
catch (Exception ex) catch (Exception ex)
{ {
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HTTPEndUser
{
public class Reply
{
public string replyCode { get; set; }
public string requestID { get; set; }
}
}
632707e23a028caaf44c0cd89b5d76eabdaee4cb e12b2de5e607fc198e3fab2eeb94a27ce2e3c0eb
...@@ -16,3 +16,21 @@ C:\Users\Mr.Salameh\source\repos\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-window ...@@ -16,3 +16,21 @@ C:\Users\Mr.Salameh\source\repos\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-window
C:\Users\Mr.Salameh\source\repos\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.pdb C:\Users\Mr.Salameh\source\repos\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.pdb
C:\Users\Mr.Salameh\source\repos\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.genruntimeconfig.cache C:\Users\Mr.Salameh\source\repos\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.genruntimeconfig.cache
C:\Users\Mr.Salameh\source\repos\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.Properties.Resources.resources C:\Users\Mr.Salameh\source\repos\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.Properties.Resources.resources
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\bin\Debug\net6.0-windows\HTTPEndUser.exe
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\bin\Debug\net6.0-windows\HTTPEndUser.deps.json
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\bin\Debug\net6.0-windows\HTTPEndUser.runtimeconfig.json
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\bin\Debug\net6.0-windows\HTTPEndUser.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\bin\Debug\net6.0-windows\ref\HTTPEndUser.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\bin\Debug\net6.0-windows\HTTPEndUser.pdb
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.csproj.AssemblyReference.cache
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.Form1.resources
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.Properties.Resources.resources
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.csproj.GenerateResource.cache
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.GeneratedMSBuildEditorConfig.editorconfig
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.AssemblyInfoInputs.cache
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.AssemblyInfo.cs
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.csproj.CoreCompileInputs.cache
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\ref\HTTPEndUser.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.pdb
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\HTTPEndUser\HTTPEndUser\obj\Debug\net6.0-windows\HTTPEndUser.genruntimeconfig.cache
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
} }
], ],
"additionalProbingPaths": [ "additionalProbingPaths": [
"C:\\Users\\Mr.Salameh\\.dotnet\\store\\|arch|\\|tfm|", "C:\\Users\\moham\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\Mr.Salameh\\.nuget\\packages", "C:\\Users\\moham\\.nuget\\packages",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
], ],
"configProperties": { "configProperties": {
......
5359407d4ad8f7048ea7dd0f51b5bc189a0aceab 85da0e39d1b8f4739ba1fc20daf358ed6fdbac4f
{ {
"format": 1, "format": 1,
"restore": { "restore": {
"C:\\Users\\Mr.Salameh\\source\\repos\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj": {} "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj": {}
}, },
"projects": { "projects": {
"C:\\Users\\Mr.Salameh\\source\\repos\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj": { "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "C:\\Users\\Mr.Salameh\\source\\repos\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj", "projectUniqueName": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj",
"projectName": "HTTPEndUser", "projectName": "HTTPEndUser",
"projectPath": "C:\\Users\\Mr.Salameh\\source\\repos\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj", "projectPath": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj",
"packagesPath": "C:\\Users\\Mr.Salameh\\.nuget\\packages\\", "packagesPath": "C:\\Users\\moham\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Mr.Salameh\\source\\repos\\HTTPEndUser\\HTTPEndUser\\obj\\", "outputPath": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\HTTPEndUser\\HTTPEndUser\\obj\\",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"fallbackFolders": [ "fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
], ],
"configFilePaths": [ "configFilePaths": [
"C:\\Users\\Mr.Salameh\\AppData\\Roaming\\NuGet\\NuGet.Config", "C:\\Users\\moham\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
], ],
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool> <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile> <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot> <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Mr.Salameh\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders> <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\moham\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle> <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.0.0</NuGetToolVersion> <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.0.0</NuGetToolVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> <ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Mr.Salameh\.nuget\packages\" /> <SourceRoot Include="C:\Users\moham\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" /> <SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
...@@ -8,23 +8,23 @@ ...@@ -8,23 +8,23 @@
"net6.0-windows7.0": [] "net6.0-windows7.0": []
}, },
"packageFolders": { "packageFolders": {
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\": {}, "C:\\Users\\moham\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
}, },
"project": { "project": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "C:\\Users\\Mr.Salameh\\source\\repos\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj", "projectUniqueName": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj",
"projectName": "HTTPEndUser", "projectName": "HTTPEndUser",
"projectPath": "C:\\Users\\Mr.Salameh\\source\\repos\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj", "projectPath": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj",
"packagesPath": "C:\\Users\\Mr.Salameh\\.nuget\\packages\\", "packagesPath": "C:\\Users\\moham\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Mr.Salameh\\source\\repos\\HTTPEndUser\\HTTPEndUser\\obj\\", "outputPath": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\HTTPEndUser\\HTTPEndUser\\obj\\",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"fallbackFolders": [ "fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
], ],
"configFilePaths": [ "configFilePaths": [
"C:\\Users\\Mr.Salameh\\AppData\\Roaming\\NuGet\\NuGet.Config", "C:\\Users\\moham\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
], ],
......
{ {
"version": 2, "version": 2,
"dgSpecHash": "A53qbGWLXHRcaWJMhicTEuU0DQ3ugBdTaXj/VwGEVqXODrQQ3dcabmbG3WsADYwrMhG1bi/5hAnAwarFQVa5Qw==", "dgSpecHash": "dv3IXTIq4vwTNZ6dSaH+/gUYXyrodjUr5muk4B1SLxas8hIHbw2A1vZrIv5Dhj/am8YZWHq/vFjXzUptzlC4kw==",
"success": true, "success": true,
"projectFilePath": "C:\\Users\\Mr.Salameh\\source\\repos\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj", "projectFilePath": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\HTTPEndUser\\HTTPEndUser\\HTTPEndUser.csproj",
"expectedPackageFiles": [], "expectedPackageFiles": [],
"logs": [] "logs": []
} }
\ No newline at end of file
...@@ -7,36 +7,42 @@ using System.Text.Json; ...@@ -7,36 +7,42 @@ using System.Text.Json;
MessageDTO message = new MessageDTO(); MessageDTO message = new MessageDTO();
message.text = "Hello World !"; message.text = "Hello World !";
message.apiKey = "Api-Key"; message.apiKey = "a";
message.clientID = "m-salameh"; message.clientID = "1";
message.localPriority = 1; message.localPriority = 1;
message.msgId = "msg-id=1"; message.msgId = "msg-id=1";
message.phoneNumber = "043 33 00 83"; message.phoneNumber = "043 33 00 83";
message.tag = "SYR"; message.tag = "mtn";
//message.year = message.month = message.day = message.minute = 0; //message.year = message.month = message.day = message.minute = 0;
message.year = 2024; message.year = 0;
message.month = 8; message.month = 0;
message.day = 16; message.day = 0;
message.hour = 23; message.hour = 0;
message.minute = 59; message.minute = 0;
CancellationTokenSource cancel = new CancellationTokenSource(); CancellationTokenSource cancel = new CancellationTokenSource();
/*
var client = new HttpClient(); var client = new HttpClient();
StringContent payload = new(JsonSerializer.Serialize(message), Encoding.UTF8, "application/json"); StringContent payload = new(JsonSerializer.Serialize(message), Encoding.UTF8, "application/json");
try try
{ {
HttpResponseMessage reply = await client.PostAsync("http://localhost:7095/queue-msg", payload); HttpResponseMessage rr = await client.PostAsync("http://localhost:7095/queue-msg", payload);
string json = await rr.Content.ReadAsStringAsync();
Reply reply = JsonSerializer.Deserialize<Reply>(json);
Console.WriteLine(reply.Content.ToString()); // Access the properties of the parsed object
Console.WriteLine($"replyCode: {reply.replyCode}");
Console.WriteLine($"requestID: {reply.requestID}");
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.Error.WriteLine("Error Processing - Connection Problem"); Console.Error.WriteLine("Error Processing - Connection Problem");
} }
*/
/* /*
var task1 = Task.Run(async () => var task1 = Task.Run(async () =>
{ {
...@@ -60,7 +66,7 @@ var task1 = Task.Run(async () => ...@@ -60,7 +66,7 @@ var task1 = Task.Run(async () =>
} }
});*/ });*/
/*
Task[] tsks = new Task[6]; Task[] tsks = new Task[6];
for (int i=0; i < tsks.Length; i++) for (int i=0; i < tsks.Length; i++)
{ {
...@@ -87,4 +93,4 @@ for (int i=0; i < tsks.Length; i++) ...@@ -87,4 +93,4 @@ for (int i=0; i < tsks.Length; i++)
}); });
} }
Task.WaitAll(tsks); Task.WaitAll(tsks);*/
\ No newline at end of file \ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HTTPMessageGenerator
{
public class Reply
{
public string replyCode { get; set; }
public string requestID { get; set; }
}
}
4cc62d5f551acc229fe24487cb80a308ab870455 57fc46e3e14d4707ed6190a51d8a8669eeda2b9f
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment