private SoapBody getSoapBody(Class<?> parent) throws ToolException {
if (extReg == null) {
extReg = wsdlFactory.newPopulatedExtensionRegistry();
}
SoapBody soapBody = null;
try {
soapBody = SOAPBindingUtil.createSoapBody(extReg, parent, isSOAP12());
} catch (WSDLException wse) {
Message msg = new Message("FAIL_TO_CREATE_SOAPBINDING", LOG);
throw new ToolException(msg, wse);
}
soapBody.setUse((String)env.get(ToolConstants.CFG_USE));
if (WSDLConstants.RPC.equalsIgnoreCase((String)env.get(ToolConstants.CFG_STYLE))
&& env.optionSet(ToolConstants.CFG_NAMESPACE)) {
soapBody.setNamespaceURI((String)env.get(ToolConstants.CFG_NAMESPACE));
}
return soapBody;
}