cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Business One SDK: Consume Service Layer oData services from .NET SSL Problem

dennis_drescher
Explorer
0 Kudos

Hello everybody,

I have created a .NET project with the following instructions:

This has worked very well, but when I started to program my business logic and these tested,

i always get the following error message:

Can anyone help me?

Regards,

Dennis Drescher

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I guess that it is the following problem.

If you open the URL in a Browser you will probably get the message that the SSL Certificat is not Trusted and you click on except the certificat anyway.

Same thing done in C# Code:


System.Net.ServicePointManager.ServerCertificateValidationCallback =

delegate(object obj, System.Security.Cryptography.X509Certificates.X509Certificate certificate,

                        System.Security.Cryptography.X509Certificates.X509Chain chain,

                        System.Net.Security.SslPolicyErrors sslPolicyErrors)

{

    return true;  **** Always accept

};

Best regards,

Thomas

dennis_drescher
Explorer
0 Kudos

Thank you,

but get directly the next message :

This is my Code :

I'm new in the OData area and have no experience.

Regards,

Dennis Drescher

Former Member
0 Kudos

What do you get if you open the URL (https:// ... /b1s/v1/$metadata) in the Browser?

dennis_drescher
Explorer
0 Kudos

This :

Former Member
0 Kudos

Sorry, but I dont know the answer.

I have also just startet with oData and there are obviously not many other people working with oData jet.

Answers (1)

Answers (1)

Salim-Satiro
Explorer
0 Kudos

Facing exactly the same problem: invalid session - related to 401 status code

Was anyone able to solve this ?

Regards

Former Member
0 Kudos

Have you read the following arcticle from SAP, they have a sample program there too.

Regards

Salim-Satiro
Explorer
0 Kudos

Yes; there is where the error happens.... also if running REST clients such as ARC, Postman, etc