Examples of SOAPBuilder


Examples of org.apache.axis2.builder.SOAPBuilder

        }
        assertNotNull("Result of processing did not include a certificate", usedCert);
    }

    private void buildSOAPEnvelope(MessageContext ctx) throws Exception {
        SOAPBuilder soapBuilder = new SOAPBuilder();
        SOAPEnvelope env = ctx.getEnvelope();
        ByteArrayInputStream inStream = new ByteArrayInputStream(env.toString().getBytes());
        env = (SOAPEnvelope) soapBuilder.processDocument(inStream, getContentTypeForEnvelope(env), ctx);
        ctx.setEnvelope(env);
    }
View Full Code Here

Examples of org.apache.axis2.builder.SOAPBuilder

        Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
        if (builder == null) {
            if (log.isDebugEnabled()) {
                log.debug("No message builder found for type '" + type + "'. Falling back to SOAP.");
            }
            builder = new SOAPBuilder();
        }
       
        OMElement documentElement;
        if (message instanceof BytesMessage) {
            // Extract the charset encoding from the content type and
View Full Code Here

Examples of org.apache.axis2.builder.SOAPBuilder

                MessageContextBuilder.switchNamespacePrefix(":" + SOAPConstants.FAULT_CODE_VERSION_MISMATCH, nsp));
    }
   
    public void testElementNamespaces() throws Exception {
        File file = getTestResourceFile("soapmessage.xml");
        SOAPBuilder soapBuilder = new SOAPBuilder();
        FileInputStream fis = new FileInputStream(file);
        MessageContext mc = new MessageContext();
       
        //Set up a mock envelope
        try {  
            OMElement envelope = soapBuilder.processDocument(fis, SOAP11Constants.SOAP_11_CONTENT_TYPE, mc);  
        } catch (Exception e) {
        }

        SOAPProcessingException e =  new SOAPProcessingException(
            "Transport level information does not match with SOAP" +
View Full Code Here

Examples of org.apache.axis2.builder.SOAPBuilder

        Builder builder = MessageProcessorSelector.getMessageBuilder(type, msgContext);
        if (builder == null) {
            if (log.isDebugEnabled()) {
                log.debug("No message builder found for type '" + type + "'. Falling back to SOAP.");
            }
            builder = new SOAPBuilder();
        }
       
        OMElement documentElement;
        if (message instanceof BytesMessage) {
            // Extract the charset encoding from the content type and
View Full Code Here

Examples of org.apache.axis2.builder.SOAPBuilder

            /*
            * Add Axis2 default builders if they are not overidden by the config
            */
            axisConfig.addMessageBuilder("multipart/related", new MIMEBuilder());
            axisConfig.addMessageBuilder("application/soap+xml", new SOAPBuilder());
            axisConfig.addMessageBuilder("text/xml", new SOAPBuilder());
            axisConfig.addMessageBuilder("application/xop+xml", new MTOMBuilder());
            // process MessageBuilders
            OMElement messageBuildersElement =
                    config_element.getFirstChildWithName(new QName(TAG_MESSAGE_BUILDERS));
            if (messageBuildersElement != null) {
View Full Code Here

Examples of org.reficio.ws.builder.SoapBuilder

    public static void registerAutoResponderForAllServiceBindings(SoapServer server, int testServiceId, Wsdl parser) {
        for (QName bindingName : parser.getBindings()) {
            String contextPath = TestUtils.formatContextPath(testServiceId, bindingName);
            log.info(String.format("Registering auto responder for service [%d] undex context path [%s]", testServiceId, contextPath));
            SoapContext context = SoapContext.builder().exampleContent(true).build();
            SoapBuilder builder = parser.binding().name(bindingName).find();
            server.registerRequestResponder(contextPath, new AutoResponder(builder, context));
        }
    }
View Full Code Here

Examples of org.reficio.ws.builder.SoapBuilder

        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) {
                    // test both with and without soap action
                    testOperation(clientBuilder, builder, operation, endpointUrl, Boolean.TRUE);
                    testOperation(clientBuilder, builder, operation, endpointUrl, Boolean.FALSE);
                } else {
View Full Code Here

Examples of org.reficio.ws.builder.SoapBuilder

    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);

        server.start();
View Full Code Here

Examples of org.reficio.ws.builder.SoapBuilder

                .build();
        return new AutoResponder(builder, context);
    }

    private SoapBuilder getBuilder(Wsdl parser) {
        SoapBuilder builder = null;
        try {
            builder = parser.binding().name(binding).find();
        } catch (SoapException ex) {
            // ignore
        }
View Full Code Here

Examples of org.reficio.ws.builder.SoapBuilder

                .build();
        server.start();

        URL wsdlUrl = ResourceUtils.getResourceWithAbsolutePackagePath("/", "wsdl/stockquote-service.wsdl");
        Wsdl parser = Wsdl.parse(wsdlUrl);
        SoapBuilder builder = parser.binding().localPart("StockQuoteSoapBinding").find();
        AutoResponder responder = new AutoResponder(builder);

        server.registerRequestResponder("/service", responder);
        server.stop();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.