message.setContent(Source.class, StaxUtil.createSource(xmlReader));
}
return;
}
Wsdl1SoapOperation wsdlOperation = getOperation(message);
Wsdl1SoapMessage wsdlMessage = server ? wsdlOperation.getInput() : wsdlOperation.getOutput();
Document document = DomUtil.createDocument();
Element root = DomUtil.createElement(document, JbiConstants.WSDL11_WRAPPER_MESSAGE);
String typeNamespace = wsdlMessage.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.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.getMessageName();
root.setAttribute(JbiConstants.WSDL11_WRAPPER_NAME, messageName);
root.setAttribute(JbiConstants.WSDL11_WRAPPER_VERSION, "1.0");
Element body = getBodyElement(message);
for (Wsdl1SoapPart part : wsdlMessage.getParts()) {
if (part.isBody()) {
if (wsdlOperation.getStyle() == Wsdl1SoapBinding.Style.DOCUMENT) {
addPart(root, body);
} else /* rpc-style */ {
// SOAP:Body element is the operation name, children are operation parameters
Element param = DomUtil.getFirstChildElement(body);
boolean found = false;