Package org.apache.tuscany.sca.interfacedef.wsdl

Examples of org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface


     
        __log.debug("Initializing BPELInvoker");

        Interface interfaze = operation.getInterface();
        if(interfaze instanceof WSDLInterface){
            WSDLInterface wsdlInterface = null;
            wsdlInterface = (WSDLInterface) interfaze;
           
            // The following commented out code is bogus and is replaced by what follows - Mike Edwards
            // Service serviceDefinition = (Service) wsdlInterface.getWsdlDefinition().getDefinition().getAllServices().values().iterator().next();
            // bpelServiceName = serviceDefinition.getQName();
            //
            // Fetch the service name from the service object
            bpelServiceName = new QName( "http://tuscany.apache.org", service.getName() );
               
            bpelOperationInputPart = (Part) wsdlInterface.getPortType().getOperation(bpelOperationName,null,null).getInput().getMessage().getParts().values().iterator().next();
            bpelOperationOutputPart = (Part) wsdlInterface.getPortType().getOperation(bpelOperationName,null,null).getOutput().getMessage().getParts().values().iterator().next();
        }
    }
View Full Code Here


     * @return
     * @throws ContributionReadException
     */
    private WSDLInterface createWSDLInterface(String uri) throws ContributionReadException {
       
      WSDLInterface wsdlInterface = null;       

        // Read a QName in the form:
        // namespace#wsdl.interface(name)
        int index = uri.indexOf('#');
        if (index == -1) {
          error("InvalidWSDLInterfaceAttr", wsdlFactory, uri);
            //throw new ContributionReadException("Invalid WSDL interface attribute: " + uri);
        } else {
          wsdlInterface = wsdlFactory.createWSDLInterface();
            wsdlInterface.setUnresolved(true);
            String namespace = uri.substring(0, index);
            String name = uri.substring(index + 1);
            name = name.substring("wsdl.interface(".length(), name.length() - 1);
            wsdlInterface.setName(new QName(namespace, name));
        }      
       
        return wsdlInterface;
    }
View Full Code Here

        String location = reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION);
        wsdlInterfaceContract.setLocation(location);
       
        String uri = reader.getAttributeValue(null, INTERFACE);
        if (uri != null) {
            WSDLInterface wsdlInterface = createWSDLInterface(uri);
            if (wsdlInterface != null)
                wsdlInterfaceContract.setInterface(wsdlInterface);
        }
       
        uri = reader.getAttributeValue(null, CALLBACK_INTERFACE);
        if (uri != null) {
            WSDLInterface wsdlCallbackInterface = createWSDLInterface(uri);
            if (wsdlCallbackInterface != null)
                wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
        }
           
        // Skip to end element
View Full Code Here

    public void write(WSDLInterfaceContract wsdlInterfaceContract, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
        // Write an <interface.wsdl>
        writer.writeStartElement(WSDLConstants.SCA11_NS, INTERFACE_WSDL);

        // Write interface name
        WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface();
        if (wsdlInterface != null) {
            QName qname = wsdlInterface.getName();
            String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")";
            writer.writeAttribute(INTERFACE, uri);
        }

        WSDLInterface wsdlCallbackInterface = (WSDLInterface)wsdlInterfaceContract.getCallbackInterface();
        if (wsdlCallbackInterface != null) {
            QName qname = wsdlCallbackInterface.getName();
            String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")";
            writer.writeAttribute(CALLBACK_INTERFACE, uri);
        }
       
        // Write location
View Full Code Here

    }
   
    public void resolve(WSDLInterfaceContract wsdlInterfaceContract, ModelResolver resolver) throws ContributionResolveException {
       
        // Resolve the interface and callback interface
        WSDLInterface wsdlInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getInterface(), resolver);
        wsdlInterfaceContract.setInterface(wsdlInterface);
       
        WSDLInterface wsdlCallbackInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getCallbackInterface(), resolver);
        wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
    }
View Full Code Here

    }
   
    public WSDLInterface createWSDLInterface(PortType portType,
                                             WSDLDefinition wsdlDefinition,
                                             ModelResolver resolver) throws InvalidInterfaceException {
        WSDLInterface wsdlInterface = createWSDLInterface();
        introspector.introspectPortType(wsdlInterface, portType, wsdlDefinition, resolver);
        return wsdlInterface;
    }
View Full Code Here

            }

            PortType portType = getPortType(model);
            if (portType != null) {
                WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
                WSDLInterface wsdlInterface = null;
                try {
                    wsdlInterface = wsdlFactory.createWSDLInterface(portType, wsdlDefinition, resolver);
                } catch (InvalidInterfaceException e) {
                  warning("InvalidInterfaceException", wsdlFactory, model.getName());
                }
View Full Code Here

           
            WSDLInterfaceContract wsdlInterfaceContract = (WSDLInterfaceContract)javaInterfaceContract.getNormalizedWSDLContract();
            if(wsdlInterfaceContract != null){
                // The user has explicitly associated a WSDL with the Java implementation
                // using a @WebService(wsdlLocation="...") annotation
                WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface();
                if (wsdlInterface.isUnresolved()){
                    //WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, wsdlInterface.getWsdlDefinition(), context);
                    extensionProcessor.resolve(wsdlInterfaceContract, resolver, context);
                   
                    // check that the Java and WSDL contracts are compatible
                    interfaceContractMapper.checkCompatibility(wsdlInterfaceContract,
                                                               javaInterfaceContract,
                                                               Compatibility.SUBSET,
                                                               false,
                                                               false);
                   
                    // retrieve the resolved WSDL interface
                    wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface();
                   
                    // copy policy from the WSDL interface to the Java interface
                    javaInterface.getPolicySets().addAll(wsdlInterface.getPolicySets());
                    javaInterface.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());
                   
                    // copy policy from the WSDL interface to the component type service
                    service.getPolicySets().addAll(wsdlInterface.getPolicySets());
                    service.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());                   
                   
                    // TODO - is there anything else to be copied from the user specified WSDL?
                }
            }
        }
View Full Code Here

                                                                    Monitor monitor) {

        WSDLInterfaceContract wsdlContract = wsdlFactory.createWSDLInterfaceContract();
       
        if (contract.getInterface() != null){
            WSDLInterface wsdlInterface = createWSDLInterface((JavaInterface)contract.getInterface(),
                                                               requiresSOAP12,
                                                               resolver,
                                                               dataBindings,
                                                               wsdlFactory,
                                                               xsdFactory,
                                                               documentBuilderFactory,
                                                               monitor);
            wsdlContract.setInterface(wsdlInterface);
        }
       
        if (contract.getCallbackInterface() != null){
            WSDLInterface wsdlInterface = createWSDLInterface((JavaInterface)contract.getCallbackInterface(),
                    requiresSOAP12,
                    resolver,
                    dataBindings,
                    wsdlFactory,
                    xsdFactory,
View Full Code Here

                                                    WSDLFactory wsdlFactory,
                                                    XSDFactory xsdFactory,
                                                    DocumentBuilderFactory documentBuilderFactory,
                                                    Monitor monitor) {

        WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface();
        WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition();

        Definition def = null;
        try {
            Interface2WSDLGenerator wsdlGenerator =
                new Interface2WSDLGenerator(requiresSOAP12, resolver, dataBindings, xsdFactory, documentBuilderFactory, monitor);
            def = wsdlGenerator.generate(javaInterface, wsdlDefinition);
        } catch (WSDLException e) {
            throw new WSDLGenerationException(e);
        }

        // for debugging
        if (printWSDL) {
            try {
                System.out.println("Generated WSDL for Java interface " + javaInterface.getName() + " class " + javaInterface.getJavaClass().getName());
                WSDLWriter writer =  javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter();
                writer.writeWSDL(def, System.out);
            } catch (WSDLException e) {
                throw new WSDLGenerationException(e);
            }
        }

        wsdlDefinition.setDefinition(def);
        wsdlInterface.setWsdlDefinition(wsdlDefinition);
        wsdlInterface.setRemotable(true);
        wsdlInterface.setUnresolved(false);
        wsdlInterface.setRemotable(true);
        PortType portType = (PortType)def.getAllPortTypes().values().iterator().next();
        wsdlInterface.setPortType(portType);

        try {
            wsdlFactory.createWSDLInterface(wsdlInterface, portType, wsdlDefinition, resolver, monitor);
        } catch (InvalidInterfaceException e) {
            throw new WSDLGenerationException(e);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.