-
Hi people,
I am very new to webservices. I been research on webservices and i understand it is something similar to an API.
I am working on a project that require the use of an GSM Modem. Its like a generic SMS Processing Agent that anyone can use it instead of building the capability into each application that needs it.
I am using an opensource sms library called "SMSlib".
So basically i need to create a web service that allows applications to interface with the processing agent to
-retrieve sms
-send sms
-keep a transaction log of communications with other applications.
So, can someone give me an advice on what kinda of methods do i need to have in my web service inorder to achieve my goals.
Thanks
-
Please provide specific area of research where web service needs to be deployed.
thank
Ivo
-
I am looking at the oasis ws security standard and the level of the achievable security. Any ideas? I mean the organisational problems of the Oasis ws security?
-
Hi benjamin. You might have already heard of SOAP and REST webservices, these are the popular web service types. You could take a look at JAX-WS for SOAP or some open source libraries that implement like Apache Axis. Similarly for REST you might want to take a look at JAX-RS or some open source libraries that implement like Jersey.
Hope this helps you!
Thanks,
Lakshman.
-
Hi, thanks for your reply.
I have started creating my web services using NETBEANS IDE 6.7.
I do not know whether that is SOAP or REST or JAX-WS. All are very confusing.
Up to date, i have this method which actually takes in a username, password, and a keyword parameter. The keyword parameter is based on the database table which have a prefix 'app_'. For example the keyword is Quiz, it will retrieve all the records from app_Quiz.
Now I have a problem which is I want to return the records from the database. I tried returning a ResultSet but it does not allow that.
Now, i tried storing my data into an arraylist and returning it. Somehow, my client that is consuming this web services can receieve the array.
Is there any better way inwhich i can do it?
@WebMethod(operationName = "RetrieveSMS")
public ArrayList RetrieveSMS(@WebParam(name = "username") String username, @WebParam(name = "password") String password, @WebParam(name = "keyword") String keyword) {
//TODO write your implementation code here:
ArrayList list = new ArrayList();
ResultSet rs = null;
String statement=null;
try {
Connection conn = null;
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:xe", "smslib", "smslib");
Statement s = conn.createStatement();
statement = "Select * from app_"+keyword;
rs = s.executeQuery(statement);
while(rs.next())
{
String text =rs.getString("text");
list.add(text);
}
s.close();
conn.close();
} catch (Exception ex) {
ex.printStackTrace();
}
return list;
}