i've added an authenticator class

import java.net.PasswordAuthentication;
public class SimpleProxyAuthenticator extends java.net.Authenticator{
        private String username;
        private String password;

public SimpleProxyAuthenticator(String username, String password){
        this.username = username;
        this.password = password;
        }
protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(this.username,
this.password.toCharArray());
        }
}

and added the below line before in the SendMessage example...
Authenticator.setDefault(new SimpleProxyAuthenticator("username" ,
"pwd"));

Messages can be sent now using SendMessage example.
but i dont know why this is to be done...

On Mar 13, 9:08 am, venu <[email protected]> wrote:
> i've tested by entering the same URL in my browser, the message was
> sent.
> but, i could not send through my application... what can be the
> reason.
> same is the case with clickatell gateway...
>
> On Mar 13, 2:48 am, "T.Delenikas" <[email protected]> wrote:
>
>
>
>
>
>
>
> > Are you sure your proxy is working ok?
>
> > -- Server returned HTTP response code: 407 for URL
>
> > On Monday, March 12, 2012 12:36:42 PM UTC+2, venu wrote:
>
> > > am trying to send message with the free credits i've got from bulksms.
> > > any problem with that?
> > > i've removed the gateway.querybalance() function and tested again
> > > this time the output is
>
> > > Example: Send message from BulkSMS HTTP Interface.
> > > SMSLib: A Java API library for sending and receiving SMS via a GSM
> > > modem or other supported gateways.
> > > This software is distributed under the terms of the Apache v2.0
> > > License.
> > > Web Site:http://smslib.org
> > > Version: 3.5.1
> > > 0      2012-03-12 16:07:33,605 [main] INFO  org.smslib.Service  -
> > > SMSLib: A Java API library for sending and receiving SMS via a GSM
> > > modem or other supported gateways.
> > > This software is distributed under the terms of the Apache v2.0
> > > License.
> > > Web Site:http://smslib.org
> > > 2      2012-03-12 16:07:33,607 [main] INFO  org.smslib.Service  -
> > > Version: 3.5.1
> > > 2      2012-03-12 16:07:33,607 [main] INFO  org.smslib.Service  - JRE
> > > Version: 1.6.0_21
> > > 3      2012-03-12 16:07:33,608 [main] INFO  org.smslib.Service  - JRE
> > > Impl Version: 17.0-b17
> > > 3      2012-03-12 16:07:33,608 [main] INFO  org.smslib.Service  - O/S:
> > > Windows 7 / x86 / 6.1
> > > 5      2012-03-12 16:07:33,610 [main] DEBUG
> > > org.smslib.threading.AServiceThread  - Initialized.
> > > 6      2012-03-12 16:07:33,611 [NotifyQueueManager] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 6      2012-03-12 16:07:33,611 [NotifyQueueManager] DEBUG
> > > org.smslib.notify.NotifyQueueManager$NotificationQueueManager  -
> > > NotifyQueueManager running...
> > > 7      2012-03-12 16:07:33,612 [main] INFO
> > > org.smslib.queues.DefaultQueueManager  - Queue directory not defined.
> > > Queued messages will not be saved to filesystem.
> > > 7      2012-03-12 16:07:33,612 [main] DEBUG
> > > org.smslib.threading.AServiceThread  - Initialized.
> > > 8      2012-03-12 16:07:33,613 [DelayQueueManager] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 8      2012-03-12 16:07:33,613 [DelayQueueManager] DEBUG
> > > org.smslib.queues.AbstractQueueManager$DelayQueueManager  -
> > > DelayQueueManager running...
> > > 8      2012-03-12 16:07:33,613 [main] DEBUG
> > > org.smslib.threading.AServiceThread  - Initialized.
> > > 9      2012-03-12 16:07:33,614 [WatchDog] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 9      2012-03-12 16:07:33,614 [Thread-4] INFO
> > > org.smslib.http.BulkSmsHTTPGateway  - GTW: bulksms.http.1: Starting
> > > gateway.
> > > 10     2012-03-12 16:07:33,615 [NotifyQueueManager] DEBUG
> > > org.smslib.notify.NotifyQueueManager$NotificationQueueManager  -
> > > NotifyQueueManager end...
> > > 11     2012-03-12 16:07:33,616 [Thread-4] DEBUG
> > > org.smslib.threading.AServiceThread  - Initialized.
> > > 13     2012-03-12 16:07:33,618 [QueueManager [bulksms.http.1]] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 112    2012-03-12 16:07:33,717 [NotifyQueueManager] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 112    2012-03-12 16:07:33,717 [NotifyQueueManager] DEBUG
> > > org.smslib.notify.NotifyQueueManager$NotificationQueueManager  -
> > > NotifyQueueManager running...
> > > 112    2012-03-12 16:07:33,717 [NotifyQueueManager] DEBUG
> > > org.smslib.notify.NotifyQueueManager$NotificationQueueManager  -
> > > NotifyQueueManager end...
> > > 212    2012-03-12 16:07:33,817 [NotifyQueueManager] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 212    2012-03-12 16:07:33,817 [NotifyQueueManager] DEBUG
> > > org.smslib.notify.NotifyQueueManager$NotificationQueueManager  -
> > > NotifyQueueManager running...
> > > 513    2012-03-12 16:07:34,118 [QueueManager [bulksms.http.1]] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 1013   2012-03-12 16:07:34,618 [QueueManager [bulksms.http.1]] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 1053   2012-03-12 16:07:34,658 [main] INFO
> > > org.smslib.http.HTTPGateway  - GTW: bulksms.http.1: HTTP POST:
> > >http://bulksms.vsms.net:5567/eapi/submission/send_sms/2/2.0
> > > 1069   2012-03-12 16:07:34,674 [main] WARN  org.smslib.Service  -
> > > sendMessage(): Gateway bulksms.http.1 throws IO errors, marking for
> > > restart.
>
> > > ===============================================================================
>
> > > << OutboundMessage >>
> > > -------------------------------------------------------------------------------
>
> > >  Gateway Id: *
> > >  Message Id: 0
> > >  Message UUID: 88826544-b330-446a-9487-5398d4777688
> > >  Encoding: 7-bit
> > >  Date: Mon Mar 12 16:07:34 IST 2012
> > >  SMSC Ref No:
> > >  Recipient: +919652062062
> > >  Dispatch Date: null
> > >  Message Status: FAILED
> > >  Failure Cause: GATEWAY_FAILURE
> > >  Validity Period (Hours): -1
> > >  Status Report: false
> > >  Source / Destination Ports: -1 / -1
> > >  Flash SMS: false
> > >  Text: Hello
> > >  PDU data: C8329BFD06
> > >  Scheduled Delivery: null
> > > ===============================================================================
>
> > > Now Sleeping - Hit <enter> to terminate.
> > > 1075   2012-03-12 16:07:34,680 [NotifyQueueManager] DEBUG
> > > org.smslib.notify.NotifyQueueManager$NotificationQueueManager  -
> > > NotifyQueueManager end...
> > > 1175   2012-03-12 16:07:34,780 [NotifyQueueManager] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 1175   2012-03-12 16:07:34,780 [NotifyQueueManager] DEBUG
> > > org.smslib.notify.NotifyQueueManager$NotificationQueueManager  -
> > > NotifyQueueManager running...
> > > 1513   2012-03-12 16:07:35,118 [QueueManager [bulksms.http.1]] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 2013   2012-03-12 16:07:35,618 [QueueManager [bulksms.http.1]] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 2513   2012-03-12 16:07:36,118 [QueueManager [bulksms.http.1]] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
>
> > > 2729   2012-03-12 16:07:36,334 [DelayQueueManager] DEBUG
> > > org.smslib.queues.AbstractQueueManager$DelayQueueManager  -
> > > DelayQueueManager end...
> > > 2930   2012-03-12 16:07:36,535 [WatchDog] DEBUG
> > > org.smslib.threading.AServiceThread  - Stopped.
> > > 2930   2012-03-12 16:07:36,535 [main] INFO
> > > org.smslib.http.BulkSmsHTTPGateway  - GTW: bulksms.http.1: Stopping
> > > gateway.
> > > 2930   2012-03-12 16:07:36,535 [NotifyQueueManager] DEBUG
> > > org.smslib.notify.NotifyQueueManager$NotificationQueueManager  -
> > > NotifyQueueManager end...
> > > 2930   2012-03-12 16:07:36,535 [QueueManager [bulksms.http.1]] DEBUG
> > > org.smslib.threading.AServiceThread  - Stopped.
> > > 3030   2012-03-12 16:07:36,635 [NotifyQueueManager] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 3030   2012-03-12 16:07:36,635 [NotifyQueueManager] DEBUG
> > > org.smslib.notify.NotifyQueueManager$NotificationQueueManager  -
> > > NotifyQueueManager running...
> > > 3030   2012-03-12 16:07:36,635 [NotifyQueueManager] DEBUG
> > > org.smslib.notify.NotifyQueueManager$NotificationQueueManager  -
> > > NotifyQueueManager end...
> > > 3130   2012-03-12 16:07:36,735 [NotifyQueueManager] DEBUG
> > > org.smslib.threading.AServiceThread  - Running...
> > > 3130   2012-03-12 16:07:36,735 [NotifyQueueManager] DEBUG
> > > org.smslib.notify.NotifyQueueManager$NotificationQueueManager  -
> > > NotifyQueueManager running...
> > > 3130   2012-03-12 16:07:36,735 [NotifyQueueManager] DEBUG
> > > org.smslib.threading.AServiceThread  - Stopped.
> > > On Mar 12, 3:25 pm, venu <[email protected]> wrote:
> > > > Iam not able to send messages using bulksms gateway example...
> > > > my pc is connected to internet through a proxy server...
> > > > i've given my proxy server details as system properties
> > > > Properties systemProperties = System.getProperties();
> > > >                 systemProperties.setProperty( "http.proxyHost",
> > > "myproxy" );
> > > >                 systemProperties.setProperty( "http.proxyPort",
> > > "myproxyport" );
> > > >                 systemProperties.setProperty( "http.userName",
> > > "username" );
> > > >                 systemProperties.setProperty( "http.password1",
> > > "password" );
>
> > > > Here is my log:
>
> > > > Example: Send message from BulkSMS HTTP Interface.
> > > > SMSLib: A Java API library for sending and receiving SMS via a GSM
> > > > modem or other supported gateways.
> > > > This software is distributed under the terms of the Apache v2.0
> > > > License.
> > > > Web Site:http://smslib.org
> > > > Version: 3.5.1
> > > > 0      2012-03-12 14:46:21,238 [main] INFO  org.smslib.Service  -
> > > > SMSLib: A Java API library for sending and receiving SMS via a GSM
> > > > modem or other supported gateways.
> > > > This software is distributed under the terms of the Apache v2.0
> > > > License.
> > > > Web Site:http://smslib.org
> > > > 3      2012-03-12 14:46:21,241 [main] INFO  org.smslib.Service  -
> > > > Version: 3.5.1
> > > > 3      2012-03-12 14:46:21,241 [main] INFO  org.smslib.Service  - JRE
> > > > Version: 1.6.0_21
> > > > 4      2012-03-12 14:46:21,242 [main] INFO  org.smslib.Service  - JRE
> > > > Impl Version: 17.0-b17
> > > > 4      2012-03-12 14:46:21,242 [main] INFO  org.smslib.Service  - O/S:
> > > > Windows 7 / x86 / 6.1
> > > > 6      2012-03-12 14:46:21,244 [main] DEBUG
> > > > org.smslib.threading.AServiceThread  - Initialized.
> > > > 6
>
> ...
>
> read more »

-- 
You received this message because you are subscribed to the Google Groups 
"SMSLib Discussion Group" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/smslib?hl=en.

Reply via email to