0 Replies Latest reply on Aug 25, 2010 6:07 AM by 843851

    OpenMarket sms api gives "Connection timed out: connect"

      Hello All,

      I am new to web applications with sms services.

      I am trying to send sms from my java application to mobile device. But I am getting below error.


      Aug 25, 2010 10:55:58 AM com.eha.sms.ema.EMACMMessageSendProxy init
      INFO: Move to send the receiver initialization.
      Destination address = +**********
      Source addres = +*****
      Sending message to Simplewire...

      REQUEST XML ==
      <?xml version="1.0" ?>
      <request version="3.0" protocol="wmp" type="submit">
           <user agent="Java/SMS/2.9.16"/>
           <account id="******************" password="***************"/>
           <option type="production"/>
           <source ton="0" address="+*****"/>
           <destination ton="0" address="+**********"/>
           <message udhi="false" text="Hello World!"/>

      protocol: http
      remote host: ******Some site given to us by open market people that opens on browser**********
      remote port: 8080
      remote file: /wmp
      {main} [10:55:58.722] Conn: added module com.simplewire.http.RetryModule
      {main} [10:55:58.725] Conn: added module com.simplewire.http.AuthorizationModule
      {main} [10:55:58.726] Conn: added module com.simplewire.http.DefaultModule
      {main} [10:55:58.747] Conn: Creating Socket: smsc-01.openmarket.com:8080
      {main} [10:56:19.759] Conn: java.net.ConnectException: Connection timed out: connect
           at java.net.PlainSocketImpl.socketConnect(Native Method)
           at java.net.PlainSocketImpl.doConnect(Unknown Source)
           at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
           at java.net.PlainSocketImpl.connect(Unknown Source)
           at java.net.SocksSocketImpl.connect(Unknown Source)
           at java.net.Socket.connect(Unknown Source)
           at java.net.Socket.connect(Unknown Source)
           at java.net.Socket.<init>(Unknown Source)
           at java.net.Socket.<init>(Unknown Source)
           at com.simplewire.http.HTTPConnection$_A.run(Unknown Source)
      Message was not sent!
      Error Code: 106
      Error Description: A connection could not be established with the Simplewire network. Connection timed out: connect
      Error Resolution:


      The code I am using is as below.

      private void config()
                Properties properties = new Properties();
                InputStream smscmReceiver = EMACMMessageSendProxy.class.getClassLoader().getResourceAsStream("sms.properties");
                     SMS sms = new SMS();
                     // subscriber settings
                     sms.setRemoteHost(" ******Some site given to us by open market people that opens on browser**********");
                     // Message Settings
                     sms.setDestinationAddr(properties.getProperty("SMS.DestinationAddress").trim());          // recipient of message
                     sms.setSourceAddr(properties.getProperty("SMS.SourceAddress").trim());               // originator of message
                     sms.setMsgText("Hello World!");
                     System.out.println("Sending message to Simplewire...");

                     // submit message and check results
                     if (sms.submit())
                          System.out.println("Message was sent!");
           System.out.println("Ticket ID: " + sms.getMsgTicketID());
                          System.out.println("Message was not sent!");
                          System.out.println("Error Code: " + sms.getErrorCode());
                          System.out.println("Error Description: " + sms.getErrorDesc());
                          System.out.println("Error Resolution: " + sms.getErrorResolution() + "\n");
                } catch (IOException e)
                log.error("Load profile sms.properties failed to send Move.", e);


      I am using windows 7 and the required info from the java code is picked up from a property file.
      destination address is a "+" sign followed by cell number of client in US and I am in diff country.
      source code I am using is "+" sign followed by a short code given by client.
      I am also not aware what short codes are for.
      I am also not sure whether I am passing correct parameters.
      I just followed a demo code from the api's sample file. (open market api......swsms-2.9.16 is the jar used.).
      would like to know If destination address can be my cell number.

      The open market people have configured the demo short code for our SMS messaging account.
      This feature will allow us to test our platform to send and receive SMS messages
      while we are waiting for our dedicated short code.
      Mobile Originated messages MUST start with our assigned keyword(s) to be routed to you.

      We have a few keywords but don't know how to use them.

      Please help!

      Thanks in advance.

      Edited by: Vish_1x1 on Aug 24, 2010 11:06 PM