• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Urgent: Socket problem when calling java function from Web Page

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks!
I have found a java program that sends SMS (text message) alerts to mobile phones. Now, when I run this program on its own (i.e. through a main method), there are no problems. The message is sent correctly and the result code, indicating whether or not the message was sent and if not, why not is returned.
However, when I try and call the 'sendSMS' method from an ASP page, (by saving the class file in the c:\Windows\Java\Trustlib directory) the program fails with an UnknownHostException error at the line:
Socket socket= new Socket(ADDRESS, PORT);
The strange thing is this only happens on certain machines. On other machines, the data is sent okay. Does anyone know why this is and if so, how I can go about correcting this?
Thanks in advance,
Sean
p.s. If anyone would like the java program I would be more than happy to supply it.
[This message has been edited by Sean McGurk (edited June 06, 2001).]
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
I think the problem is with the "ADDRESS" part and the Network status of the machines which are not running the Code successfully...
I am not sure but a rational guess....
I think more details may help you
cheers
Srikanth

Originally posted by Sean McGurk:
Hi folks!
I have found a java program that sends SMS (text message) alerts to mobile phones. Now, when I run this program on its own (i.e. through a main method), there are no problems. The message is sent correctly and the result code, indicating whether or not the message was sent and if not, why not is returned.
However, when I try and call the 'sendSMS' method from an ASP page, (by saving the class file in the c:\Windows\Java\Trustlib directory) the program fails with an UnknownHostException error at the line:
Socket socket= new Socket(ADDRESS, PORT);
The strange thing is this only happens on certain machines. On other machines, the data is sent okay. Does anyone know why this is and if so, how I can go about correcting this?
Thanks in advance,
Sean
p.s. If anyone would like the java program I would be more than happy to supply it.
[This message has been edited by Sean McGurk (edited June 06, 2001).]


reply
    Bookmark Topic Watch Topic
  • New Topic