Package com.betfair.cougar.transport.api.protocol.http.soap

Examples of com.betfair.cougar.transport.api.protocol.http.soap.SoapServiceBindingDescriptor


    @Override
    public void onCougarStart() {
        SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        for (ServiceBindingDescriptor sd : getServiceBindingDescriptors()) {
            SoapServiceBindingDescriptor soapServiceDesc = (SoapServiceBindingDescriptor) sd;
            try {
                // we'll load the schema content and create a Schema object once, as this is threadsafe and so can be reused
                // this should cut down on some memory usage and remove schema parsing from the critical path when validating
                try (InputStream is = soapServiceDesc.getClass().getClassLoader().getResourceAsStream(soapServiceDesc.getSchemaPath())) {
                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    StreamUtils.copy(is, baos);
                    String schemaContent = baos.toString();
                    Schema schema = schemaFactory.newSchema(new StreamSource(new StringReader(schemaContent)));
                    String uriVersionStripped = stripMinorVersionFromUri(soapServiceDesc.getServiceContextPath() + soapServiceDesc.getServiceVersion());
                    for (OperationBindingDescriptor desc : soapServiceDesc.getOperationBindings()) {
                        SoapOperationBindingDescriptor soapOpDesc = (SoapOperationBindingDescriptor) desc;
                        OperationDefinition opDef = getOperationDefinition(soapOpDesc.getOperationKey());
                        String operationName = uriVersionStripped + "/" + soapOpDesc.getRequestName().toLowerCase();
                        bindings.put(operationName,
                                new SoapOperationBinding(opDef, soapOpDesc,
View Full Code Here


    @Override
    public void onCougarStart() {
        SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        for (ServiceBindingDescriptor sd : getServiceBindingDescriptors()) {
            SoapServiceBindingDescriptor soapServiceDesc = (SoapServiceBindingDescriptor) sd;
            try {
                // we'll load the schema content and create a Schema object once, as this is threadsafe and so can be reused
                // this should cut down on some memory usage and remove schema parsing from the critical path when validating
                try (InputStream is = soapServiceDesc.getClass().getClassLoader().getResourceAsStream(soapServiceDesc.getSchemaPath())) {
                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    StreamUtils.copy(is, baos);
                    String schemaContent = baos.toString();
                    Schema schema = schemaFactory.newSchema(new StreamSource(new StringReader(schemaContent)));
                    String uriVersionStripped = stripMinorVersionFromUri(soapServiceDesc.getServiceContextPath() + soapServiceDesc.getServiceVersion());
                    for (OperationBindingDescriptor desc : soapServiceDesc.getOperationBindings()) {
                        SoapOperationBindingDescriptor soapOpDesc = (SoapOperationBindingDescriptor) desc;
                        OperationDefinition opDef = getOperationDefinition(soapOpDesc.getOperationKey());
                        String operationName = uriVersionStripped + "/" + soapOpDesc.getRequestName().toLowerCase();
                        bindings.put(operationName,
                                new SoapOperationBinding(opDef, soapOpDesc,
View Full Code Here

TOP

Related Classes of com.betfair.cougar.transport.api.protocol.http.soap.SoapServiceBindingDescriptor

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.