Problem with Payload mode
Problem with Payload mode
Hello, now I am using commercial version of your library. Version 1.0.12.5.
When I trying to send sms with Payload mode I receive following error:
************** Exception Text **************
System.ArgumentOutOfRangeException: Length too long. Shouldn't be more than 5 symbols.
Parameter name: ServiceType
at Inetlab.SMPP.PDU.SubmitSm.set_ServiceType(String value)
at Inetlab.SMPP.PDU.SubmitSm..ctor(String ServiceType, Byte SrcTon, Byte SrcNpi, String SrcAddr, Byte DestTon, Byte DestNpi, String DestAddr)
at Inetlab.SMPP.SmppClient.PrepareSubmit(SubmitMode mode, Byte srcTon, Byte srcNpi, String srcAddr, Byte destTon, Byte destNpi, String destAddr, DataCodings dataCoding, Byte[] byteArray)
at Inetlab.SMPP.SmppClient.PrepareSubmit(SubmitMode mode, Byte srcTon, Byte srcNpi, String srcAddr, Byte destTon, Byte destNpi, String destAddr, DataCodings dataCoding, String Text)
at SmppClientDemo.SmppClientDemo.bSubmit_Click(Object sender, EventArgs e) in C:\Users\PVParpura\Dropbox\Dev\Inetlab.SMPP.Developer\Demo\CS\SmppClientDemo\SmppClientDemo.cs:line 479
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
In submit mode "ShortMessage" all is working fine. But in this mode I can't send long messages (as I understood).
My params:
SubmitMode: Payload, srcTon: 0, srcNpi: 1, srcAddr: 8145, destTon: 0, destNpi: 1, destAddr: 994503312380, dataCoding: Default, Text: Test
Service Type: MC
Addr_TON: 0
Addr_NPI: 1
Use SSL: NO
What's wrong with my ServiceType? And how I can send long sms?
When I trying to send sms with Payload mode I receive following error:
************** Exception Text **************
System.ArgumentOutOfRangeException: Length too long. Shouldn't be more than 5 symbols.
Parameter name: ServiceType
at Inetlab.SMPP.PDU.SubmitSm.set_ServiceType(String value)
at Inetlab.SMPP.PDU.SubmitSm..ctor(String ServiceType, Byte SrcTon, Byte SrcNpi, String SrcAddr, Byte DestTon, Byte DestNpi, String DestAddr)
at Inetlab.SMPP.SmppClient.PrepareSubmit(SubmitMode mode, Byte srcTon, Byte srcNpi, String srcAddr, Byte destTon, Byte destNpi, String destAddr, DataCodings dataCoding, Byte[] byteArray)
at Inetlab.SMPP.SmppClient.PrepareSubmit(SubmitMode mode, Byte srcTon, Byte srcNpi, String srcAddr, Byte destTon, Byte destNpi, String destAddr, DataCodings dataCoding, String Text)
at SmppClientDemo.SmppClientDemo.bSubmit_Click(Object sender, EventArgs e) in C:\Users\PVParpura\Dropbox\Dev\Inetlab.SMPP.Developer\Demo\CS\SmppClientDemo\SmppClientDemo.cs:line 479
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
In submit mode "ShortMessage" all is working fine. But in this mode I can't send long messages (as I understood).
My params:
SubmitMode: Payload, srcTon: 0, srcNpi: 1, srcAddr: 8145, destTon: 0, destNpi: 1, destAddr: 994503312380, dataCoding: Default, Text: Test
Service Type: MC
Addr_TON: 0
Addr_NPI: 1
Use SSL: NO
What's wrong with my ServiceType? And how I can send long sms?
Re: Problem with Payload mode
Hello DerSkythe,
do you have smppClient.ServiceType property value longer than 5 symbols?
do you have smppClient.ServiceType property value longer than 5 symbols?
Re: Problem with Payload mode
Thank you for fast reply.
No, my Service Type is MC
Here is sample of code:
No, my Service Type is MC
Here is sample of code:
Code: Select all
AddToLog(
String.Format(
"Prepare message. SubmitMode: {0}, srcTon: {1}, srcNpi: {2}, srcAddr: {3}, destTon: {4}, destNpi: {5}, destAddr: {6}, dataCoding: {7}, Text: {8}",
mode,
byte.Parse(tbSrcAdrTON.Text),
byte.Parse(tbSrcAdrNPI.Text),
tbSrcAdr.Text,
byte.Parse(tbDestAdrTON.Text),
byte.Parse(tbDestAdrNPI.Text),
tbDestAdr.Text,
coding,
tbSend.Text));
List<SubmitSm> req = client.PrepareSubmit(
mode,
byte.Parse(tbSrcAdrTON.Text),
byte.Parse(tbSrcAdrNPI.Text),
tbSrcAdr.Text,
byte.Parse(tbDestAdrTON.Text),
byte.Parse(tbDestAdrNPI.Text),
tbDestAdr.Text,
coding,
tbSend.Text);
foreach (SubmitSm sm in req)
{
sm.ValidityPeriod = DateTime.Now.AddDays(2).ToString("yyMMddhhmmss000+");
sm.RegisteredDelivery = 1;
sm.ServiceType = tbServiceType.Text;
sm.PriorityFlag = 1;
}
List<SubmitSmResp> resp = client.Submit(req);
Re: Problem with Payload mode
This error can happen only when tbServiceType.Text has value longer than 5 characters. Do you have spaces in this textbox?
Re: Problem with Payload mode
I double check this field. There are no whitespaces
Re: Problem with Payload mode
what value you have in property client.ServiceType ?
Re: Problem with Payload mode
ServiceType: MC, Len: 2
Re: Problem with Payload mode
PrepareSubmit method uses client.ServiceType property. Possible we have confusing because in code you also tried to set service type directly
sm.ServiceType = tbServiceType.Text;
but error appeared before this line.
It means you should check exactly client.ServiceType, instead of tbServiceType.Text.
sm.ServiceType = tbServiceType.Text;
but error appeared before this line.
It means you should check exactly client.ServiceType, instead of tbServiceType.Text.
Re: Problem with Payload mode
Previous result generated by first string of this code.
I am tried comment string
sm.ServiceType = tbServiceType.Text;
But it doesn't give result
Code: Select all
[color=#FF0000]AddToLog(String.Format("ServiceType: {0}, Len: {1}", client.ServiceType, client.ServiceType.Length));[/color]
AddToLog(
String.Format(
"Prepare message. SubmitMode: {0}, srcTon: {1}, srcNpi: {2}, srcAddr: {3}, destTon: {4}, destNpi: {5}, destAddr: {6}, dataCoding: {7}, Text: {8}",
mode,
byte.Parse(tbSrcAdrTON.Text),
byte.Parse(tbSrcAdrNPI.Text),
tbSrcAdr.Text,
byte.Parse(tbDestAdrTON.Text),
byte.Parse(tbDestAdrNPI.Text),
tbDestAdr.Text,
coding,
tbSend.Text));
List<SubmitSm> req = client.PrepareSubmit(
mode,
byte.Parse(tbSrcAdrTON.Text),
byte.Parse(tbSrcAdrNPI.Text),
tbSrcAdr.Text,
byte.Parse(tbDestAdrTON.Text),
byte.Parse(tbDestAdrNPI.Text),
tbDestAdr.Text,
coding,
tbSend.Text);
foreach (SubmitSm sm in req)
{
sm.ValidityPeriod = DateTime.Now.AddDays(2).ToString("yyMMddhhmmss000+");
sm.RegisteredDelivery = 1;
sm.ServiceType = tbServiceType.Text;
sm.PriorityFlag = 1;
}
List<SubmitSmResp> resp = client.Submit(req);
sm.ServiceType = tbServiceType.Text;
But it doesn't give result
Re: Problem with Payload mode
I found bug in PrepareSubmit. When SubmitMode.Payload is used this method uses client.SystemType.
Re: Problem with Payload mode
I can fix this bug in 1.0.12.
But could you start to use version 1.1?
But could you start to use version 1.1?
Re: Problem with Payload mode
I bought a license on September 19. My order number: 424 640 555.
This is the standard version, without the source code (Inetlab.SMPP Client/Server Developer License).
If you give me any fixed version, I will be very thankful to you.
This is the standard version, without the source code (Inetlab.SMPP Client/Server Developer License).
If you give me any fixed version, I will be very thankful to you.
Re: Problem with Payload mode
My email: skif1ch at gmail.com