public void setPayload(Source source)
{
if (message instanceof SOAPMessage)
{
SOAPMessage soapMessage = (SOAPMessage)message;
SOAPBodyImpl soapBody = getSOAPBody(soapMessage);
SOAPElement bodyElement = getBodyElement(soapBody);
try
{
if (style == Style.RPC)
{
try
{
soapBody.removeContents();
EnvelopeBuilder envBuilder = (EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), EnvelopeBuilderDOM.class.getName());
envBuilder.setStyle(style);
Element domBodyElement = DOMUtils.sourceToElement(source);
envBuilder.buildBodyElementRpc(soapBody, domBodyElement);
}