Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing ServiceResult returns of CheckServiceFaultResponse() in Client.cs #154

Closed
Christ0ph89 opened this issue Apr 17, 2024 · 1 comment

Comments

@Christ0ph89
Copy link

Hi Nauful,

I was struggling with a strange problem, which turned out to be a mistake of a wrong uri in the certificate (missing letter...).
All the time I've tried to open a new session to the OPC UA server of our S7 PLC, I received the ServiceResult "2149908480" (BadSessionIdInvalid), which is not correct for that specific problem. The correct ServiceResult is "2148990976" (BadCertificateUriInvalid).

At the end I was able to get the correct ServiceResult by setting breakpoints at the right positions in the Client.cs source file. But there I saw, that there is maybe a, or some, missing "return" in the library, to receive the correct ServiceResult. All the time the method CheckServiceFaultResponse() is used, there is no return or handling of the service code that it responses. After changing, in my case the line 1919 in the Client.cs to return CheckServiceFaultResponse(recvHandler);, I was able to return the correct status code to the upper client class and print it to the logs.

So my question is, is the returning of the status code of that method just missing or a desired behaviour? Because all occurence of that method in the Client.cs does not return the status code.

Greetings

@nauful
Copy link
Owner

nauful commented Apr 17, 2024

Hello,

You are correct, that is indeed a bug. It was originally based on throwing exceptions and I forgot to convert this code over. I will be making some updates for that soon to fix this.

Thanks

@nauful nauful closed this as completed Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants