SubmitSM problem

.NET library for SMPP protocol
Locked
prog019
Posts: 44
Joined: Mon Mar 02, 2009 2:12 pm

SubmitSM problem

Post by prog019 » Tue Aug 28, 2012 6:39 am

Dear Alt,

I'm trying to use SubmitSm:

SubmitSm req = new SubmitSm(null,
srcAdrTON,
tbSrcAdrNPI,
srcAddr,
tbDestAdrTON,
tbDestAdrNPI,
dstAddr);
req.DataCoding = coding;
req.ShortMessage = messageText;
......

I get exception "Object reference is null ..." and I found the problem:

Dear Alt,
In SubmitSM class, in ShortMessage property you are using following code:

...ShortMessage = Client.GetMessageBytes(value, this.DataCoding);

And here "Client" == NULL

Please assist, how use SubmitSm?

Thanks in advance.
prog019
Posts: 44
Joined: Mon Mar 02, 2009 2:12 pm

Re: SubmitSM problem

Post by prog019 » Thu Aug 30, 2012 4:43 am

Dear Alt,

Please reply.
alt
Site Admin
Posts: 918
Joined: Tue Apr 25, 2006 9:45 am

Re: SubmitSM problem

Post by alt » Thu Sep 13, 2012 11:44 am

When you build SubmitSm you can send text in User Data or in MessagePayload TLV parameter.

sm.UserDataPdu.ShortMessage = byteArray;

or

sm.Optional.AddMessagePayload(byteArray);
Locked