DOMImplementation dImpl = builder.getDOMImplementation();
String policyID = portName + "_Policy";
String inputPolicyID = portName + "_operationPolicy";
UnknownExtensibilityElement serviceLevelPolicRef = null;
UnknownExtensibilityElement opLevelPolicRef = null;
String namespace = GFacConstants.GFAC_NAMESPACE;
Document doc = dImpl.createDocument(namespace, "factoryServices", null);
//TODO this is boken fix it
String description = serviceMap.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(GFacConstants.TRANSPORT_LEVEL.equals(security))
{
def.addExtensibilityElement(createTransportLevelPolicy(dImpl, policyID));
serviceLevelPolicRef = createWSPolicyRef(dImpl, policyID);
}
else if (GFacConstants.MESSAGE_SIGNATURE.equals(security))
{
def.addExtensibilityElement(WSPolicyGenerator.createServiceLevelPolicy(dImpl, policyID));
def.addExtensibilityElement(WSPolicyGenerator.createOperationLevelPolicy(dImpl, "inputPolicy", inputPolicyID));
serviceLevelPolicRef = createWSPolicyRef(dImpl, policyID);
opLevelPolicRef = createWSPolicyRef(dImpl, inputPolicyID);
}
// Create types
Types types = TypesGenerator.addTypes(def, dImpl, serviceMap, typens, globalTypens, methods);
def.setTypes(types);
// if(!abstractWSDL)
// {
// table = createMessageTable(serviceMap, typens, methods);
// }
// Create port types (only first port type)
PortTypeImpl portType = addPortTypes(def, dImpl, portTypes, serviceQName);
Binding binding = addBinding(def, nameSpaceURI, portType, serviceLevelPolicRef,dImpl);
Vector methodDesc = WSDLGenUtil.getMethodDescriptions(serviceMap);
for(int i = 0; i < methods.length; ++i)
{
String methodName = methods[i].getMethodName();
Vector outParams = WSDLGenUtil.getOutParams(serviceMap, methodName);
OperationImpl operation = addOperation(def, dImpl, methodName, (String) methodDesc.get(i),typens,outParams);
portType.addOperation(operation);
if(!abstractWSDL)
{
UnknownExtensibilityElement wsInPolicyRef = null;
UnknownExtensibilityElement wsOutPolicyRef = null;
BindingInputImpl bindingInput = addBindingInput(def, methodName, wsInPolicyRef);
BindingOutputImpl bindingOutput = addBindingOutput(def, methodName, outParams, wsOutPolicyRef);
BindingOperation bindingOperation = addBindingOperation(def, operation,dImpl);
bindingOperation.setBindingInput(bindingInput);