I'm trying to write a pure WSDL client (i.e. no productivity layer) to the DFS Object Service using JAX-WS 2.1.3. It seems like whenever I set the transfer mode to UCF or MTOM that the Object Service gives an error. If I don't set this property, everything seems to work fine (although it seems to default to UCF). Has anyone else experienced this? Code sample:
ContentTransferProfile contentTransferProfile = new ContentTransferProfile();
if (MTOM.equals(contentTransfer)) {
BindingProvider bindingProvider = (BindingProvider)objectServicePort;
SOAPBinding binding = (SOAPBinding)bindingProvider.getBinding();
binding.setMTOMEnabled(true);
// contentTransferProfile.setTransferMode(ContentTransferMode.MTOM); <-- This causes trouble if uncommented
contentTransferProfile.setGeolocation("");
} else if (UCF.equals(contentTransfer)) {
// contentTransferProfile.setTransferMode(ContentTransferMode.UCF); <-- This causes trouble if uncommented
// contentTransferProfile.setGeolocation("");
}
serviceContext.getProfiles().add(contentTransferProfile);