DOMImplementation dImpl = builder.getDOMImplementation();
String policyID = portName + "_Policy";
String inputPolicyID = portName + "_operationPolicy";
UnknownExtensibilityElement serviceLevelPolicRef = null;
UnknownExtensibilityElement opLevelPolicRef = null;
String namespace = GFacSchemaConstants.GFAC_NAMESPACE;
Document doc = dImpl.createDocument(namespace, "factoryServices", null);
String description = serviceDesc.getService().getServiceDescription();
if (description != null) {
Element documentation = doc.createElementNS("http://schemas.xmlsoap.org/wsdl/", "wsdl:documentation");
documentation.appendChild(doc.createTextNode(description));
def.setDocumentationElement(documentation);
}
if (GFacSchemaConstants.TRANSPORT_LEVEL.equals(security)) {
def.addExtensibilityElement(createTransportLevelPolicy(dImpl, policyID));
serviceLevelPolicRef = createWSPolicyRef(dImpl, policyID);
} else if (GFacSchemaConstants.MESSAGE_SIGNATURE.equals(security)) {
def.addExtensibilityElement(WSPolicyGenerator.createServiceLevelPolicy(dImpl, policyID));
serviceLevelPolicRef = createWSPolicyRef(dImpl, policyID);
opLevelPolicRef = createWSPolicyRef(dImpl, inputPolicyID);
}
// Create types
Types types = TypesGenerator.addTypes(def, dImpl, serviceDesc, typens, globalTypens);
def.setTypes(types);
// if(!abstractWSDL)
// {
// table = createMessageTable(serviceDesc, typens, operation);
// }
// Create port types (only first port type)
PortTypeImpl wsdlPortType = addPortTypes(def, dImpl, portType, serviceQName);
Binding binding = addBinding(def, nameSpaceURI, wsdlPortType, serviceLevelPolicRef, dImpl);
String methodDesc = serviceDesc.getPortType().getMethod().getMethodDescription();
String methodName = serviceDesc.getPortType().getMethod().getMethodName();
OutputParameterType[] outputParams = serviceDesc.getOutputParametersArray();
OperationImpl operation = addOperation(def, dImpl, methodName, methodDesc, typens, outputParams);
wsdlPortType.addOperation(operation);
if (!abstractWSDL) {
UnknownExtensibilityElement wsInPolicyRef = null;
UnknownExtensibilityElement wsOutPolicyRef = null;
BindingInputImpl bindingInput = addBindingInput(def, methodName, wsInPolicyRef);
BindingOutputImpl bindingOutput = addBindingOutput(def, methodName, outputParams, wsOutPolicyRef);
BindingOperation bindingOperation = addBindingOperation(def, operation, dImpl);
bindingOperation.setBindingInput(bindingInput);