Package org.reficio.ws.builder.core

Examples of org.reficio.ws.builder.core.Wsdl$SoapBuilderFinderImpl


    private final static Log log = LogFactory.getLog(TestUtils.class);

    public static Wsdl createParserForService(int testServiceId) throws WSDLException {
        String path = getTestServiceFolderPath(testServiceId);
        URL wsdlUrl = ResourceUtils.getResourceWithAbsolutePackagePath(path, "TestService.wsdl");
        Wsdl parser = Wsdl.parse(wsdlUrl);
        assertNotNull(parser);
        return parser;
    }
View Full Code Here


    public static String formatServiceId(int testServiceId) {
        return (testServiceId < 10) ? "0" + testServiceId : "" + testServiceId;
    }

    public static void registerService(SoapServer server, int testServiceId) throws WSDLException {
        Wsdl parser = TestUtils.createParserForService(testServiceId);
        registerAutoResponderForAllServiceBindings(server, testServiceId, parser);
    }
View Full Code Here

    }

    @Test(expected = SoapBuilderException.class)
    public void testParseWrongUrl() throws MalformedURLException {
        URL wsdlUrl = new URL("http://asd.com/asd.wsdl");
        Wsdl parser = Wsdl.parse(wsdlUrl);
        assertNotNull(parser);
    }
View Full Code Here

    }

    @Test
    public void testParseTestWsdl() {
        URL wsdlUrl = ResourceUtils.getResourceWithAbsolutePackagePath("wsdl", "TestService.wsdl");
        Wsdl parser = Wsdl.parse(wsdlUrl);
        assertNotNull(parser);

        List<QName> bindings = parser.getBindings();
        String expectedBindingString = "{http://schemas.eviware.com/TestService/v1/}TestServiceSoap";
        QName expectedBinding = QName.valueOf(expectedBindingString);

        assertEquals(1, bindings.size());
        assertEquals(expectedBinding, bindings.iterator().next());

        assertNotNull(parser.binding().name(expectedBindingString).find());
        assertNotNull(parser.binding().name(expectedBinding).find());
    }
View Full Code Here

    }

    @Test(expected = NullPointerException.class)
    public void testParseTestWsdlNullContext() {
        URL wsdlUrl = ResourceUtils.getResourceWithAbsolutePackagePath("wsdl", "TestService.wsdl");
        Wsdl parser = Wsdl.parse(wsdlUrl);
        String expectedBindingString = "{http://schemas.eviware.com/TestService/v1/}TestServiceSoap";
        parser.binding().name(expectedBindingString).find(null);
    }
View Full Code Here

    }

    @Test
    public void testParseTestWsdlProperContext() {
        URL wsdlUrl = ResourceUtils.getResourceWithAbsolutePackagePath("wsdl", "TestService.wsdl");
        Wsdl parser = Wsdl.parse(wsdlUrl);
        String expectedBindingString = "{http://schemas.eviware.com/TestService/v1/}TestServiceSoap";
        SoapContext context = SoapContext.builder().typeComments(true).build();
        SoapBuilder builder = parser.binding().name(expectedBindingString).find(context);

        assertEquals(context, builder.getContext());
    }
View Full Code Here

public class SoapOperationFinderImplTest {

    public SoapOperationFinder operation() {
        URL wsdlUrl = ResourceUtils.getResourceWithAbsolutePackagePath("wsdl", "TestService.wsdl");
        Wsdl parser = Wsdl.parse(wsdlUrl);
        String binding = "{http://schemas.eviware.com/TestService/v1/}TestServiceSoap";
        return parser.binding().name(binding).find().operation();
    }
View Full Code Here


    @SuppressWarnings("unchecked")
    private static void testService(int testServiceId) throws Exception {
        URL wsdlUrl = getDefinitionUrl(testServiceId);
        Wsdl parser = Wsdl.parse(wsdlUrl);
        SoapContext context = SoapContext.builder()
                .exampleContent(false)
                .build();
        for (QName bindingQName : parser.getBindings()) {
            String bindingName = bindingQName.getLocalPart();
            SoapBuilder builder = parser.binding().name(bindingQName).find();
            for (SoapOperation operation : builder.getOperations()) {
                String request = builder.buildInputMessage(operation);
                String expectedRequest = getExpectedRequest(testServiceId, bindingName, operation.getOperationName());
                log.info(String.format("Comparing binding=[%s] operation=[%s]", bindingName, operation.getOperationName()));
                log.info("REQUEST:\n" + request);
View Full Code Here

        verifyServiceBehavior(testServiceId, new ClientBuilderImpl());
    }

    protected void verifyServiceBehavior(int testServiceId, Boolean postSoapAction, ClientBuilder clientBuilder) throws Exception {
        log.info(String.format("------------------- TESTING SERVICE [%d] -----------------------", testServiceId));
        Wsdl parser = TestUtils.createParserForService(testServiceId);
        registerHandler(server, testServiceId, parser);

        for (QName bindingName : parser.getBindings()) {
            SoapBuilder builder = parser.binding().name(bindingName).find();
            String contextPath = TestUtils.formatContextPath(testServiceId, builder.getBindingName());
            String endpointUrl = formatEndpointAddress(contextPath);

            for (SoapOperation operation : builder.getOperations()) {
                if (postSoapAction == null) {
View Full Code Here

    }

    public SoapServer initServer() {
        validate();
        URL wsdlUrl = getWsdlUrl(testClass);
        Wsdl parser = Wsdl.parse(wsdlUrl);
        SoapBuilder builder = getBuilder(parser);
        server = construct();
        AutoResponder responder = getAutoResponder(builder);
        registerService(server, responder);
View Full Code Here

TOP

Related Classes of org.reficio.ws.builder.core.Wsdl$SoapBuilderFinderImpl

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.