Package javax.wsdl.extensions

Examples of javax.wsdl.extensions.ExtensionRegistry


        wsdlFactory = factory;
        wsdlreader = reader;
    }

    public void registerExtenstions() {
        ExtensionRegistry registry = wsdlreader.getExtensionRegistry();
        if (registry == null) {
            registry = wsdlFactory.newPopulatedExtensionRegistry();
        }
        registerJAXWSBinding(registry, Definition.class);
        registerJAXWSBinding(registry, PortType.class);
View Full Code Here


    public JAXWSBinding parse(BindingsNode bindingsNode, Definition def) throws WSDLException {
        return parse(bindingsNode.getParentType(), bindingsNode.getElement(), def);
    }
   
    public JAXWSBinding parse(Class parentType, Element element, Definition def) throws WSDLException {
        ExtensionRegistry extReg = def.getExtensionRegistry();
        JAXWSBinding jaxwsBinding = (JAXWSBinding)extReg.createExtension(parentType,
                                                                         ToolConstants.JAXWS_BINDINGS);
       
        jaxwsBinding.setElementType(ToolConstants.JAXWS_BINDINGS);
        jaxwsBinding.setElement(element);
        jaxwsBinding.setDocumentBaseURI(def.getDocumentBaseURI());
View Full Code Here

        }

    }

    private void setAddrElement() throws ToolException {
        ExtensionRegistry extReg = this.wsdlReader.getExtensionRegistry();
        if (extReg == null) {
            extReg = wsdlFactory.newPopulatedExtensionRegistry();
        }
        if ("http".equalsIgnoreCase((String)env.get(ToolConstants.CFG_TRANSPORT))) {
            SOAPAddress soapAddress = null;
            try {
                soapAddress = (SOAPAddress)extReg.createExtension(Port.class,
                                                                  WSDLConstants.NS_SOAP_BINDING_ADDRESS);
            } catch (WSDLException wse) {
                Message msg = new Message("FAIl_TO_CREATE_SOAPADDRESS", LOG);
                throw new ToolException(msg, wse);
            }
            if (env.get(ToolConstants.CFG_ADDRESS) != null) {
                soapAddress.setLocationURI((String)env.get(ToolConstants.CFG_ADDRESS));
            } else {
                soapAddress.setLocationURI(HTTP_PREFIX + "/" + env.get(ToolConstants.CFG_SERVICE) + "/"
                                           + env.get(ToolConstants.CFG_PORT));
            }
            port.addExtensibilityElement(soapAddress);
        } else if ("jms".equalsIgnoreCase((String)env.get(ToolConstants.CFG_TRANSPORT))) {
            JMSAddress jmsAddress = null;
            JMSAddressSerializer jmsAddressSerializer = new JMSAddressSerializer();
            try {
                extReg.registerSerializer(JMSAddress.class, ToolConstants.JMS_ADDRESS, jmsAddressSerializer);
                extReg
                    .registerDeserializer(JMSAddress.class, ToolConstants.JMS_ADDRESS, jmsAddressSerializer);
                jmsAddress = (JMSAddress)extReg.createExtension(Port.class, ToolConstants.JMS_ADDRESS);
                if (env.optionSet(ToolConstants.JMS_ADDR_DEST_STYLE)) {
                    jmsAddress.setDestinationStyle((String)env.get(ToolConstants.JMS_ADDR_DEST_STYLE));
                }
                if (env.optionSet(ToolConstants.JMS_ADDR_INIT_CTX)) {
                    jmsAddress.setInitialContextFactory((String)env.get(ToolConstants.JMS_ADDR_INIT_CTX));
View Full Code Here

    public void testExtensionRegister() throws Exception {
        Bus bus = Bus.init();
        int inCount = 0;
        int outCount = 0;
        ExtensionRegistry registry = bus.getWSDLManager().getExtenstionRegistry();
        assertNotNull(registry);
       
        if (registry.getAllowableExtensions(BindingInput.class) != null) {
            inCount = registry.getAllowableExtensions(BindingInput.class).size();
        }
       
        if (registry.getAllowableExtensions(BindingOutput.class) != null) {
            outCount = registry.getAllowableExtensions(BindingOutput.class).size();
        }

        Set inputSet = registry.getAllowableExtensions(BindingInput.class);
        Set outputSet = registry.getAllowableExtensions(BindingOutput.class);

        assertNotNull(inputSet);
        assertNotNull(outputSet);
       
        assertEquals(inputSet.size() - inCount, outputSet.size() - outCount);
View Full Code Here

        assertTrue(outputSet.size() == outCount);
    }

    public void testXMLBindingExtensor() throws Exception {
        Bus bus = Bus.init();
        ExtensionRegistry registry = bus.getWSDLManager().getExtenstionRegistry();
        assertNotNull(registry);
       
        URL wsdlUrl = getClass().getResource("/wsdl/hello_world_xml_bare.wsdl");
        Definition definition = bus.getWSDLManager().getDefinition(wsdlUrl);
        assertNotNull(definition);
View Full Code Here

    private Definition buildDefinition() throws WSDLException {
        WSDLFactory factory = WSDLFactory.newInstance();
        Definition definition = factory.newDefinition();
        definition.setDocumentBaseURI("META-INF/wsdl/fake.wsdl");
        ExtensionRegistry extensionRegistry = factory.newPopulatedExtensionRegistry();
        BindingOperation bindingOperation = buildBindingOperation(definition, extensionRegistry);
        Binding binding = definition.createBinding();
        binding.setQName(new QName(NAMESPACE, "MockPortBinding"));
        //add soap:binding
        SOAPBinding soapBinding = (SOAPBinding) extensionRegistry.createExtension(Binding.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "binding"));
        soapBinding.setTransportURI("http://schemas.xmlsoap.org/soap/http");
        soapBinding.setStyle("rpc");
        binding.addExtensibilityElement(soapBinding);
        binding.addBindingOperation(bindingOperation);
        PortType portType = definition.createPortType();
        portType.setQName(new QName(NAMESPACE, "MockPort"));
        portType.addOperation(bindingOperation.getOperation());
        binding.setPortType(portType);
        Port port = definition.createPort();
        port.setName("MockPort");
        //add soap:address
        SOAPAddress soapAddress = (SOAPAddress) extensionRegistry.createExtension(Port.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "address"));
        soapAddress.setLocationURI("http://127.0.0.1:8080/foo");
        port.addExtensibilityElement(soapAddress);
        port.setBinding(binding);
        javax.wsdl.Service service = definition.createService();
        service.setQName(new QName(NAMESPACE, "MockService"));
View Full Code Here

    public WSDLToIDLAction() {
    }
   
    public void generateIDL(Definition definition) throws Exception {
        if (definition == null) {
            extReg = new ExtensionRegistry();
            addExtensions(extReg);
            typeProcessor.setExtensionRegistry(extReg);
            typeProcessor.parseWSDL(wsdlFileName);
            def = typeProcessor.getWSDLDefinition();
        } else {
View Full Code Here

        return helper;
    }

    public Definition generateCORBABinding() throws Exception {
        try {
            extReg = new ExtensionRegistry();
            addExtensions(extReg);
            typeProcessor.setExtensionRegistry(extReg);           
            typeProcessor.parseWSDL(getWsdlFileName());          
            def = typeProcessor.getWSDLDefinition();
            generateCORBABinding(def);
View Full Code Here

     *
     * @see com.ibm.wsdl.extensions.PopulatedExtensionRegistry
     */
    public Definition newDefinition() {
        Definition def = new DefinitionImpl();
        ExtensionRegistry extReg = newPopulatedExtensionRegistry();

        def.setExtensionRegistry(extReg);

        return def;
    }
View Full Code Here

    private void createSoapBinding(final SoapBindingInfo bi) throws WSDLException {
        boolean isSoap12 = bi.getSoapVersion() instanceof Soap12;
        Bus bs = getBus();
        WSDLManager m = bs.getExtension(WSDLManager.class);
        ExtensionRegistry extensionRegistry = m.getExtensionRegistry();

        SoapBinding soapBinding = SOAPBindingUtil.createSoapBinding(extensionRegistry, isSoap12);
        soapBinding.setStyle(bi.getStyle());
        soapBinding.setTransportURI(bi.getTransportURI());
        bi.addExtensor(soapBinding);
View Full Code Here

TOP

Related Classes of javax.wsdl.extensions.ExtensionRegistry

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.