Package org.apache.servicemix.soap.marshalers

Examples of org.apache.servicemix.soap.marshalers.SoapMarshaler


        int state = new HttpClient().executeMethod(method);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        FileUtil.copyInputStream(method.getResponseBodyAsStream(), baos);
        System.err.println(baos.toString());
        assertEquals(HttpServletResponse.SC_OK, state);
        SoapMessage msg = new SoapMarshaler().createReader().read(new ByteArrayInputStream(baos.toByteArray()), method.getResponseHeader("Content-Type").getValue());
        DataHandler att = (DataHandler) msg.getAttachments().values().iterator().next();
        ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
        IoUtil.copyStream(att.getInputStream(), baos2);
        assertEquals("<xsl:stylesheet />", baos2.toString());
        assertEquals(1, msg.getAttachments().size());
View Full Code Here


        }
        System.out.println("Path to login config: " + path);
    }

    public void testUserNameToken() throws Exception {
        SoapMarshaler marshaler = new SoapMarshaler(true, true);
        SoapReader reader = marshaler.createReader();
        SoapMessage msg = reader.read(getClass().getResourceAsStream("sample-wsse-request.xml"));
        Context ctx = new Context();
        ctx.setInMessage(msg);
       
        WSSecurityHandler handler = new WSSecurityHandler();
View Full Code Here

        assertNotNull(ctx.getInMessage().getSubject().getPrincipals());
        assertTrue(ctx.getInMessage().getSubject().getPrincipals().size() > 0);
    }
   
    public void testSignatureRoundtrip() throws Exception {
        SoapMarshaler marshaler = new SoapMarshaler(true, true);
        SoapMessage msg = new SoapMessage();
        Context ctx = new Context();
        ctx.setInMessage(msg);
        msg.setSource(new StringSource("<hello>world</hello>"));
        SoapWriter writer = marshaler.createWriter(ctx.getInMessage());
        W3CDOMStreamWriter domWriter = new W3CDOMStreamWriter();
        writer.writeSoapEnvelope(domWriter);
        ctx.getInMessage().setDocument(domWriter.getDocument());
       
        StandaloneCrypto crypto = new StandaloneCrypto();
View Full Code Here

        assertNotNull(ctx.getInMessage().getSubject().getPrincipals());
        assertTrue(ctx.getInMessage().getSubject().getPrincipals().size() > 0);
    }
   
    public void testSignatureServer() throws Exception {
        SoapMarshaler marshaler = new SoapMarshaler(true, true);
        SoapReader reader = marshaler.createReader();
        SoapMessage msg = reader.read(getClass().getResourceAsStream("signed.xml"));
        Context ctx = new Context();
        ctx.setInMessage(msg);
       
        StandaloneCrypto crypto = new StandaloneCrypto();
View Full Code Here

        assertNotNull(ctx.getInMessage().getSubject().getPrincipals());
        assertTrue(ctx.getInMessage().getSubject().getPrincipals().size() > 0);
    }
   
    public void testBadSignatureServer() throws Exception {
        SoapMarshaler marshaler = new SoapMarshaler(true, true);
        SoapReader reader = marshaler.createReader();
        SoapMessage msg = reader.read(getClass().getResourceAsStream("signed-bad.xml"));
        Context ctx = new Context();
        ctx.setInMessage(msg);
       
        StandaloneCrypto crypto = new StandaloneCrypto();
View Full Code Here

TOP

Related Classes of org.apache.servicemix.soap.marshalers.SoapMarshaler

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.