Sachstand 15.7.16
This commit is contained in:
parent
d5231aab7e
commit
75ebfbdbee
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
|
||||||
</startup>
|
</startup>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@ -13,11 +13,12 @@ namespace SafeSeaNetTest
|
|||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
|
|
||||||
private static string baseUri = "https://nswtest.safeseanet.dk/api/v1/search?query=contentType: ship&take=5";
|
private static string baseUri = "https://nswtestapi.safeseanet.dk/api/v1/";
|
||||||
|
private static string searchUri = "search?query=contentType: ship&take=5";
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Login();
|
Login2();
|
||||||
|
|
||||||
|
|
||||||
Console.Read();
|
Console.Read();
|
||||||
@ -68,5 +69,52 @@ namespace SafeSeaNetTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static async void Login2()
|
||||||
|
{
|
||||||
|
NetworkCredential credential = new NetworkCredential("bsm-schick", "Melder2016");
|
||||||
|
CredentialCache cc = new CredentialCache();
|
||||||
|
cc.Add(new Uri(baseUri), "NTLM", credential);
|
||||||
|
|
||||||
|
HttpClientHandler handler = new HttpClientHandler();
|
||||||
|
handler.AllowAutoRedirect = true;
|
||||||
|
handler.Credentials = cc;
|
||||||
|
string querystring = Path.Combine(baseUri, searchUri);
|
||||||
|
|
||||||
|
//var encoded = Convert.ToBase64String(Encoding.ASCII.GetBytes("bsm-schick:Melder2016"));
|
||||||
|
handler.PreAuthenticate = true;
|
||||||
|
|
||||||
|
Uri uri = new Uri(querystring);
|
||||||
|
HttpRequestMessage hrm = new HttpRequestMessage(HttpMethod.Get, uri);
|
||||||
|
|
||||||
|
|
||||||
|
HttpClient httpClient = new HttpClient(handler);
|
||||||
|
httpClient.DefaultRequestHeaders.Add("accept", "application/json");
|
||||||
|
//httpClient.DefaultRequestHeaders.Add("Content-Type", "application/json");
|
||||||
|
|
||||||
|
|
||||||
|
//httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", encoded);
|
||||||
|
Console.WriteLine("Query: " + querystring);
|
||||||
|
HttpResponseMessage responseMessage = await httpClient.GetAsync(querystring);
|
||||||
|
|
||||||
|
if(responseMessage.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
|
{
|
||||||
|
// do NTLM auth
|
||||||
|
// hrm.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("NTLM")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
string jsonMessage;
|
||||||
|
using (Stream responseStream = await responseMessage.Content.ReadAsStreamAsync())
|
||||||
|
{
|
||||||
|
jsonMessage = new StreamReader(responseStream).ReadToEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine(jsonMessage);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,9 +9,10 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>SafeSeaNetTest</RootNamespace>
|
<RootNamespace>SafeSeaNetTest</RootNamespace>
|
||||||
<AssemblyName>SafeSeaNetTest</AssemblyName>
|
<AssemblyName>SafeSeaNetTest</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@ -50,6 +51,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<WCFMetadata Include="Service References\" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
@ -187,6 +187,12 @@ namespace bsmd.database
|
|||||||
if(this.ETDFromPortOfCall.HasValue && this.ETAToPortOfCall.HasValue &&
|
if(this.ETDFromPortOfCall.HasValue && this.ETAToPortOfCall.HasValue &&
|
||||||
(this.ETDFromPortOfCall < this.ETAToPortOfCall))
|
(this.ETDFromPortOfCall < this.ETAToPortOfCall))
|
||||||
errors.Add(RuleEngine.CreateError(ValidationCode.E121, "Departure time before arrival time!", null));
|
errors.Add(RuleEngine.CreateError(ValidationCode.E121, "Departure time before arrival time!", null));
|
||||||
|
|
||||||
|
if(this.CallPurposes.Count == 0)
|
||||||
|
{
|
||||||
|
errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, "Purpose of call missing!", null));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
|
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
|
||||||
[assembly: AssemblyProduct("BSMD NSW interface")]
|
[assembly: AssemblyProduct("BSMD NSW interface")]
|
||||||
[assembly: AssemblyInformationalVersion("3.1.3")]
|
[assembly: AssemblyInformationalVersion("3.1.4")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2014-2016 Informatikbüro Daniel Schick. All rights reserved.")]
|
[assembly: AssemblyCopyright("Copyright © 2014-2016 Informatikbüro Daniel Schick. All rights reserved.")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.1.3.*")]
|
[assembly: AssemblyVersion("3.1.4.*")]
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user