Charu,
I downloaded the latest ALL version of the JSMPP project from
http://jsmpp.googlecode.com/files/jsmpp-2.1.0-all.zipI ran this project in Eclipse and it worked
** The key is open the main folder jsmpp-2.1.0 in Eclipse with use existing sources option in the New Java project wizard
with regards
Tushar
==============================================
Tushar Joshi, Nagpur
MCSD_NET C#, SCJP, RHCE, ZCE, PMP
Software Architect @ Infospectrum India Private Limited, JUGNagpur Leader
http://www.info-spectrum.comhttp://www.tusharvjoshi.com
http://www.jugnagpur.com
On Wed, Jul 21, 2010 at 8:40 AM, Charudatta Joshi
<itis...@gmail.com> wrote:
Hi,
I have to use jsmpp to send a message.
here is the link of homne page
http://code.google.com/p/jsmpp/
SO I'm trying to test the sample exqamples provided on the home page of jsmpp.
Now when I try to compile ist example I get following message.
There is no ample documentation available for me to understand the error or to findout which is another constructor
available for " GeneralDataCoding" class. the example I'm trying to compile is
SimpleSubmitExample.java
I have included all the jars of jsmpp and its dependencies in the classpath,
funny part is my compiler is able to find all other classes from the "org.jsmpp.bean." package but
not able to find " GeneralDataCoding" class's constructor.
I would like to thank you for the help in advance.
Following is my error message,
==========================================================================================
D:\java sms\sms\SimpleSubmitExample.java:41: cannot find symbol
symbol : constructor GeneralDataCoding(org.jsmpp.bean.Alphabet,org.jsmpp.bean.MessageClass,boolean)
location: class org.jsmpp.bean.GeneralDataCoding
String messageId = session.submitShortMessage("CMT", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "1616", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "628176504657", new ESMClass(), (byte)0, (byte)1, timeFormatter.format(new Date()), null, new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0, new GeneralDataCoding(Alphabet.ALPHA_DEFAULT,
^
MessageClass.CLASS1,false), (byte)0, "jSMPP simplify SMPP on Java platform".getBytes());
1 error
Tool completed with exit code 1
==========================================================================================
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
This is the code I'm trying to compile.
===========================
package org.jsmpp.examples;
import java.io.IOException;
import java.util.Date;
import org.jsmpp.InvalidResponseException;
import org.jsmpp.PDUException;
import org.jsmpp.bean.Alphabet;
import org.jsmpp.bean.BindType;
import org.jsmpp.bean.ESMClass;
import org.jsmpp.bean.GeneralDataCoding;
import org.jsmpp.bean.MessageClass;
import org.jsmpp.bean.NumberingPlanIndicator;
import org.jsmpp.bean.RegisteredDelivery;
import org.jsmpp.bean.SMSCDeliveryReceipt;
import org.jsmpp.bean.TypeOfNumber;
import org.jsmpp.extra.NegativeResponseException;
import org.jsmpp.extra.ResponseTimeoutException;
import org.jsmpp.session.BindParameter;
import org.jsmpp.session.SMPPSession;
import org.jsmpp.util.AbsoluteTimeFormatter;
import org.jsmpp.util.TimeFormatter;
/**
* @author uudashr
*
*/
public class SimpleSubmitExample {
private static TimeFormatter timeFormatter = new AbsoluteTimeFormatter();;
public static void main(String[] args) {
SMPPSession session = new SMPPSession();
try {
session.connectAndBind("localhost", 8056, new BindParameter(BindType.BIND_TX, "test", "test", "cp", TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, null));
} catch (IOException e) {
System.err.println("Failed connect and bind to host");
e.printStackTrace();
}
try {
String messageId = session.submitShortMessage("CMT", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "1616", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "628176504657", new ESMClass(), (byte)0, (byte)1, timeFormatter.format(new Date()), null, new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0, new GeneralDataCoding(Alphabet.ALPHA_DEFAULT, MessageClass.CLASS1,false), (byte)0, "jSMPP simplify SMPP on Java platform".getBytes());
System.out.println("Message submitted, message_id is " + messageId);
} catch (PDUException e) {
// Invalid PDU parameter
System.err.println("Invalid PDU parameter");
e.printStackTrace();
} catch (ResponseTimeoutException e) {
// Response timeout
System.err.println("Response timeout");
e.printStackTrace();
} catch (InvalidResponseException e) {
// Invalid response
System.err.println("Receive invalid respose");
e.printStackTrace();
} catch (NegativeResponseException e) {
// Receiving negative response (non-zero command_status)
System.err.println("Receive negative response");
e.printStackTrace();
} catch (IOException e) {
System.err.println("IO error occur");
e.printStackTrace();
}
session.unbindAndClose();
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Later I will be using this code in a servlet,
If any tips regarding using this process in a servlet are given it would be really nice,
Thank You,
Regards,--
Charudatta.M.Joshi
--
---------------------------------------------------------------------------------------------------------------
Java User Group Nagpur
Home Page: http://www.jugnagpur.com
Blog: http://jugnagpur.blogspot.com
Wiki: http://jugnagpur.wikispaces.com/
Project Page: https://jugnagpur.dev.java.net/
---------------------------------------------------------------------------------------------------------------
You received this message because you are subscribed to JUGNagpur group.
To post to this group, send email to jugn...@googlegroups.com
To unsubscribe from this group, send email to
jugnagpur+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/jugnagpur?hl=en