Object Reference not set to an instance (ServiceType)

Smpp v3.4 client

Moderator: alt

Locked
crg1970
Posts: 6
Joined: Wed Jul 16, 2008 5:48 pm
Location: Panama

Object Reference not set to an instance (ServiceType)

Post by crg1970 » Wed Jul 16, 2008 9:56 pm

I am trying to send a message with the demo code. All I did was recompile it. I don't believe I changed anything (compiled it using VS 2008).

Connect now works fine, with the response being:

SmppClient connected
Binding SmppClient for SystemId: portalmms
Sending Data: 0000002c00000009000000003fbff01a706f7274616c6d6d7300396f3774346c6d6d00736d70700034020100
SmppClient bound
Bind result : sytem is 1 with status ESME_ROK
Received Data: 0000001780000009000000003fbff01a31000210000134



But when I try to submit using ShortMessage mode, I get a JIT Debugging window, stating :

System.NullReferenceException: Object reference not set to an instance of an object.
at ALT.SMS.SubmitSm.set_ServiceType(String value)
at ALT.SMS.SubmitSm..ctor(String ServiceType, Byte SrcTon, Byte SrcNpi, String SrcAddr, Byte DestTon, Byte DestNpi, String DestAddr)
at ALT.SMS.SmppClient.SubmitText(SubmitMode mode, Byte SrcTon, Byte SrcNpi, String SrcAddr, Byte DestTon, Byte DestNpi, String DestAddr, DataCodings data_coding, String Text)
at ALT.SMS.ALT.SMS.SmppClientDemo.bSubmit_Click(Object sender, EventArgs e) in C:\Users\carlos\Desktop\Portal MMS\SMPP\VBNet\SmppClientDemo.vb:line 728

I don't get this error with Payload mode, but my carrier doesn't support it and subsequently I get I timeout.
at System.Windows.Forms.Control.OnClick(EventArgs e)
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Post by alt » Thu Jul 17, 2008 5:46 am

Fixed. Please download last version.
crg1970
Posts: 6
Joined: Wed Jul 16, 2008 5:48 pm
Location: Panama

Re. Object Reference

Post by crg1970 » Thu Jul 17, 2008 9:13 pm

Thanks, the new version does the trick.

Another quick question, I keep getting a TIMEOUT when using the submit and the Disconnect functions. My carrier says I need to set a flag called something like Register Delivered. Is there anyway I can do that? Would that parameter affect the Unbind functions (since I also get a timeout when I try to disconnect).

Thanks.
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Post by alt » Fri Jul 18, 2008 6:29 am

The registered_delivery parameter of the submit_sm PDU is used to request an SMSC delivery receipt and/or SME originated acknowledgements. This parameter does not affect the Unbind function.
In the last version Unbind timeout was fixed. If this problem still exists for you, please send me your log with sent and received data.
ankur
Posts: 1
Joined: Wed Mar 09, 2011 5:02 am

Re: Object Reference not set to an instance (ServiceType)

Post by ankur » Wed Mar 09, 2011 5:10 am

Hi,

I am using this function to unbind the client.
But i am getting Error -"Object Reference not set to an instance "
on the line - ubtrp = objclient.UnBind()

Private Shared Sub UnBind(ByVal objclient As SmppClient)
Dim ubtrp As pduUnBindResp
ubtrp = objclient.UnBind()
Select Case ubtrp.Status
Case CommandStatus.ESME_ROK
Exit Select
Case Else
objclient.Disconnect()
Exit Select
End Select
End Sub

But when i am trying to do the same process by using line by line debugging
there is no error.
Can you please give me some idea to recover it.
Locked