Java Code Examples for org.apache.cxf.service.model.ServiceInfo#getProperty()

The following examples show how to use org.apache.cxf.service.model.ServiceInfo#getProperty() . 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 File: TypeMapCache.java    From cxf with Apache License 2.0 6 votes vote down vote up
public static CorbaTypeMap get(ServiceInfo service) {
    if (service != null) {
        synchronized (service) {
            CorbaTypeMap map = service.getProperty(KEY, CorbaTypeMap.class);
            if (map == null) {
                List<TypeMappingType> corbaTypes = service.getDescription()
                        .getExtensors(TypeMappingType.class);
                if (corbaTypes != null) {
                    map = CorbaUtils.createCorbaTypeMap(corbaTypes);
                    service.setProperty(KEY, map);
                }
            }
            return map;
        }
    }
    return null;
}
 
Example 2
Source File: EndpointReferenceUtils.java    From cxf with Apache License 2.0 6 votes vote down vote up
public static Schema getSchema(ServiceInfo serviceInfo, Bus b) {
    if (serviceInfo == null) {
        return null;
    }
    Schema schema = serviceInfo.getProperty(Schema.class.getName(), Schema.class);
    if (schema == null && !serviceInfo.hasProperty(Schema.class.getName() + ".CHECKED")) {
        try {
            synchronized (serviceInfo) {
                return createSchema(serviceInfo, b);
            }
        } finally {
            serviceInfo.setProperty(Schema.class.getName() + ".CHECKED", Boolean.TRUE);
        }
    }
    return schema;
}
 
Example 3
Source File: SoapBindingFactory.java    From cxf with Apache License 2.0 5 votes vote down vote up
protected void addMessageFromBinding(ExtensibilityElement ext, BindingOperationInfo bop,
                                     boolean isInput) {
    SoapHeader header = SOAPBindingUtil.getSoapHeader(ext);

    ServiceInfo serviceInfo = bop.getBinding().getService();

    if (header != null && header.getMessage() == null) {
        throw new RuntimeException("Problem with WSDL: soap:header element"
            + " for operation " + bop.getName() + " under binding " + bop.getBinding().getName()
            + " does not contain a valid message attribute.");
    }

    if (header != null && serviceInfo.getMessage(header.getMessage()) == null) {
        Definition def = (Definition)serviceInfo.getProperty(WSDLServiceBuilder.WSDL_DEFINITION);
        SchemaCollection schemas = serviceInfo.getXmlSchemaCollection();

        if (def != null && schemas != null) {
            QName qn = header.getMessage();

            javax.wsdl.Message msg = findMessage(qn, def);
            if (msg != null) {
                addOutOfBandParts(bop, msg, schemas, isInput, header.getPart());
                serviceInfo.refresh();
            } else {
                throw new RuntimeException("Problem with WSDL: soap:header element"
                    + " for operation " + bop.getName()
                    + " is referring to an undefined wsdl:message element: " + qn);
            }
        }
    }
}