Package org.apache.cxf.service.model

Examples of org.apache.cxf.service.model.DescriptionInfo


            }
        }

        service.addBinding(bi);
        DescriptionInfo d = service.getDescription();
        if (null != d) {
            bi.setDescription(d);
            d.getDescribed().add(bi);
        }
        return bi;
    }
View Full Code Here


        // }
    }

    public void buildInterface(ServiceInfo si, PortType p) {
        InterfaceInfo inf = si.createInterface(p.getQName());
        DescriptionInfo d = si.getDescription();
        if (null != d) {
            inf.setDescription(si.getDescription());
            d.getDescribed().add(inf);
        }
        this.copyExtensors(inf, p.getExtensibilityElements());
        this.copyExtensionAttributes(inf, p);
        inf.setProperty(WSDL_PORTTYPE, p);
        for (Operation op : cast(p.getOperations(), Operation.class)) {
View Full Code Here

        control = EasyMock.createNiceControl();
    }
   
    @Test
    public void testLocalServiceModelReferenceResolver() {
        DescriptionInfo di = control.createMock(DescriptionInfo.class);
        PolicyBuilder builder = control.createMock(PolicyBuilder.class);
        LocalServiceModelReferenceResolver resolver =
            new LocalServiceModelReferenceResolver(di, builder);
       
        List<UnknownExtensibilityElement> extensions = new ArrayList<UnknownExtensibilityElement>();
        EasyMock.expect(di.getExtensors(UnknownExtensibilityElement.class)).andReturn(extensions);
       
        control.replay();
        assertNull(resolver.resolveReference("A"));
        control.verify();
       
        control.reset();
        UnknownExtensibilityElement extension = control.createMock(UnknownExtensibilityElement.class);
        extensions.add(extension);
        EasyMock.expect(di.getExtensors(UnknownExtensibilityElement.class)).andReturn(extensions);
        Element e = control.createMock(Element.class);
        EasyMock.expect(extension.getElement()).andReturn(e).times(2);
        QName qn = new QName(Constants.URI_POLICY_NS,
                             Constants.ELEM_POLICY);
        EasyMock.expect(extension.getElementType()).andReturn(qn).anyTimes();
View Full Code Here

            InputSource src = resolver.resolve(uri, "classpath:");
            if (src != null) {
                try {
                    Document doc = StaxUtils.read(StaxUtils.createXMLStreamReader(src));
                    if (service.getDescription() == null && cls != null) {
                        service.setDescription(new DescriptionInfo());
                        service.getDescription().setBaseURI(cls.getResource("/").toString());
                    }
                   
                    uri = doc.getDocumentElement().getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
                                                                  PolicyConstants.WSU_ID_ATTR_NAME);
View Full Code Here

               
                uel = new UnknownExtensibilityElement();
                uel.setElement(pr);
                uel.setElementType(DOMUtils.getElementQName(pr));
                if (bindingInfo.getService().getDescription() == null) {
                    DescriptionInfo description = new DescriptionInfo();
                    description.setName(bindingInfo.getService().getName());
                    bindingInfo.getService().setDescription(description);
                    bindingInfo.setDescription(description);
                }
                bindingInfo.getService().getDescription().addExtensor(uel);
               
View Full Code Here

     *
     * @param bi the BindingOperationInfo identifying the operation in relation to a port
     * @return the effective policy
     */
    public Policy getEffectivePolicy(BindingOperationInfo bi) {
        DescriptionInfo di = bi.getBinding().getDescription();
        Policy p = getElementPolicy(bi, false, di);
        p = mergePolicies(p, getElementPolicy(bi.getOperationInfo(), false, di));
        return p;
    }
View Full Code Here

     * @param bmi the BindingMessageInfo identifiying the message
     * @return the effective policy
     */
    public Policy getEffectivePolicy(BindingMessageInfo bmi) {
        ServiceInfo si = bmi.getBindingOperation().getBinding().getService();
        DescriptionInfo di = si.getDescription();
        Policy p = getElementPolicy(bmi, false, di);
        MessageInfo mi = bmi.getMessageInfo();
        p = mergePolicies(p, getElementPolicy(mi, true, di));
        Extensible ex = getMessageTypeInfo(mi.getName(), di);
        p = mergePolicies(p, getElementPolicy(ex, false, di));
View Full Code Here

   

   
    public Policy getEffectivePolicy(BindingFaultInfo bfi) {
        ServiceInfo si = bfi.getBindingOperation().getBinding().getService();
        DescriptionInfo di = si.getDescription();

        Policy p = getElementPolicy(bfi, false, di);
        FaultInfo fi = bfi.getFaultInfo();
        p = mergePolicies(p, getElementPolicy(fi, true, di));
        Extensible ex = getMessageTypeInfo(fi.getName(), di);
View Full Code Here

        }
        return serviceList;
    }

    public ServiceInfo buildMockService(Definition def, PortType p) {
        DescriptionInfo description = new DescriptionInfo();
        if (recordOriginal) {
            description.setProperty(WSDL_DEFINITION, def);
        }
        description.setName(def.getQName());
        description.setBaseURI(def.getDocumentBaseURI());
        copyExtensors(description, def.getExtensibilityElements());
        copyExtensionAttributes(description, def);

        ServiceInfo service = new ServiceInfo();
        service.setDescription(description);
View Full Code Here

                                            Service serv,
                                            QName endpointName,
                                            DescriptionInfo d) {
        Map<QName, ServiceInfo> services = new LinkedHashMap<QName, ServiceInfo>();

        DescriptionInfo description = d;
        if (null == description) {
            description = new DescriptionInfo();
            if (recordOriginal) {
                description.setProperty(WSDL_DEFINITION, def);
            }
            description.setName(def.getQName());
            description.setBaseURI(def.getDocumentBaseURI());
            copyExtensors(description, def.getExtensibilityElements());
            copyExtensionAttributes(description, def);

            Set<Definition> done = new HashSet<Definition>();
            done.add(def);
            Collection<List<Import>> values = CastUtils.cast(def.getImports().values());
            for (List<Import> imports : values) {
                for (Import imp : imports) {
                    if (!done.contains(imp.getDefinition())) {
                        done.add(imp.getDefinition());
                        copyExtensors(description, imp.getExtensibilityElements());
                        copyExtensionAttributes(description, imp);
                        copyExtensors(description, imp.getDefinition().getExtensibilityElements());
                        copyExtensionAttributes(description, imp.getDefinition());
                    }
                }
            }
        }
        for (Port port : cast(serv.getPorts().values(), Port.class)) {
            if (endpointName != null
                && !endpointName.getLocalPart().equals(port.getName())) {
                continue;
            }
            Binding binding = port.getBinding();
            PortType bindingPt = binding.getPortType();
            if (bindingPt == null) {
                org.apache.cxf.common.i18n.Message msg = new
                org.apache.cxf.common.i18n.Message("BINDING_MISSING_TYPE",
                                                   LOG,
                                                   binding.getQName());
                throw new WSDLRuntimeException(msg);
            }

            //TODO: wsdl4j's bug. if there is recursive import,
            //wsdl4j can not get operation input message
            PortType pt = def.getPortType(bindingPt.getQName());
            if (pt == null) {
                pt = bindingPt;
            }
            ServiceInfo service = services.get(pt.getQName());
            if (service == null) {
                service = new ServiceInfo();
                service.setDescription(description);
                description.getDescribed().add(service);
                if (recordOriginal) {
                    service.setProperty(WSDL_DEFINITION, def);
                    service.setProperty(WSDL_SERVICE, serv);
                }
                getSchemas(def, service);
View Full Code Here

TOP

Related Classes of org.apache.cxf.service.model.DescriptionInfo

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.