Create Complex Web Services in Maximo
Hello;
As you know there are standart web services in Maximo for WORKORDER,TICKET, etc.. You can change status of a ticket or workorder or something else with these web services..
But sometimes these web services are not enough. For example assume you want to calculate some data in Maximo according to that you will assign workorder to a user then change the status of workorder.
In this case, you can create your own web services with a couple lines of code…
First of all, you should extend Maximo Service Class (for WORKORDER example com.ibm.ism.pmcom.PmComWOService (in my case), for you this class can be psdi.app.workorder.WOService)
You can learn which class to extend from Database Configuration.
Go to Database Configuration.
Click Select Action Menu and find the service you want to extend. (You can create your own services here)
Then open eclipse and here is the code:)
package custom.services; import java.rmi.RemoteException; import javax.jws.WebMethod; import psdi.iface.webservices.action.WSMboKey; import psdi.server.MXServer; import psdi.util.MXException; import com.ibm.ism.pmcom.PmComWOService; import custom.app.workorder.WOExtRemote; public class WOService extends PmComWOService { /** * */ private static final long serialVersionUID = -157829023628868467L; public WOService() throws RemoteException { super(); // TODO Auto-generated constructor stub } //WOService(MXServer mxServer) method must exist, otherwise service does not start public WOService(MXServer mxServer) throws RemoteException { super(mxServer); // TODO Auto-generated constructor stub } @WebMethod public void testWebService(){ System.out.println("Hello Maximo Web Services()"+getURL()); } //Don't forget @WebMethod annotations.. @WebMethod public void testWebService2(@WSMboKey("WORKORDER") WOExtRemote wo,String owner) throws RemoteException, MXException{ System.out.println("Hello Maximo Web Services2()"); wo.setValue("OWNER", owner); } }
Now deploy code then write your own class in Database Configuration.. Then Restart..
Deploy Web Services.. (If deployed, undeploy and deploy..)
Now you can see your new methods in WSDL and you can try your new web services…
Have a good day….
August 25th, 2011 at 10:57 am
Hello
thanks for this very interesting post.
I have a question: where do you say to maximo not to use the original class but the extended one? Is it in the Database Configuration -> Select Action -> Services?
Thanks!
August 25th, 2011 at 12:14 pm
Hi! you are correct, you can enter new classname in the services window
September 1st, 2011 at 5:05 am
Hi,
If you just add a normal method, you can still create a webservice out of it as maximo has three types of webservices
1) Based on Object Structures
2) Basedo n emterprise service
3) Based on maximo service class
Any new method is a service in a service class.
September 18th, 2011 at 11:58 am
Hello;
Yes, you can use predefined webservices like Object structure, Enterprise Servce or Standart Services,
But if you don’t mention @WebMethod in Service class, maximo does not get it as a web service..
Have a good day..