Protocol proto = Protocol.getProtocolForBinding(endpointDesc.getClientBindingID());
// Create a block from the value
QName qName = XMLRootElementUtil.getXmlRootElementQNameFromObject(value);
Block block = factory.createFrom(value, context, qName);
MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
if (mode.equals(Mode.PAYLOAD)) {
// Normal case
message = mf.create(proto);
message.setBodyBlock(block);
} else {
// Message mode..rare case
// Create Message from block
message = mf.createFrom(block, null, proto);
}
} catch (Exception e) {
throw ExceptionFactory.makeWebServiceException(e);
}