We upgraded to UCMDB 8 and it works with that version just fine.
You can download it from the following link
It's an eclipse project but you can easily rebuild it using ant (just unzip the zip file then run 'ant' inside the UCMDBWebServiceClient folder.. If you don't want to rebuild the binary in the dist/UCMDBWebServiceClient.jar - you can use it as is, just read the /docs/README.txt to figure out the jar file dependecies for CXF 2.1.4 (alot less than AXIS 2).
here's an example
Code:
package com.theintegrationzone.ucmdb.client.sample;
import javax.xml.ws.BindingProvider;
import com.hp.schemas.ucmdb.client.params.update.AddCIsAndRelations;
import com.hp.schemas.ucmdb.client.services.UcmdbFault;
import com.hp.schemas.ucmdb.client.services.UcmdbService;
import com.hp.schemas.ucmdb.client.services.UcmdbServicePortType;
import com.hp.schemas.ucmdb.client.types.CmdbContext;
import com.hp.schemas.ucmdb.client.types.update.CIsAndRelationsUpdates;
public class TestWS implements Runnable {
private final static String endpointAddress = "http://your.ucmdb.server:8080/axis2/services/UcmdbService";
private final String username;
private final String password;
private TestWS(String username, String password) {
super();
this.username = username;
this.password = password;
}
public void run() {
UcmdbServicePortType actualService = getService();
AddCIsAndRelations cisToAdd = new AddCIsAndRelations();
CmdbContext cmdbContext = new CmdbContext();
cmdbContext.setCallerApplication("TestWS");
cisToAdd.setCmdbContext(cmdbContext);
try {
CIsAndRelationsUpdates relUpdates = new CIsAndRelationsUpdates();
/* Yes, this does nothing - NO-OP, just a sample */
cisToAdd.setCIsAndRelationsUpdates(relUpdates);
actualService.addCIsAndRelations(cisToAdd);
} catch (UcmdbFault fault) {
throw new RuntimeException(fault);
}
System.out.println("NO-OP, all done.");
}
private UcmdbServicePortType getService() {
UcmdbServicePortType actualService = new UcmdbService()
.getUcmdbServiceSOAP12PortHttp();
// setup BASIC authentication requirements..
BindingProvider bp = (BindingProvider) actualService;
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
// set the address of the WSDL end point
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
endpointAddress);
return actualService;
}
public static void main(String[] args) {
new TestWS("someuser", "somepassword").run();
}
}
Bookmarks