Web Services - Write Java, Promote Coldfusion
ColdfusionI have created a few web services from coldfusion for basic information that does not really affect the ROI numbers for the company but can be used to provide a better end user experience.
A good example, a web service to lookup up a user's email address from their common logon id. This has been used in several different ways but one of the best was one of the java developer's was storing the last time each user id logged into their system. If there was going to be a distruption of service or new features launched, they just add the message to a page and click send alerts. Each user that had logged into the system in the last 6 months would get an email by using the web service to look up each user's email address.
The interesting thing I discovered was more java developers than not have little experience reading in data from a web service. Our shop is mainly a java shop with coldfusion as the small to medium jobs. The perception, for whatever reason, is web services created by coldfusion can only be used by coldfusion. The coldfusion guys don't have much java experience so when they are asked how do I, a java developer, access that web service they are like cfinvoke and the java developer says thats cool and never uses it. The point I am trying to get to is, knowing more than coldfusion could have promoted coldfusion. In this situation, instead of the attitude of switch and come over to the coldfusion side, knowing a little java can help with the promotion of coldfusion's ability to create web services.
To try and help anyone who might recognize the situation above, I included a snippet of Java code I wrote to demonstrate how to read in a simple coldfusion web service. Please feel free to use it to demonstrate to java devevlopers how they can take advantage of web services created in coldfusion.
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import javax.xml.rpc.ParameterMode;
public class WSClient {
public static void main(String [] args) throws Exception {
String endpoint = "http://server/webserviceurl.cfc?wsdl";
// Make the call
Service service = new Service();
Call call = (Call) service.createCall();
String i1 = "loginID";
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("getEmailAddress");
call.addParameter("euid", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.XSD_STRING);
String ret = (String) call.invoke( new Object [] { i1 });
System.out.println("Got result : " + ret);
}
}



Loading....