SMPP BIND ERROR: 0x0000000D in EasySMPP - c#

I am implementing the SMPP client using EasySMPP for .NET
The application is compiling fine but there was no successful outcome and I am getting this weird error
SMPP BIND ERROR: 0x0000000D
What can be done for this, please help.

The error code of 0x0000000D is unfortunately a rather generic "Bind Failed".
To find out what the error codes mean check section 5.1.3, command_status, of the SMPP specification you linked to.
Common causes for getting a "Bind Failed" response are:
Your supplier only allows certain IP addresses to connect
Trying to connect to wrong hostname/port combination
Wrong username/password
To troubleshoot, you could try running Wireshark on your client and take a look at the SMPP PDUs being passed backwards and forwards, if you post the capture on here I'm happy to take a look. Or you could give your supplier a call, they may be able to see something helpful in their server logs.

Related

OMRON FINS Request Error - "Command Data is too Long"

I am using the RICADO.OMRON library for .NET to be able to connect to and read tags from an OMRON PLC. This usually does work, but I'm running into an issue with this one PLC I am trying to connect to. It is a UDP connection to a PLC, which uses the same base address as another PLC to hop to a different one. It has a specified remote network ID, remote node ID and local network ID to be able to connect.
I see the request message being constructed with all these parameters in the byte array of length 13 (same as any other request, if I'm not mistaken). However, when I read back the response message, this error always shows up:
https://i.stack.imgur.com/wCKQr.png
I've tried looking for more clarity on this exception online but am not having much luck. As far as I know, the request message is being constructed just fine, as it uses the same code for every connection.
Can anybody provide some clarity on the requirements of the request message, and what the command data is?

Reference Client (UA.-.NETStandard-master) is BadNotConnected

I have a question that I already asked on the GitHub forum. Unfortunately I didn't get an answer there and I hope that you can help me here. If I do get an answer in the GitHub forum, I'll name it here. My GitHubPost can be found under the following link:
https://github.com/OPCFoundation/UA-.NETStandard/issues/1139
I will still copy the post from the GitHub forum here if the link no longer works at some point.
I downloaded the OPC UA standard project from github (https://github.com/OPCFoundation/UA-.NETStandard).
I would like to use the Reference Client there to access a Beckhoff PLC (server).
To do this, I opened the project in VS2017 and set the Reference Client as the startup project. Then I started the project with F5.
The following window opened:
Reference_Client
If I now specify the IP address and the port of my PLC (as shown above) and then click on "Connect",
the client sometimes establishes a connection to the PLC and sometimes I get the following error message:
Error_Message
In about 80% of the cases there is this error message and the client does not connect to the server.
In about 20% of the cases a connection to the server is established and I can read and write variables from the server.
I didn't change the program and it seems completely arbitrary when the connection can be established and when not.
Has anyone ever had a similar problem?
Many thanks in advance.
UPDATE 1: More detailed error message
The following screenshot shows the details of the error message. I have estimated some parts of the storage path.
Detailed_Error_Message
Please add the exception details to your post, it would be helpful to see at which place the ServiceResultException is triggered.
Thanks again for the many answers. I have been able to narrow down the cause of the problem now. I found the tip in the Github forum that you should comment out all security mechanisms:
You modify your code private static void CheckCertificateDomain(ConfiguredEndpoint endpoint) to return true always, and add AutoAcceptUntrustedCertificates true into config of the client.
This is just for developing and troubleshooting of course.
Source: Github tip
I did exactly that and then tried to connect again. I no longer receive an error message, but the operating window for OPC UA crashes. VS2017 itself does not crash, only the operating window in which the IP address can be entered and the connection can be established. When I record the network traffic with Wireshark during the crash, it can be seen that the connection (although the operating window has crashed) was successful. Data is exchanged between the client (VS2017) and the server (Beckhoff PLC).
My new approach is now to no longer use this operating window, but to write a new program. I would like to continue using the library I have used so far. The received and sent variables should then be displayed via the console.
Since this no longer has anything to do with my original question, I will make a new post for questions about this program if necessary and then add the link here.

.NET email testing client

There are times when an ASP.NET or other.NET app with System.Net.Mail.SmtpClient fails to send messages. It might be due to a recent server change, maybe the server now requires SSL, or the port changed, or it's a DNS issue, changed credentials, firewall, or new Anti-Malware definitions. Maybe the issue is specifically with GMail or AOL or another server type. To get closer to identifying the problem we can catch SmtpFailedRecipientException before SmtpException, then catch SocketException, and plain Exception last. That helps to narrow down the issue but it's still not specific enough.
I'm getting the itch to write a C# app that will allow an admin to test a number of permutations to see what works, using a table of common options as well as a UI to enter new params like port numbers or email address formats, etc. The result should be a specific result telling exactly what is wrong with the specs provided, or at least starting with "can't connect outside network", then "can't connect to remote host", or "host exists but can't connect to port", then "connected but can't authenticate", then "authenticated but 'something else failed'...".
But before I do this, I have to believe there's already some FOSS that's been written for us to build upon. Can anyone recommend such a beast? Thanks.

XML serialisation error when connecting to XMPP server

I have an instance of OpenFIre up and running and all is pretty smooth. I can connect to it via Spark as well as a variety of app.
When I wrote my app using the trial version of the Matrix SDK, the client connected perfectly. I am trying to move over to Sharp.XMPP and yet, whenever I try to connect to the server, I get the following error message :
The XML stream could not be negotiated.
When I drill down, I get to the folllwoing inner exception
{"'�', hexadecimal value 0x15, is an invalid character. Line 1,
position 1."}
There seems to be some issue with the response encoding that Sharp.XMPP is expecting.
Does anyone have any idea how to fix this?
Are you trying to connect to an old-style SSL port (usually 5223) with a client that expects to do StartTLS (usually on 5222)?
(0x15 is the TLS content type for "alert", which is likely the response when parsing something that is not TLS.)

SmtpClient get result from server on send

The SmtpClient send method returns void. Is there any way to get the server response? Do I just assume it was successful unless it throws an exception?
The class I'm referring to... http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx
To answer your second point, yes, all you can do is assume it's successful - meaning it got the message to the server and the server accepted it, unless you get an exception.
You probably already know the rest of this, but just in case...
From there, the email could get lost and not delivered any number of ways. Your server may accept it and decide not to send it, or accept it and lose power before crashing. It may get blocked by a spam filter along the way, etc.
You can think of an email as being similar to a regular piece of mail in that it passes through several hands between the sender and the recipient. From your code, you can only confirm that it got to the SMTP server you're using to send, which is similar to handing it to a teller at the post office. You don't know (or need to know) how the message is routed from there. it could be by air, ground, or carrier pigeon. You're out of the equation - you don't need to know how it gets sent, just that you trust that they know how to send it. (The same can be said for an email.)
If you need to confirm that the recipient opened it, there are ways of embedding an image in an HTML message on your server and tracking in your logs when that image is accessed, etc. (Google email tracking and email open tracking)
On the other hand...
If the server rejects it, then you do get a server response in a manner of speaking - there should be an error code and a description in the error, which you can use to troubleshoot why it didn't make it, or use error handling to try another route, etc.
You can utilize SendCompleted Event to check that your smtpclient works fine like this:
http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.sendcompleted.aspx
But you cannot get confirmation that your message reached recipient because it may stuck in any server/filter in message chain.
You assume that it was successful unless it throws... although success in this case only means that it was accepted by the mail server, anything else is then up to the server...
IF you want a little bit of control you can use SendAsync and hook the SendCompleted event...

Categories