OverflowException on the Submit method

.NET library for SMPP protocol
Locked
Maklaud
Posts: 4
Joined: Wed Sep 16, 2015 3:03 pm

OverflowException on the Submit method

Post by Maklaud » Wed Sep 16, 2015 3:09 pm

Hi All!
We are using your lib to send sms to our clients. Today we met a terrible problem. When we call the SubmitSmResp Submit(SubmitSm pdu) method our service crashes totally.
We investigated it and found out that the problem is in sms longer than 127 symbols. 127 symbols sms is ok.

Then we found this - http://www.inetlab.com/support/alt-sms- ... 28-15.html
This is a part of that link - My SMSC takes 7bit encoding with 8 bit characters (the 8th bit is always 0). As far as I know this is standard.

Maybe that's the reason? We can see that our sms is byte[] here -
sm.UserDataPdu.ShortMessage = client.GetMessageBytes(text, DataCodings.UCS2);

So we just guess - maybe somewhere in your lib you convert byte[] to sbyte[] and this throws our exception?

Please help us to solve the problem. We spent almost the whole day on it.
Thanks!
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Re: OverflowException on the Submit method

Post by alt » Wed Sep 16, 2015 3:30 pm

Hi Maklaud,

Could please post whole Stack trace for this excaption?
Which version do you use?
Maklaud
Posts: 4
Joined: Wed Sep 16, 2015 3:03 pm

Re: OverflowException on the Submit method

Post by Maklaud » Thu Sep 17, 2015 4:43 am

We don't have a stack, because our service just crashes. If I debug it, I have the following:

System.OverflowException was unhandled
Message: An unhandled exception of type 'System.OverflowException' occurred in mscorlib.dll
Additional information: Value was either too large or too small for an unsigned byte.

Our version is 1.1.20.0.
Maklaud
Posts: 4
Joined: Wed Sep 16, 2015 3:03 pm

Re: OverflowException on the Submit method

Post by Maklaud » Thu Sep 17, 2015 5:24 am

I found some kind of stack in the system event viewer.

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OverflowException
Stack:
at System.Convert.ToByte(Int32)
at Inetlab.SMPP.PDU.SubmitSm.wVmyuruuum()
at Inetlab.SMPP.PDU.SubmitSm.GetBytes()
at Inetlab.SMPP.Common.SmppClientBase.FxBqrYuCi9(Inetlab.SMPP.PDU.SmppPDU)
at Inetlab.SMPP.Common.SmppClientBase+<>c__DisplayClasse.<SendRequest>b__d()
at H5DLYRNIe8vB72gie9.J4LTaA6faRlky948j9.CSH6GcTXEv()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
Maklaud
Posts: 4
Joined: Wed Sep 16, 2015 3:03 pm

Re: OverflowException on the Submit method

Post by Maklaud » Thu Sep 17, 2015 1:50 pm

Maybe we solved the problem. We started to use another api and filled headers (didn't do that before).
Now we can send long messages well.
Locked