Search in sources :

Example 1 with JaxRpcTypeInfo

use of org.apache.openejb.server.axis.assembler.JaxRpcTypeInfo in project tomee by apache.

the class JavaServiceDescBuilder method createServiceDesc.

public JavaServiceDesc createServiceDesc() throws OpenEJBException {
    Class serviceEndpointInterface;
    try {
        serviceEndpointInterface = classLoader.loadClass(serviceInfo.serviceEndpointInterface);
    } catch (ClassNotFoundException e) {
        throw new OpenEJBException("Unable to load the service endpoint interface " + serviceInfo.serviceEndpointInterface, e);
    }
    JavaServiceDesc serviceDesc = new JavaServiceDesc();
    serviceDesc.setName(serviceInfo.name);
    serviceDesc.setEndpointURL(serviceInfo.endpointURL);
    serviceDesc.setWSDLFile(serviceInfo.wsdlFile);
    BindingStyle bindingStyle = serviceInfo.defaultBindingStyle;
    switch(bindingStyle) {
        case RPC_ENCODED:
            serviceDesc.setStyle(Style.RPC);
            serviceDesc.setUse(Use.ENCODED);
            break;
        case RPC_LITERAL:
            serviceDesc.setStyle(Style.RPC);
            serviceDesc.setUse(Use.LITERAL);
            break;
        case DOCUMENT_ENCODED:
            serviceDesc.setStyle(Style.DOCUMENT);
            serviceDesc.setUse(Use.ENCODED);
            break;
        case DOCUMENT_LITERAL:
            serviceDesc.setStyle(Style.DOCUMENT);
            serviceDesc.setUse(Use.LITERAL);
            break;
        case DOCUMENT_LITERAL_WRAPPED:
            serviceDesc.setStyle(Style.WRAPPED);
            serviceDesc.setUse(Use.LITERAL);
            break;
    }
    // Operations
    for (JaxRpcOperationInfo operationInfo : serviceInfo.operations) {
        OperationDesc operationDesc = buildOperationDesc(operationInfo, serviceEndpointInterface);
        serviceDesc.addOperationDesc(operationDesc);
    }
    // Type mapping registry
    TypeMappingRegistryImpl typeMappingRegistry = new TypeMappingRegistryImpl();
    typeMappingRegistry.doRegisterFromVersion("1.3");
    serviceDesc.setTypeMappingRegistry(typeMappingRegistry);
    // Type mapping
    TypeMapping typeMapping = typeMappingRegistry.getOrMakeTypeMapping(serviceDesc.getUse().getEncoding());
    serviceDesc.setTypeMapping(typeMapping);
    // Types
    for (JaxRpcTypeInfo type : serviceInfo.types) {
        registerType(type, typeMapping);
    }
    return new ReadOnlyServiceDesc(serviceDesc);
}
Also used : OpenEJBException(org.apache.openejb.OpenEJBException) BindingStyle(org.apache.openejb.server.axis.assembler.BindingStyle) JavaServiceDesc(org.apache.axis.description.JavaServiceDesc) JaxRpcOperationInfo(org.apache.openejb.server.axis.assembler.JaxRpcOperationInfo) TypeMappingRegistryImpl(org.apache.axis.encoding.TypeMappingRegistryImpl) TypeMapping(org.apache.axis.encoding.TypeMapping) JaxRpcTypeInfo(org.apache.openejb.server.axis.assembler.JaxRpcTypeInfo) OperationDesc(org.apache.axis.description.OperationDesc)

Aggregations

JavaServiceDesc (org.apache.axis.description.JavaServiceDesc)1 OperationDesc (org.apache.axis.description.OperationDesc)1 TypeMapping (org.apache.axis.encoding.TypeMapping)1 TypeMappingRegistryImpl (org.apache.axis.encoding.TypeMappingRegistryImpl)1 OpenEJBException (org.apache.openejb.OpenEJBException)1 BindingStyle (org.apache.openejb.server.axis.assembler.BindingStyle)1 JaxRpcOperationInfo (org.apache.openejb.server.axis.assembler.JaxRpcOperationInfo)1 JaxRpcTypeInfo (org.apache.openejb.server.axis.assembler.JaxRpcTypeInfo)1