}
if (serialize)
{
QName opQName = opMetaData.getQName();
Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
if (log.isDebugEnabled())
log.debug("Create RPC body element: " + opName);
soapBodyElement = new SOAPBodyElementRpc(opName);
soapBodyElement = (SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
// Add soap encodingStyle
if (opMetaData.getUse() == Use.ENCODED)
{
String envURI = soapEnvelope.getNamespaceURI();
String envPrefix = soapEnvelope.getPrefix();
soapBodyElement.setAttributeNS(envURI, envPrefix + ":encodingStyle", Constants.URI_SOAP11_ENC);
}
}
}
for (ParameterMetaData paramMetaData : opMetaData.getInputParameters())
{
QName xmlName = paramMetaData.getXmlName();
Object value = epInv.getRequestParamValue(xmlName);
if (paramMetaData.isSwA())
{
// NOTE: swa:ref is handled by the AttachmentMarshaller callback
CIDGenerator cidGenerator = reqMessage.getCidGenerator();
AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
reqMessage.addAttachmentPart(part);
// Add the attachment to the standard property
if (value instanceof DataHandler && msgContext instanceof MessageContextJAXWS)
{
DataHandler dataHandler = (DataHandler)value;
Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
attachments.put(dataHandler.getContentType(), dataHandler);
}
}
else
{
SOAPElement soapElement = paramMetaData.isInHeader() ? (SOAPElement)soapHeader : soapBodyElement;
addParameterToMessage(paramMetaData, value, soapElement);
}
}
// Add unbound headers
if (unboundHeaders != null)
{
Iterator it = unboundHeaders.values().iterator();
while (it.hasNext())
{
UnboundHeader unboundHeader = (UnboundHeader)it.next();
if (unboundHeader.getMode() != ParameterMode.OUT)
{
QName xmlName = unboundHeader.getXmlName();
Object value = unboundHeader.getHeaderValue();
xmlName = namespaceRegistry.registerQName(xmlName);
Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());
log.debug("Add unboundHeader element: " + soapName);
SOAPContentElement contentElement = new SOAPHeaderElementImpl(soapName);
contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));