private void build(Port port) { if (wsdlModeler.isProvider(port)) return; Binding binding = port.resolveBinding(wsdlDocument); SOAPBinding soapBinding = (SOAPBinding) getExtensionOfType(binding, SOAPBinding.class); // lets try and see if its SOAP 1.2. dont worry about extension flag, its // handled much earlier if (soapBinding == null) { soapBinding = (SOAPBinding) getExtensionOfType(binding, SOAP12Binding.class); } if (soapBinding == null) return; PortType portType = binding.resolvePortType(wsdlDocument); QName bindingName = WSDLModelerBase.getQNameOf(binding); // we dont want to process the port bound to the binding processed earlier if (bindingNameToPortMap.containsKey(bindingName)) return; bindingNameToPortMap.put(bindingName, port); for (Iterator itr = binding.operations(); itr.hasNext(); ) { BindingOperation bindingOperation = (BindingOperation) itr.next(); // get only the bounded operations Set boundedOps = portType.getOperationsNamed(bindingOperation.getName()); if (boundedOps.size() != 1) continue; Operation operation = (Operation) boundedOps.iterator().next(); // No pseudo schema required for doc/lit if (wsdlModeler.isAsync(portType, operation)) { buildAsync(portType, operation, bindingOperation); } } }
private void writeImports(QName elementName, List<MessagePart> parts) { Set<String> uris = new HashSet<String>(); for (MessagePart p : parts) { String ns = p.getDescriptor().getNamespaceURI(); if (!uris.contains(ns) && !ns.equals("http://www.w3.org/2001/XMLSchema") && !ns.equals(elementName.getNamespaceURI())) { print("<xs:import namespace=''{0}''/>", ns); uris.add(ns); } } }