String portTypeName = makeCClassName(axisService.getName());
Iterator bindingOperations = this.axisBinding.getChildren();
boolean opsFound = false;
AxisOperation axisOperation = null;
AxisBindingOperation axisBindingOperation = null;
while (bindingOperations.hasNext()) {
axisBindingOperation = (AxisBindingOperation) bindingOperations.next();
axisOperation = axisBindingOperation.getAxisOperation();
// populate info holder with mep information. This will used in determining which
// message receiver to use, etc.,
String messageExchangePattern = axisOperation.getMessageExchangePattern();
if (infoHolder.get(messageExchangePattern) == null) {
infoHolder.put(messageExchangePattern, Boolean.TRUE);
}
if (mep == null) {
opsFound = true;
List soapHeaderInputParameterList = new ArrayList();
List soapHeaderOutputParameterList = new ArrayList();
methodElement = doc.createElement("method");
String localPart = axisOperation.getName().getLocalPart();
String opCName = makeCClassName(localPart);
String opNS = axisOperation.getName().getNamespaceURI();
addAttribute(doc, "name", opCName, methodElement);
addAttribute(doc, "caps-name", opCName.toUpperCase(), methodElement);
addAttribute(doc, "localpart", localPart, methodElement);
addAttribute(doc, "qname", localPart + "|" + opNS, methodElement);
addAttribute(doc, "namespace", opNS, methodElement);
String style = axisOperation.getStyle();
addAttribute(doc, "style", style, methodElement);
addAttribute(doc, "dbsupportname",
portTypeName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
methodElement);
addAttribute(doc, "mep", Utils.getAxisSpecifMEPConstant(
axisOperation.getMessageExchangePattern()) + "", methodElement);
addAttribute(doc, "mepURI", axisOperation.getMessageExchangePattern(),
methodElement);
addSOAPAction(doc, methodElement, axisBindingOperation.getName());
//add header ops for input
addHeaderOperations(soapHeaderInputParameterList, axisBindingOperation, true);
//add header ops for output
addHeaderOperations(soapHeaderOutputParameterList, axisBindingOperation, false);
PolicyInclude policyInclude = axisOperation.getPolicyInclude();
Policy policy = policyInclude.getPolicy();
if (policy != null) {
try {
addAttribute(doc, "policy", PolicyUtil.policyComponentToString(policy),
methodElement);
} catch (Exception ex) {
throw new RuntimeException("can't serialize the policy to a String ", ex);
}
}
methodElement.appendChild(
getInputElement(doc, axisBindingOperation, soapHeaderInputParameterList));
methodElement.appendChild(
getOutputElement(doc, axisBindingOperation, soapHeaderOutputParameterList));
methodElement.appendChild(getFaultElement(doc, axisOperation));
rootElement.appendChild(methodElement);
} else {
//mep is present - we move ahead only if the given mep matches the mep of this operation
if (mep.equals(axisOperation.getMessageExchangePattern())) {
//at this point we know it's true
opsFound = true;
List soapHeaderInputParameterList = new ArrayList();
List soapHeaderOutputParameterList = new ArrayList();
methodElement = doc.createElement("method");
String localPart = axisOperation.getName().getLocalPart();
String opCName = makeCClassName(localPart);
String opNS = axisOperation.getName().getNamespaceURI();
addAttribute(doc, "name", opCName, methodElement);
addAttribute(doc, "caps-name", opCName.toUpperCase(), methodElement);
addAttribute(doc, "localpart", localPart, methodElement);
addAttribute(doc, "qname", localPart + "|" + opNS, methodElement);
addAttribute(doc, "namespace", axisOperation.getName().getNamespaceURI(),
methodElement);
addAttribute(doc, "style", axisOperation.getStyle(), methodElement);
addAttribute(doc, "dbsupportname",
portTypeName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
methodElement);
addAttribute(doc, "mep", Utils.getAxisSpecifMEPConstant(
axisOperation.getMessageExchangePattern()) + "", methodElement);
addAttribute(doc, "mepURI", axisOperation.getMessageExchangePattern(),
methodElement);
addSOAPAction(doc, methodElement, axisBindingOperation.getName());
addHeaderOperations(soapHeaderInputParameterList, axisBindingOperation, true);
addHeaderOperations(soapHeaderOutputParameterList, axisBindingOperation, false);
/*
* Setting the policy of the operation