Refine search
if (!binding.isUndefined()) QName name = binding.getQName(); name.getLocalPart(), pw); PortType portType = binding.getPortType(); portType.getQName(), def, pw);
if (!portType.isUndefined()) QName name = portType.getQName(); name.getLocalPart(), pw); printDocumentation(portType.getDocumentationElement(), def, pw); printOperations(portType.getOperations(), def, pw); List extElements = portType.getExtensibilityElements(); printExtensibilityElements(PortType.class, extElements, def, pw);
QName portTypeName = new QName(def.getTargetNamespace(), name); portType = def.getPortType(portTypeName); portType = def.createPortType(); portType.setQName(portTypeName); portType.setUndefined(false); portType.setDocumentationElement(tempEl); portType.addOperation(op); portType.addExtensibilityElement( parseExtensibilityElement(PortType.class, tempEl, def));
private Map<QName, Operation> getOperations(PortType portType) { Map<QName, Operation> operations = new HashMap<>(); Collection<Operation> pops = CastUtils.cast(portType.getOperations()); for (Operation op : pops) { operations.put(new QName(portType.getQName().getNamespaceURI(), op.getName()), op); } return operations; }
operation = def.createOperation(); addDocumentation(operation, operationInfo.getDocumentation()); operation.setUndefined(false); operation.setName(operationInfo.getName().getLocalPart()); addNamespace(operationInfo.getName().getNamespaceURI(), def); if (operationInfo.isOneWay()) { operation.setStyle(OperationType.ONE_WAY); Input input = def.createInput(); addDocumentation(input, operationInfo.getInput().getDocumentation()); input.setName(operationInfo.getInputName()); Message message = def.createMessage(); buildMessage(message, operationInfo.getInput(), def); this.addExtensibilityAttributes(def, input, getInputExtensionAttributes(operationInfo)); fault = def.createFault(); addDocumentation(fault, faultInfo.getDocumentation()); fault.setName(faultInfo.getFaultName().getLocalPart()); message = def.createMessage(); buildMessage(message, faultInfo, def); portType.addOperation(operation);
private XNode getXNode(PortType portType) { XDef xdef = new XDef(); xdef.setTargetNamespace(portType.getQName().getNamespaceURI()); XPortType pNode = new XPortType(); pNode.setName(portType.getQName().getLocalPart()); pNode.setParentNode(xdef); return pNode; }
/** * Called after the {@link PortType} has been created. * <p/> * Default implementation sets the name of the port type to the defined value. * * @param portType the WSDL4J <code>PortType</code> * @throws WSDLException in case of errors * @see #setPortTypeName(String) */ protected void populatePortType(Definition definition, PortType portType) throws WSDLException { QName portTypeName = new QName(definition.getTargetNamespace(), getPortTypeName()); if (logger.isDebugEnabled()) { logger.debug("Creating port type [" + portTypeName + "]"); } portType.setQName(portTypeName); }
/** * Get the SOAP {@link Operation} instance for the specified message element. * * @param port The WSDL port. * @param elementName The SOAP Body element QName. * @param documentStyle true if it is 'document', false if 'rpc'. * @return The Operation instance, or null if the operation was not found on the port. */ public static Operation getOperationByElement(Port port, QName elementName, Boolean documentStyle) { List<Operation> operations = port.getBinding().getPortType().getOperations(); for (Operation operation : operations) { if (!documentStyle && (elementName.getLocalPart().equals(operation.getName()))) { return operation; } else { // Note: WS-I Profile allows only one child under SOAPBody. Part part = (Part)operation.getInput().getMessage().getParts().values().iterator().next(); if ((part.getElementName() != null) && elementName.equals(part.getElementName()) || (part.getTypeName() != null) && elementName.equals(part.getTypeName())) { return operation; } else if (elementName.getLocalPart().equals(operation.getName())) { return operation; } } } return null; }
throws WSDLException, AxisFault { QName portTypeQName = new QName(intfNS, getPortTypeName()); PortType portType = def.getPortType(portTypeQName); boolean newPortType = false; portType = def.createPortType(); portType.setUndefined(false); portType.setQName(portTypeQName); } else if (binding.getBindingOperations().size() > 0) { BindingOperation bindingOper = writeOperation(def, binding, thisOper); Operation oper = bindingOper.getOperation(); OperationDesc messageOper = thisOper; oper.setDocumentationElement( createDocumentationElement( messageOper.getDocumentation())); portType.addOperation(oper); def.addPortType(portType); binding.setPortType(portType);
protected void configureBinding(Definition definition, Binding binding, PortType portType) throws WSDLException { if ( wsBindingName != null ) { QName name = new QName(definition.getTargetNamespace(), wsBindingName + getSOAPVersionString() + BINDING_SUFFIX); if ( definition.getBinding(name) == null ) { binding.setQName(name); return; } } QName portTypeName = portType.getQName(); if (portTypeName != null) { // Choose <porttype>Binding if available. If this name is in use, insert // separating underscores until there is no clash. for (String suffix = BINDING_SUFFIX; ; suffix = "_" + suffix) { QName name = new QName(definition.getTargetNamespace(), portTypeName.getLocalPart() + suffix); if (definition.getBinding(name) == null) { binding.setQName(name); break; } } } }
try { Definition def = wsdlManager.getDefinition(wsdlDocumentLocation); interfaceName = def.getService(serviceName).getPort(portName.getLocalPart()).getBinding() .getPortType().getQName(); } catch (Exception e) { ? serviceName.getNamespaceURI() + " " + wsdlDocumentLocation : wsdlDocumentLocation; writer.writeNamespace(JAXWSAConstants.WSDLI_PFX, JAXWSAConstants.WSAM_INTERFACE_NAME, JAXWSAConstants.NS_WSAM); String portTypePrefix = interfaceName.getPrefix(); if (portTypePrefix == null || portTypePrefix.isEmpty()) { portTypePrefix = "ns1";
protected void buildBindingOperation(Definition def, Binding binding, Collection<BindingOperationInfo> bindingOperationInfos) { BindingOperation bindingOperation = null; for (BindingOperationInfo bindingOperationInfo : bindingOperationInfos) { bindingOperation = def.createBindingOperation(); addDocumentation(bindingOperation, bindingOperationInfo.getDocumentation()); bindingOperation.setName(bindingOperationInfo.getName().getLocalPart()); for (Operation operation : CastUtils.cast(binding.getPortType().getOperations(), Operation.class)) { if (operation.getName().equals(bindingOperation.getName())) { bindingOperation.setOperation(operation); break; } } buildBindingInput(def, bindingOperation, bindingOperationInfo.getInput()); buildBindingOutput(def, bindingOperation, bindingOperationInfo.getOutput()); buildBindingFault(def, bindingOperation, bindingOperationInfo.getFaults()); addExtensibilityAttributes(def, bindingOperation, bindingOperationInfo.getExtensionAttributes()); addExtensibilityElements(def, bindingOperation, getWSDL11Extensors(bindingOperationInfo)); binding.addBindingOperation(bindingOperation); } }
protected void configurePort(Port port, Binding binding) throws WSDLException { if ( wsBindingName != null ) { port.setName(wsBindingName + getSOAPVersionString() + PORT_SUFFIX); } else if (binding.getPortType() != null && binding.getPortType().getQName() != null) { port.setName(binding.getPortType().getQName().getLocalPart() + PORT_SUFFIX); } }
QName bindingName = new QName(def.getTargetNamespace(), name); binding = def.getBinding(bindingName); binding = def.createBinding(); binding.setQName(bindingName); binding.setUndefined(false); portType = def.createPortType(); portType.setQName(portTypeName); def.addPortType(portType); binding.setPortType(portType);
protected void buildBinding(Definition definition, Collection<BindingInfo> bindingInfos, Collection<PortType> portTypes) { Binding binding = null; for (BindingInfo bindingInfo : bindingInfos) { binding = definition.createBinding(); addDocumentation(binding, bindingInfo.getDocumentation()); binding.setUndefined(false); for (PortType portType : portTypes) { if (portType.getQName().equals(bindingInfo.getInterface().getName())) { binding.setPortType(portType); break; } } binding.setQName(bindingInfo.getName()); if (!bindingInfo.getName().getNamespaceURI().equals(definition.getTargetNamespace())) { addNamespace(bindingInfo.getName().getNamespaceURI(), definition); } buildBindingOperation(definition, binding, bindingInfo.getOperations()); addExtensibilityElements(definition, binding, getWSDL11Extensors(bindingInfo)); definition.addBinding(binding); } }
/** * Return the service that implements the given port type. * * @param portTypeQName name of the portType to search * @return the service that contains the given port. */ public static List<Service> getServicesOfPortType(final QName portTypeQName, final Set<Definition> wsdlDefinitions) { final List<Service> matchinServices = new ArrayList<Service>(); for (final Definition wsdlDefinition : wsdlDefinitions) { for (final Service service : (Collection<Service>) wsdlDefinition.getServices().values()) { for (final Port port : (Collection<Port>) service.getPorts().values()) { if (port.getBinding().getPortType().getQName().equals(portTypeQName)) { matchinServices.add(service); } } } } return matchinServices; }
public void generate() { PortType portType = definition.createPortType(); portType.setQName(new QName(wmodel.getTargetNameSpace(), wmodel.getPortTypeName())); portType.setUndefined(false); for (JavaMethod method : wmodel.getJavaMethods()) { Operation operation = definition.createOperation(); operation.setName(method.getName()); operation.setUndefined(false); Message inputMessage = null; inputMessage = definition.createMessage(); inputMessage.setQName(new QName(wmodel.getTargetNameSpace(), method.getName())); processInputMessage(operation, method, inputMessage); Message outputMessage = null; if (!method.isOneWay()) { outputMessage = definition.createMessage(); outputMessage.setQName(new QName(wmodel.getTargetNameSpace(), method.getName() + "Response")); processOutputMessage(operation, method, outputMessage); } generateFault(method, operation); portType.addOperation(operation); definition.addPortType(portType); } }
protected PortType buildPortType(InterfaceInfo intf, final Definition def) { PortType portType = null; try { portType = intf.getProperty(WSDLServiceBuilder.WSDL_PORTTYPE, PortType.class); } catch (ClassCastException e) { // do nothing } if (portType == null) { portType = def.createPortType(); portType.setQName(intf.getName()); addDocumentation(portType, intf.getDocumentation()); addNamespace(intf.getName().getNamespaceURI(), def); addExtensibilityElements(def, portType, getWSDL11Extensors(intf)); addExtensibilityAttributes(def, portType, intf.getExtensionAttributes()); portType.setUndefined(false); buildPortTypeOperation(portType, intf.getOperations(), def); } def.addPortType(portType); return portType; }
private String getOperationOnly(List<Operation> operations, Definition definition) { try { Definition tempDefinition = WSDLComparisonUtils.getWSDLDefinition(); PortType portType = tempDefinition.createPortType(); portType.setUndefined(false); portType.setQName(new QName(definition.getTargetNamespace(), "temp")); for (Operation operation : operations) { portType.addOperation(operation); } tempDefinition.addPortType(portType); WSDLComparisonUtils.copyNamespaces(definition, tempDefinition); String content = WSDLComparisonUtils.getWSDLWithoutDeclaration(tempDefinition); content = content.substring(content.indexOf(">") + 2); return content.replace("</wsdl:portType>", ""); } catch (WSDLException e) { log.error(e); } return null; }
portName = new QName(getTargetNamespace(), service.getSimpleName() + "PortType"); portType = def.createPortType(); portType.setQName(portName); portType.setUndefined(false); portType.setDocumentationElement(createElement(doc)); def.addPortType(portType); def.addMessage(req); wsdlOp.setUndefined(false); portType.addOperation(wsdlOp); wsdlOp.setDocumentationElement(createElement(opDoc));