Web services samples
The web services samples provide a list of web services for the IBM® Product Master.
The following sample web services are provided in the Samples\webservices\ directory on the product CD:
Search web services
String search(String wql, Context wsContext)
- This service returns a string of xml representation for the search result set by the search query in WQL language.
Product web services
Item createItem(Item item, Context wsContext)
- If you create an Item with as many attributes per the business requirement, this service creates a new item from the data provided. As an input, the Item object must include container name, primary key value, and display name.
Item updateItem(Item item, Context wsContext)
- This service updates an existing item by the data provided. As an input, the Item object must include container name and primary key value.
Item getItem(Item item, Context wsContext)
- If the Item object returns all of the attributes or returns only
primaryKey
anddisplayName
, this service retrieves an existing item from the system. As an input, the Item object must include container name and primary key value. void deleteItem(Item item, Context wsContext)
- This service creates an item from the data provided. As an input, an Item object can include container name and primary key value.
Scheduler web services
Report createReport(Report report, Context wsContext)
- This service creates a Product Master Server Report
job from the web service Report object that is passed to the service
call. To start this operation, the following arguments on the Report object must exist and be valid in Product Master Server:
- reportScriptFileName, path to the report script
- inputSpecName, name of the script input spec
- distributionName, distribution name to be associated with the Report
Schedule createSchedule(Schedule schedule, Context wsContext)
- A Product Master Server Schedule
is created for the Job associated with the schedule. For this operation to be successful, the following parameters should be valid:
- Job.name, valid job name existing in Product Master Server; currently, Product Master Server Job.name is the same as job description.
- Schedule.type, type of the schedule to be
created; can take one of the following values:
- IMMEDIATE = 0
- ONE_TIME = 1
- MINUTE = 2
- HOURLY = 3
- DAILY = 4
- WEEKLY = 5
- MONTHLY = 6
- YEARLY = 7
- Schedule.startTime, if the schedule type is other than IMMEDIATE, a start time is required to indicate when the schedule is to be run.
- Schedule.intervalMinutes, If the schedule type is MINUTE, intervalMinutes need to be set. The schedule runs at the interval of the minutes.
String getScheduleStatus(Schedule schedule, Context wsContext)
- Currently, the Java™ API does not display a schedule ID. So, the schedule is fetched based on the schedule name and a start date. Also, the job that is associated with the schedule should have a valid description. If the schedule completes running, the status of its completion is returned to the caller. If the schedule is running, the percentage completion of the schedule is returned.
void stopSchedule(Schedule schedule, Context wsContext)
- The schedule is fetched using the schedule name and a start date and the associated job description.
Job getJob(Job job, Context wsContext)
- The corresponding Product Master Server job is fetched using the object description. The new Job object corresponding to the retrieved Product Master Server job is returned to the caller.
Collection<job> getAllJobs(Context wsContext)
- This operation takes in Context and returns all jobs currently in the system.
Collection<Schedule> getAllSchedules(Job job, Context wsContext)
- This service returns all associated schedules for the Job. The input takes in a web service Job, which needs to have a valid description.