MazWoz / jsmpp

Automatically exported from code.google.com/p/jsmpp
Apache License 2.0
0 stars 0 forks source link

SubmitMulti example #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Dears

Would you please show me an example of how to use submit_multi PDU actually
I have problem in initializing DestinationAddress

DestinationAddress[] DEFAULT_DESTADDR=new
DestinationAddress(TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.ISDN,
"960504375312");

String messageId1= session.submitMultiple("CMT",
TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.ISDN, "54321", 
                            DEFAULT_DESTADDR, 
                            new ESMClass(), (byte)0, (byte)0, 
                            null, null, new RegisteredDelivery(0), 
                            (byte)0, 
                            new GeneralDataCoding(false, true,
MessageClass.CLASS1, Alphabet.ALPHA_DEFAULT), 
                            (byte)0, "test submit multi".getBytes());

I got those errors when I compiled

D:\Program Files\Xinox
Software\JCreatorV4\MyProjects\JSMPP\src\SimpleSubmitExample.java:63:
org.jsmpp.bean.DestinationAddress is abstract; cannot be instantiated
          DestinationAddress[] DEFAULT_DESTADDR=new
DestinationAddress(TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.ISDN,
"966504375312");//[1];
                                                ^
D:\Program Files\Xinox
Software\JCreatorV4\MyProjects\JSMPP\src\SimpleSubmitExample.java:68:
submitMultiple(java.lang.String,org.jsmpp.bean.TypeOfNumber,org.jsmpp.bean.Numbe
ringPlanIndicator,java.lang.String,org.jsmpp.bean.Address[],org.jsmpp.bean.ESMCl
ass,byte,byte,java.lang.String,java.lang.String,org.jsmpp.bean.RegisteredDeliver
y,org.jsmpp.bean.ReplaceIfPresentFlag,org.jsmpp.bean.DataCoding,byte,byte[],org.
jsmpp.bean.OptionalParameter[])
in org.jsmpp.session.SMPPSession cannot be applied to
(java.lang.String,org.jsmpp.bean.TypeOfNumber,org.jsmpp.bean.NumberingPlanIndica
tor,java.lang.String,org.jsmpp.bean.DestinationAddress[],org.jsmpp.bean.ESMClass
,byte,byte,<nulltype>,<nulltype>,org.jsmpp.bean.RegisteredDelivery,byte,org.jsmp
p.bean.GeneralDataCoding,byte,byte[])
           String messageId1= session.submitMultiple("CMT",
TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.ISDN, "54321", 
                                     ^
2 errors
Thanks a lot

Original issue reported on code.google.com by aelousf...@gmail.com on 28 Mar 2009 at 11:44

GoogleCodeExporter commented 8 years ago
Its not an error. For first error, you need to use org.jsmpp.bean.Address class 
instead of org.jsmpp.bean.DestinationAddress.

Use this signature SubmitMultiResult result = session.submitMultiple("CMT", 
TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "1616",
                                                        addresses, new ESMClass(), 
(byte)0, (byte)1, timeFormatter.format(new Date()), null,
                                                        new 
RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), ReplaceIfPresentFlag.REPLACE,
                                                        new 
GeneralDataCoding(Alphabet.ALPHA_DEFAULT, MessageClass.CLASS1, false), (byte)0,
                                                        "jSMPP simplify SMPP on Java 
platform".getBytes());

Original comment by paliwala...@gmail.com on 8 Aug 2009 at 1:15