}
CreateActivityDocument cad = CreateActivityDocument.Factory
.newInstance();
cad.addNewCreateActivity().addNewActivityDocument()
.setJobDefinition(job.getJobDoc().getJobDefinition());
CreateActivityResponseDocument response = null;
try {
response = factory.createActivity(cad);
} catch (NotAcceptingNewActivitiesFault notAcceptingNewActivitiesFault) {
notAcceptingNewActivitiesFault.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (InvalidRequestMessageFault invalidRequestMessageFault) {
invalidRequestMessageFault.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (UnsupportedFeatureFault unsupportedFeatureFault) {
unsupportedFeatureFault.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
EndpointReferenceType activityEpr = response
.getCreateActivityResponse().getActivityIdentifier();
//factory.waitWhileActivityIsDone(activityEpr, 1000);
jobId = WSUtilities.extractResourceID(activityEpr);
if (jobId == null) {
jobId = new Long(Calendar.getInstance().getTimeInMillis())