if (param == null) {
return;
}
SOAPBody body = null;
BindingInput bindingInput = definition.createBindingInput();
bindingInput.setName(param.getName());
operation.setBindingInput(bindingInput);
try {
body = (SOAPBody)extensionRegistry.createExtension(BindingInput.class,
new QName(WSDLConstants.SOAP11_NAMESPACE,
"body"));
} catch (WSDLException e1) {
throw new ToolException(e1.getMessage(), e1);
}
if (jmethod.getSoapUse() == SOAPBinding.Use.LITERAL) {
body.setUse("literal");
} else {
Message msg = new Message("ENCODED_USE_NOT_SUPPORTED", LOG);
throw new ToolException(msg);
}
List<JavaParameter> bodyParams = new ArrayList<JavaParameter>();
List<JavaParameter> headerParams = new ArrayList<JavaParameter>();
splitSoapHeaderBodyParams(param, bodyParams, headerParams);
// if exists soap header,then generate soap body parts
if (headerParams.size() > 0) {
List<String> parts = new ArrayList<String>();
for (JavaParameter parameter : bodyParams) {
parts.add(parameter.getPartName());
}
body.setParts(parts);
SOAPHeader soapHeader = null;
for (JavaParameter jp : headerParams) {
try {
soapHeader = (SOAPHeader)extensionRegistry
.createExtension(BindingInput.class, new QName(WSDLConstants.SOAP11_NAMESPACE,
"header"));
soapHeader.setMessage(new QName(param.getTargetNamespace(), param.getName()));
soapHeader.setPart(jp.getPartName());
soapHeader.setUse("literal");
} catch (WSDLException e) {
throw new ToolException(e.getMessage(), e);
}
}
if (jmethod.getSoapStyle() == SOAPBinding.Style.RPC) {
body.setNamespaceURI(param.getTargetNamespace());
}
bindingInput.addExtensibilityElement(soapHeader);
}
bindingInput.addExtensibilityElement(body);
}