Java Code Examples for javax.wsdl.Definition

The following examples show how to use javax.wsdl.Definition. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: cxf   Source File: ScopedNameVisitor.java    License: Apache License 2.0 6 votes vote down vote up
public static boolean accept(Scope scope,
                             Definition defn,
                             XmlSchema schemaRef,
                             AST node,
                             WSDLASTVisitor wsdlVisitor,
                             boolean asName) {
    boolean result = false;
    if (PrimitiveTypesVisitor.accept(node)) {
        result = true;
    } else if (isforwardDeclared(scope, node, wsdlVisitor, asName)) {
        result = true;
    } else if (ObjectReferenceVisitor.accept(scope,
                                             schemaRef,
                                             defn,
                                             node,
                                             wsdlVisitor)) {
        result = true;
    } else if (findSchemaType(scope, defn, schemaRef, node, wsdlVisitor, null, asName)) {
        result = true;
    }
    return result;
}
 
Example 2
Source Project: activiti6-boot2   Source File: WSDLImporter.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Imports services and operations from the WSDL definition
 */
protected void importServicesAndOperations(Definition definition) {
  for (Object serviceObject : definition.getServices().values()) {
    Service service = (Service) serviceObject;
    WSService wsService = this.importService(service);
    this.wsServices.put(this.namespace + wsService.getName(), wsService);

    Port port = (Port) service.getPorts().values().iterator().next();
    for (Object bindOperationObject : port.getBinding().getBindingOperations()) {
      BindingOperation bindOperation = (BindingOperation) bindOperationObject;
      WSOperation operation = this.processOperation(bindOperation.getOperation(), wsService);
      wsService.addOperation(operation);

      this.wsOperations.put(this.namespace + operation.getName(), operation);
    }
  }
}
 
Example 3
Source Project: cxf   Source File: WSDLToCorbaBindingTypeTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCorbaExceptionComplextype() throws Exception {

    try {
        String fileName = getClass().getResource("/wsdl/databaseService.wsdl").toString();
        generator.setWsdlFile(fileName);
        generator.addInterfaceName("Database");

        Definition model = generator.generateCORBABinding();
        Document document = writer.getDocument(model);
        Element typemap = getElementNode(document, "corba:typeMapping");
        assertNotNull(typemap);
        assertEquals(2, typemap.getElementsByTagName("corba:struct").getLength());
        assertEquals(1, typemap.getElementsByTagName("corba:exception").getLength());
        assertEquals(1, typemap.getElementsByTagName("corba:anonsequence").getLength());
    } finally {
        new File("databaseService-corba.wsdl").deleteOnExit();
    }
}
 
Example 4
Source Project: cxf   Source File: WSDLToCorbaBinding.java    License: Apache License 2.0 6 votes vote down vote up
private void addCorbaTypes(Definition definition) throws Exception {
    for (XmlSchema xmlSchemaTypes : xmlSchemaList.getXmlSchemas()) {

        for (XmlSchemaExternal ext : xmlSchemaTypes.getExternals()) {
            addCorbaTypes(ext.getSchema());
            // REVISIT: This was preventing certain types from being added to the corba
            // typemap even when they are referenced from other parts of the wsdl.
            //
            // Should this add the corba types if it IS an instance of the XmlSchemaImport
            // (and not an XmlSchemaInclude or XmlSchemaRedefine)?
            //if (!(extSchema instanceof XmlSchemaImport)) {
            //    addCorbaTypes(extSchema.getSchema());
            //}
        }
        if (!W3CConstants.NU_SCHEMA_XSD.equals(xmlSchemaTypes.getTargetNamespace())) {
            addCorbaTypes(xmlSchemaTypes);
        }
    }
}
 
Example 5
Source Project: flowable-engine   Source File: WSDLImporter.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Imports services and operations from the WSDL definition
 */
protected void importServicesAndOperations(Definition definition) {
    for (Object serviceObject : definition.getServices().values()) {
        Service service = (Service) serviceObject;
        WSService wsService = this.importService(service);
        this.wsServices.put(this.namespace + wsService.getName(), wsService);

        Port port = (Port) service.getPorts().values().iterator().next();
        for (Object bindOperationObject : port.getBinding().getBindingOperations()) {
            BindingOperation bindOperation = (BindingOperation) bindOperationObject;
            WSOperation operation = this.processOperation(bindOperation.getOperation(), wsService);
            wsService.addOperation(operation);

            this.wsOperations.put(this.namespace + operation.getName(), operation);
        }
    }
}
 
Example 6
Source Project: jolie   Source File: SoapProtocol.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
private void parseWSDLTypes( XSOMParser schemaParser )
	throws IOException {
	Definition definition = getWSDLDefinition();
	if( definition != null ) {
		Types types = definition.getTypes();
		if( types != null ) {
			List< ExtensibilityElement > list = types.getExtensibilityElements();
			for( ExtensibilityElement element : list ) {
				if( element instanceof SchemaImpl ) {
					Element schemaElement = ((SchemaImpl) element).getElement();
					Map< String, String > namespaces = definition.getNamespaces();
					for( Entry< String, String > entry : namespaces.entrySet() ) {
						if( entry.getKey().equals( "xmlns" ) || entry.getKey().trim().isEmpty() ) {
							continue;
						}
						if( schemaElement.getAttribute( "xmlns:" + entry.getKey() ).isEmpty() ) {
							schemaElement.setAttribute( "xmlns:" + entry.getKey(), entry.getValue() );
						}
					}
					parseSchemaElement( definition, schemaElement, schemaParser );
				}
			}
		}
	}
}
 
Example 7
private BindingOperation findOperation(final Definition wsdl, final String operationName) {
    if (wsdl == null) {
        return null;
    }
    Map<QName, ?> bindings = wsdl.getBindings();
    for (Map.Entry<QName, ?> entry : bindings.entrySet()) {
        Binding binding = wsdl.getBinding((QName) entry.getKey());
        List<BindingOperation> definedOperations = binding.getBindingOperations();
        for (BindingOperation operation : definedOperations) {
            if (operation.getName().equalsIgnoreCase(operationName)) {
                return operation;
            }
        }
    }
    return null;
}
 
Example 8
Source Project: carbon-apimgt   Source File: APIMWSDLReader.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Returns WSDL definition from a byte content of the WSDL
 *
 * @param wsdl byte content of the WSDL document
 * @return {@link Definition} - WSDL4j definition constructed form the wsdl
 * @throws APIManagementException
 */
public Definition getWSDLDefinitionFromByteContent(byte[] wsdl, boolean readDependencies) throws APIManagementException {
    try {
        WSDLReader wsdlReader = getWsdlFactoryInstance().newWSDLReader();
        // switch off the verbose mode
        wsdlReader.setFeature(JAVAX_WSDL_VERBOSE_MODE, false);
        wsdlReader.setFeature(JAVAX_WSDL_IMPORT_DOCUMENTS, false);

        if (!readDependencies) {
            if (wsdlReader instanceof WSDLReaderImpl) {
                ((WSDLReaderImpl) wsdlReader).setIgnoreSchemaContent(true);
            }
        }

        return wsdlReader.readWSDL(null, getSecuredParsedDocumentFromContent(wsdl));
    } catch (Exception e) {
        String msg = " Error occurs when updating WSDL ";
        throw new APIManagementException(msg, e);
    }
}
 
Example 9
Source Project: cxf   Source File: ServiceWSDLBuilder.java    License: Apache License 2.0 6 votes vote down vote up
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);
    }
}
 
Example 10
Source Project: cxf   Source File: WSDLRefValidator.java    License: Apache License 2.0 6 votes vote down vote up
private List<Document> getWSDLDocuments() {
    List<Document> docs = new ArrayList<>();
    try {
        docs.add(getWSDLDocument());

        if (null != importedDefinitions) {
            for (Definition d : importedDefinitions) {
                docs.add(getWSDLDocument(d.getDocumentBaseURI()));
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
        // ignore
    }

    return docs;
}
 
Example 11
Source Project: cxf   Source File: ServiceWSDLBuilder.java    License: Apache License 2.0 6 votes vote down vote up
protected void buildMessage(Message message,
                            AbstractMessageContainer messageContainer,
                            final Definition def) {
    addDocumentation(message, messageContainer.getMessageDocumentation());
    message.setQName(messageContainer.getName());
    message.setUndefined(false);
    def.addMessage(message);

    List<MessagePartInfo> messageParts = messageContainer.getMessageParts();
    Part messagePart = null;
    for (MessagePartInfo messagePartInfo : messageParts) {
        messagePart = def.createPart();
        messagePart.setName(messagePartInfo.getName().getLocalPart());
        if (messagePartInfo.isElement()) {
            messagePart.setElementName(messagePartInfo.getElementQName());
            addNamespace(messagePartInfo.getElementQName().getNamespaceURI(), def);
        } else if (messagePartInfo.getTypeQName() != null) {
            messagePart.setTypeName(messagePartInfo.getTypeQName());
            addNamespace(messagePartInfo.getTypeQName().getNamespaceURI(), def);
        }
        message.addPart(messagePart);
    }
}
 
Example 12
Source Project: cxf   Source File: ServiceWSDLBuilder.java    License: Apache License 2.0 6 votes vote down vote up
protected void addExtensibilityElements(Definition def,
                                        ElementExtensible elementExtensible,
                                        List<ExtensibilityElement> extensibilityElements) {
    if (extensibilityElements != null) {
        for (ExtensibilityElement element : extensibilityElements) {
            if (element instanceof UnknownExtensibilityElement) {
                UnknownExtensibilityElement uee = (UnknownExtensibilityElement)element;
                String pfx = uee.getElement().getPrefix();
                addNamespace(pfx, element.getElementType().getNamespaceURI(), def);
            } else {
                QName qn = element.getElementType();
                addNamespace(qn.getNamespaceURI(), def);
            }
            elementExtensible.addExtensibilityElement(element);
        }
    }
}
 
Example 13
Source Project: cxf   Source File: WSDLToIDLTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testBindingGenSpecifiedFile() throws Exception {

    String[] cmdArgs = {"-corba", "-i", "BasePortType",
                        "-w", "simpleList-corba_gen.wsdl",
                        "-d", output.toString(),
                        getClass().getResource("/wsdl/simpleList.wsdl").toString()};
    String error = execute(cmdArgs);
    assertNull("WSDLToIDL Failed", error);

    Path f = output.resolve("simpleList-corba_gen.wsdl");
    assertTrue("simpleList-corba_gen.wsdl should be generated", Files.exists(f));

    WSDLToProcessor proc = new WSDLToProcessor();
    try {
        proc.parseWSDL(f.toString());
        Definition model = proc.getWSDLDefinition();
        assertNotNull("WSDL Definition Should not be Null", model);
        QName bindingName = new QName("http://schemas.apache.org/tests", "BaseCORBABinding");
        assertNotNull("Binding Node not found in WSDL", model.getBinding(bindingName));
    } catch (Exception e) {
        fail("WSDLToIDL generated an invalid simpleList-corba.wsdl");
    }
}
 
Example 14
Source Project: cxf   Source File: OperationVisitor.java    License: Apache License 2.0 6 votes vote down vote up
public static boolean accept(Scope scope,
                             Definition def,
                             XmlSchema schema,
                             AST node,
                             WSDLASTVisitor wsdlVisitor) {
    boolean result = false;
    AST node2 = node.getFirstChild();

    if (null == node2) {
       // throw whatever appropriate error
       // or do nothing and return false
    } else if (node2.getType() == IDLTokenTypes.LITERAL_oneway) {
        result = true;
    } else {
        int type = node2.getType();
        result =
            type == IDLTokenTypes.LITERAL_void
            || PrimitiveTypesVisitor.accept(node2)
            || StringVisitor.accept(node2)
            || ScopedNameVisitor.accept(scope, def, schema, node2, wsdlVisitor)
            //REVISIT, change this to be def & then schema
            || ObjectReferenceVisitor.accept(scope, schema, def, node2, wsdlVisitor);
    }
    return result;
}
 
Example 15
Source Project: cxf   Source File: NamespaceConfusionTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testNameNamespace() throws Exception {

    org.w3c.dom.Document doc = getWSDLDocument("NameServiceImpl");
    Element rootElement = doc.getDocumentElement();

    Definition def = getWSDLDefinition("NameServiceImpl");
    StringWriter sink = new StringWriter();
    WSDLFactory.newInstance().newWSDLWriter().writeWSDL(def, sink);
    NodeList aonNodes =
        assertValid("//xsd:complexType[@name='ArrayOfName']/xsd:sequence/xsd:element", doc);
    Element arrayOfNameElement = (Element)aonNodes.item(0);

    String typename = arrayOfNameElement.getAttribute("type");
    String prefix = typename.split(":")[0];

    String uri = getNamespaceForPrefix(rootElement, arrayOfNameElement, prefix);
    assertNotNull(uri);
    AegisType nameType = tm.getTypeCreator().createType(Name.class);
    QName tmQname = nameType.getSchemaType();
    assertEquals(tmQname.getNamespaceURI(), uri);

}
 
Example 16
Source Project: cxf   Source File: ServiceWSDLBuilder.java    License: Apache License 2.0 6 votes vote down vote up
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);
    }
}
 
Example 17
Source Project: carbon-apimgt   Source File: WSDL11ProcessorImpl.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Get endpoints defined in the provided WSDL definition.
 *
 * @param definition WSDL Definition
 * @return a Map of endpoint names and their URIs.
 * @throws APIMgtWSDLException if error occurs while reading endpoints
 */
private Map<String, String> getEndpoints(Definition definition) throws APIMgtWSDLException {
    Map serviceMap = definition.getAllServices();
    Iterator serviceItr = serviceMap.entrySet().iterator();
    Map<String, String> serviceEndpointMap = new HashMap<>();
    while (serviceItr.hasNext()) {
        Map.Entry svcEntry = (Map.Entry) serviceItr.next();
        Service svc = (Service) svcEntry.getValue();
        Map portMap = svc.getPorts();
        for (Object o : portMap.entrySet()) {
            Map.Entry portEntry = (Map.Entry) o;
            Port port = (Port) portEntry.getValue();
            List extensibilityElementList = port.getExtensibilityElements();
            for (Object extensibilityElement : extensibilityElementList) {
                String addressURI = getAddressUrl(extensibilityElement);
                serviceEndpointMap.put(port.getName(), addressURI);
            }
        }
    }
    return serviceEndpointMap;
}
 
Example 18
Source Project: juddi   Source File: WSDL2UDDITest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testWSDLBindingModel() throws WSDLException, JAXBException, ConfigurationException, Exception {

	// Reading the WSDL
	Definition wsdlDefinition = rw.readWSDL("wsdl/HelloWorld.wsdl");
	String wsdlURL = wsdlDefinition.getDocumentBaseURI();
	
	Properties properties = new Properties();
	properties.put("keyDomain", "juddi.apache.org");
	WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);
	Set<TModel> tModels = new HashSet<TModel>();
    @SuppressWarnings("unchecked")
	Map<QName,Binding> bindings= (Map<QName,Binding>) wsdlDefinition.getAllBindings();
    Set<TModel> bindingTModels = wsdl2UDDI.createWSDLBindingTModels(wsdlURL, bindings);
    tModels.addAll(bindingTModels);
    
	for (TModel tModel : tModels) {
		System.out.println("UDDI Binding TModel " + tModel.getName().getValue());
                       if (serialize)
		System.out.println(pTModel.print(tModel));
	}
	Assert.assertEquals(1,tModels.size());
}
 
Example 19
Source Project: container   Source File: BPELPlanContext.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Checks whether the given portType is declared in the given WSDL File
 *
 * @param portType the portType to check with
 * @param wsdlFile the WSDL File to check in
 * @return true if the portType is declared in the given WSDL file
 * @throws WSDLException is thrown when either the given File is not a WSDL File or initializing the WSDL Factory
 *                       failed
 */
public boolean containsPortType(final QName portType, final Path wsdlFile) throws WSDLException {
    final WSDLFactory factory = WSDLFactory.newInstance();
    final WSDLReader reader = factory.newWSDLReader();
    reader.setFeature("javax.wsdl.verbose", false);
    final Definition wsdlInstance = reader.readWSDL(wsdlFile.toAbsolutePath().toString());
    final Map portTypes = wsdlInstance.getAllPortTypes();
    for (final Object key : portTypes.keySet()) {
        final PortType portTypeInWsdl = (PortType) portTypes.get(key);
        if (portTypeInWsdl.getQName().getNamespaceURI().equals(portType.getNamespaceURI())
            && portTypeInWsdl.getQName().getLocalPart().equals(portType.getLocalPart())) {
            return true;
        }
    }
    return false;
}
 
Example 20
Source Project: cxf   Source File: AegisTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testAegisBasic() throws Exception {
    final String sei = org.apache.cxf.tools.fortest.aegis2ws.TestAegisSEI.class.getName();
    String[] args = new String[] {"-wsdl", "-o", output.getPath() + "/aegis.wsdl", "-verbose", "-d",
                                  output.getPath(), "-s", output.getPath(),
                                  "-frontend", "jaxws", "-databinding", "aegis",
                                  "-client", "-server", sei};
    File wsdlFile = null;
    wsdlFile = outputFile("aegis.wsdl");
    JavaToWS.main(args);
    assertTrue("wsdl is not generated", wsdlFile.exists());

    WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
    reader.setFeature("javax.wsdl.verbose", false);
    Definition def = reader.readWSDL(wsdlFile.toURI().toURL().toString());
    Document wsdl = WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
    assertValid("//xsd:element[@type='ns0:Something']", wsdl);
}
 
Example 21
Source Project: cxf   Source File: PartialWSDLProcessor.java    License: Apache License 2.0 6 votes vote down vote up
public static boolean isBindingExisted(Definition wsdlDefinition, QName name) {
    Map<QName, Binding> bindings = CastUtils.cast(wsdlDefinition.getAllBindings());
    Binding binding = null;
    if (bindings == null || bindings.isEmpty()) {
        return false;
    }
    try {
        for (Entry<QName, Binding> entry : bindings.entrySet()) {
            if (entry.getKey().getLocalPart().contains(name.getLocalPart())) {
                binding = entry.getValue();
                break;
            }
        }
    } catch (Exception e) {
        binding = null;
    }
    return binding != null;
}
 
Example 22
Source Project: cxf   Source File: PartialWSDLProcessor.java    License: Apache License 2.0 6 votes vote down vote up
public static boolean isPortTypeExisted(Definition wsdlDefinition, QName name) {
    Map<QName, PortType>  portTypes = CastUtils.cast(wsdlDefinition.getAllPortTypes());
    if (portTypes == null || portTypes.isEmpty()) {
        return false;
    }
    String existPortTypeName = null;
    PortType portType = null;
    try {
        for (Entry<QName, PortType> entry : portTypes.entrySet()) {
            existPortTypeName = entry.getKey().getLocalPart();
            if (name.getLocalPart().contains(existPortTypeName)) {
                portType = entry.getValue();
                break;
            }
        }
    } catch (Exception e) {
        portType = null;
    }
    return portType != null;
}
 
Example 23
Source Project: cxf   Source File: JAXWSBindingDeserializer.java    License: Apache License 2.0 6 votes vote down vote up
public ExtensibilityElement unmarshall(@SuppressWarnings("rawtypes") Class parentType,
                                       QName elementType,
                                       Element el,
                                       Definition def,
                                       ExtensionRegistry extReg) throws WSDLException {
    JAXWSBinding jaxwsBinding = (JAXWSBinding)extReg.createExtension(parentType, elementType);

    jaxwsBinding.setElementType(elementType);
    jaxwsBinding.setElement(el);
    jaxwsBinding.setDocumentBaseURI(def.getDocumentBaseURI());

    JAXWSBindingParser parser = new JAXWSBindingParser(extReg);
    parser.parseElement(jaxwsBinding, el);

    return jaxwsBinding;
}
 
Example 24
Source Project: cxf   Source File: WSDLToCorbaHelper.java    License: Apache License 2.0 5 votes vote down vote up
protected static boolean queryBinding(Definition definition, QName bqname) {
    Collection<Binding> bindings = CastUtils.cast(definition.getBindings().values());
    for (Binding binding : bindings) {
        if (binding.getQName().getLocalPart().equals(bqname.getLocalPart())) {
            return true;
        }
    }
    return false;
}
 
Example 25
Source Project: cxf   Source File: AbstractAegisTest.java    License: Apache License 2.0 5 votes vote down vote up
private Collection<Import> getImports(final Definition wsdlDef) {
    Collection<Import> importList = new ArrayList<>();
    Map<?, ?> imports = wsdlDef.getImports();
    for (Iterator<?> iter = imports.keySet().iterator(); iter.hasNext();) {
        String uri = (String)iter.next();
        List<Import> lst = CastUtils.cast((List<?>)imports.get(uri));
        importList.addAll(lst);
    }
    return importList;
}
 
Example 26
Source Project: cxf   Source File: WSDLCorbaWriterImpl.java    License: Apache License 2.0 5 votes vote down vote up
public void writeWSDL(Definition wsdlDef, OutputStream sink) throws WSDLException {
    try {
        StaxUtils.writeTo(getDocument(wsdlDef), sink, 2);
    } catch (XMLStreamException e) {
        throw new RuntimeException(e);
    }
}
 
Example 27
Source Project: cxf   Source File: PartialWSDLProcessor.java    License: Apache License 2.0 5 votes vote down vote up
public static Binding doAppendBinding(Definition wsdlDefinition, String name, PortType portType,
                                         ExtensionRegistry extReg) throws Exception {
    Binding binding = wsdlDefinition.createBinding();
    binding.setQName(new QName(wsdlDefinition.getTargetNamespace(), name + bindingName));
    binding.setUndefined(false);
    binding.setPortType(portType);
    setSoapBindingExtElement(wsdlDefinition, binding, extReg);
    addBindingOperation(wsdlDefinition, portType, binding, extReg);
    return binding;


}
 
Example 28
Source Project: cxf   Source File: AbstractAegisTest.java    License: Apache License 2.0 5 votes vote down vote up
protected Document getWSDLDocument(String string) throws WSDLException {
    Definition definition = getWSDLDefinition(string);
    if (definition == null) {
        return null;
    }
    WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
    return writer.getDocument(definition);
}
 
Example 29
Source Project: flowable-engine   Source File: WSDLImporter.java    License: Apache License 2.0 5 votes vote down vote up
public void importFrom(String url) {
    this.wsServices.clear();
    this.wsOperations.clear();
    this.structures.clear();

    this.wsdlLocation = url;

    try {
        Definition definition = this.parseWSDLDefinition();
        this.importServicesAndOperations(definition);
        this.importTypes(definition.getTypes());
    } catch (WSDLException e) {
        throw new FlowableException(e.getMessage(), e);
    }
}
 
Example 30
Source Project: cxf   Source File: FixedPtConstVisitor.java    License: Apache License 2.0 5 votes vote down vote up
public FixedPtConstVisitor(Scope scopeRef,
                           Definition defn,
                           XmlSchema schemaRef,
                           XmlSchemaCollection xmlSchemas) {
    scope = scopeRef;
    schemas = xmlSchemas;
}