}
return;
}
BindingOperationInfo wsdlOperation = getOperation(message);
BindingMessageInfo wsdlMessage = !isRequestor(message) ? wsdlOperation.getInput() : wsdlOperation.getOutput();
Document document = DomUtil.createDocument();
Element root = DomUtil.createElement(document, JbiConstants.WSDL11_WRAPPER_MESSAGE);
String typeNamespace = wsdlMessage.getMessageInfo().getName().getNamespaceURI();
if (typeNamespace == null || typeNamespace.length() == 0) {
throw new IllegalArgumentException("messageType namespace is null or empty");
}
root.setAttribute(XMLConstants.XMLNS_ATTRIBUTE + ":" + JbiConstants.WSDL11_WRAPPER_MESSAGE_PREFIX,
typeNamespace);
String typeLocalName = wsdlMessage.getMessageInfo().getName().getLocalPart();
if (typeLocalName == null || typeLocalName.length() == 0) {
throw new IllegalArgumentException("messageType local name is null or empty");
}
root.setAttribute(JbiConstants.WSDL11_WRAPPER_TYPE, JbiConstants.WSDL11_WRAPPER_MESSAGE_PREFIX + ":" + typeLocalName);
String messageName = wsdlMessage.getMessageInfo().getName().getLocalPart();
root.setAttribute(JbiConstants.WSDL11_WRAPPER_NAME, messageName);
root.setAttribute(JbiConstants.WSDL11_WRAPPER_VERSION, "1.0");
SoapBindingInfo binding = (SoapBindingInfo) message.getExchange().get(Endpoint.class).getEndpointInfo().getBinding();
String style = binding.getStyle(wsdlOperation.getOperationInfo());
if (style == null) {
style = binding.getStyle();
}
Element body = getBodyElement(message);
if (body == null) {
return;
}
if (body.getLocalName().equals("Fault")) {
handleJBIFault(message, body);
return;
}
List<SoapHeaderInfo> headers = wsdlMessage.getExtensors(SoapHeaderInfo.class);
List<Header> headerElement = message.getHeaders();
List<Object> parts = new ArrayList<Object>();
for (MessagePartInfo part : wsdlMessage.getMessageParts()) {
if ("document".equals(style)) {
parts.add(body);
} else /* rpc-style */ {
// SOAP:Body element is the operation name, children are operation parameters