.getExtensionElement(ExtensionConstants.SCHEMA);
wsdlTypes.addExtensibilityElement(schemaExtensibilityElement);
schemaExtensibilityElement.setElement(documentElement);
womDescription.setTypes(wsdlTypes);
WSDLInterface portType = womDescription.createInterface();
portType.setName(new QName(axisService.getName() + "Port"));
ArrayList policyElements;
PolicyInclude include;
include = axisService.getPolicyInclude();
// adding policies defined in wsdl:portType
policyElements = include.getPolicyElements(PolicyInclude.PORT_TYPE_POLICY);
addPolicyAsExtAttributes(womDescription, policyElements, portType, include);
Iterator operations = axisService.getOperations();
while (operations.hasNext()) {
AxisOperation axisOperation = (AxisOperation) operations.next();
if (axisOperation.isControlOperation()) {
// we do not need to expose control operation in the WSDL
continue;
}
WSDLOperation wsdlOperation = womDescription.createOperation();
wsdlOperation.setName(axisOperation.getName());
// adding policies defined in wsdl:portType -> wsdl:operation
include = axisOperation.getPolicyInclude();
policyElements = include.getPolicyElements(PolicyInclude.OPERATION_POLICY);
addPolicyAsExtElements(womDescription, policyElements, wsdlOperation, include);
AxisMessage inaxisMessage = axisOperation
.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
if (inaxisMessage != null) {
MessageReference messageRefinput = wsdlComponentFactory
.createMessageReference();
messageRefinput
.setElementQName(inaxisMessage.getElementQName());
messageRefinput
.setDirection(WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
// adding policies defined in wsdl:portType -> wsdl:operation ->
// wsdl:input
include = inaxisMessage.getPolicyInclude();
policyElements = include.getPolicyElements(PolicyInclude.INPUT_POLICY);
addPolicyAsExtAttributes(womDescription, policyElements, messageRefinput, include);
wsdlOperation.setInputMessage(messageRefinput);
}
try {
AxisMessage outaxisMessage = axisOperation
.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
if (outaxisMessage != null
&& outaxisMessage.getElementQName() != null) {
MessageReference messageRefout = wsdlComponentFactory
.createMessageReference();
messageRefout.setElementQName(outaxisMessage
.getElementQName());
messageRefout
.setDirection(WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
// adding policies defined in wsdl:portType -> wsdl:operation
// -> wsdl:output
include = outaxisMessage.getPolicyInclude();
policyElements = include.getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
addPolicyAsExtAttributes(womDescription, policyElements, messageRefout, include);
wsdlOperation.setOutputMessage(messageRefout);
}
} catch (UnsupportedOperationException e) {
// operation does not have an out message so , no need to do
// anything here
}
portType.setOperation(wsdlOperation);
}
return portType;
}