Package org.apache.axis.message

Examples of org.apache.axis.message.SOAPHeader


     * Tests the happy path.
     *
     * @throws Exception
     */
    public void testExtractHeaderElements1() throws Exception {
        SOAPHeader header =
                (org.apache.axis.message.SOAPHeader) env.getHeader();
        Iterator iter = header.extractHeaderElements(ACTOR);

        // This would be a lot simpler if getHeadersByActor() were visible.
        SOAPHeaderElement headerElement = null;
        int expectedHeaders = 2;
        int foundHeaders = 0;
View Full Code Here


     * Tests when the user submits a null actor.
     *
     * @throws Exception
     */
    public void testExtractHeaderElements2() throws Exception {
        SOAPHeader header =
                (org.apache.axis.message.SOAPHeader) env.getHeader();
        Iterator iter = header.extractHeaderElements(null);

        // This would be a lot simpler if getHeadersByActor() were visible.
        SOAPHeaderElement headerElement = null;
        int expectedHeaders = 1;
        int foundHeaders = 0;
View Full Code Here

        category.debug(JavaUtils.getMessage("enter00", "DebugHandler::invoke") );
        try {
            Message       msg = msgContext.getRequestMessage();

            SOAPEnvelope message = (SOAPEnvelope)msg.getSOAPPart().getAsSOAPEnvelope();
            SOAPHeader header = message.getHeaderByName(Constants.URI_DEBUG,
                                                        "Debug");

            if (header != null) {
                Integer i = ((Integer)header
                             .getValueAsType(SOAPTypeMappingRegistry.XSD_INT));
                if (i == null)
                    throw new AxisFault(JavaUtils.getMessage("cantConvert03"));

                int debugVal = i.intValue();
                category.debug(JavaUtils.getMessage("debugLevel00", "" + debugVal) );
                //Debug.setDebugLevel(debugVal);
                header.setProcessed(true);
            }
        }
        catch( Exception e ) {
            category.error( e );
            throw AxisFault.makeFault(e);
View Full Code Here

            // This is a response.  Check it for the session header.
            Message msg = context.getResponseMessage();
            if (msg == null)
                return;
            SOAPEnvelope env = msg.getSOAPPart().getAsSOAPEnvelope();
            SOAPHeader header = env.getHeaderByName(SESSION_NS,
                                                    SESSION_LOCALPART);
            if (header == null)
                return;
           
            // Got one!
            try {
                Long id = (Long)header.
                             getValueAsType(SOAPTypeMappingRegistry.XSD_LONG);
                // Store it away.
                AxisEngine engine = context.getAxisEngine();
                engine.setOption(SESSION_ID, id);
            } catch (Exception e) {
                throw AxisFault.makeFault(e);
            }
        } else {
            AxisEngine engine = context.getAxisEngine();
            Long id = (Long)engine.getOption(SESSION_ID);
            if (id == null)
                return;
           
            // We have a session ID, so insert the header
            Message msg = context.getRequestMessage();
            if (msg == null)
                throw new AxisFault(JavaUtils.getMessage("noRequest00"));
           
            SOAPEnvelope env = msg.getSOAPPart().getAsSOAPEnvelope();
            SOAPHeader header = new SOAPHeader(SESSION_NS,
                                               SESSION_LOCALPART,
                                               id);
            env.addHeader(header);
        }
    }
View Full Code Here

           
            Message msg = context.getResponseMessage();
            if (msg == null)
                return;
            SOAPEnvelope env = msg.getSOAPPart().getAsSOAPEnvelope();
            SOAPHeader header = new SOAPHeader(SESSION_NS,
                                               SESSION_LOCALPART,
                                               id);
            env.addHeader(header);
        } else {
            // Request.  Set up the session if we find the header.
            Message msg = context.getRequestMessage();
            if (msg == null)
                throw new AxisFault(JavaUtils.getMessage("noRequest00"));
           
            SOAPEnvelope env = msg.getSOAPPart().getAsSOAPEnvelope();
            SOAPHeader header = env.getHeaderByName(SESSION_NS,
                                                    SESSION_LOCALPART);
            Long id;
           
            if (header != null) {
                // Got one!
                try {
                    id = (Long)header.
                            getValueAsType(SOAPTypeMappingRegistry.XSD_LONG);
                } catch (Exception e) {
                    throw AxisFault.makeFault(e);
                }
            } else {
View Full Code Here

            System.out.println("Beginning Client signing...");
            env.addMapping(new Mapping(SOAPSECNS, SOAPSECprefix));
            env.addAttribute(Constants.URI_SOAP_ENV, "actor", "some-uri");
            env.addAttribute(Constants.URI_SOAP_ENV, "mustUnderstand", "1");

            SOAPHeader header = new SOAPHeader(XMLUtils.StringToElement(SOAPSECNS, "Signature", ""));
            env.addHeader(header);

            Document doc = getSOAPEnvelopeAsDocument(env, msgContext);

            KeyStore ks = KeyStore.getInstance(keystoreType);
View Full Code Here

            // This is a response.  Check it for the session header.
            Message msg = context.getResponseMessage();
            if (msg == null)
                return;
            SOAPEnvelope env = msg.getSOAPEnvelope();
            SOAPHeader header = env.getHeaderByName(SESSION_NS,
                                                    SESSION_LOCALPART);
            if (header == null)
                return;
           
            // Got one!
            try {
                Long id = (Long)header.
                             getValueAsType(Constants.XSD_LONG);
                // Store it away.
                AxisEngine engine = context.getAxisEngine();
                engine.setOption(SESSION_ID, id);
            } catch (Exception e) {
                throw AxisFault.makeFault(e);
            }
        } else {
            AxisEngine engine = context.getAxisEngine();
            Long id = (Long)engine.getOption(SESSION_ID);
            if (id == null)
                return;
           
            // We have a session ID, so insert the header
            Message msg = context.getRequestMessage();
            if (msg == null)
                throw new AxisFault(JavaUtils.getMessage("noRequest00"));
           
            SOAPEnvelope env = msg.getSOAPEnvelope();
            SOAPHeader header = new SOAPHeader(SESSION_NS,
                                               SESSION_LOCALPART,
                                               id);
            env.addHeader(header);
        }
    }
View Full Code Here

           
            Message msg = context.getResponseMessage();
            if (msg == null)
                return;
            SOAPEnvelope env = msg.getSOAPEnvelope();
            SOAPHeader header = new SOAPHeader(SESSION_NS,
                                               SESSION_LOCALPART,
                                               id);
            env.addHeader(header);
        } else {
            // Request.  Set up the session if we find the header.
            Message msg = context.getRequestMessage();
            if (msg == null)
                throw new AxisFault(JavaUtils.getMessage("noRequest00"));
           
            SOAPEnvelope env = msg.getSOAPEnvelope();
            SOAPHeader header = env.getHeaderByName(SESSION_NS,
                                                    SESSION_LOCALPART);
            Long id;
           
            if (header != null) {
                // Got one!
                try {
                    id = (Long)header.
                            getValueAsType(Constants.XSD_LONG);
                } catch (Exception e) {
                    throw AxisFault.makeFault(e);
                }
            } else {
View Full Code Here

        log.debug(JavaUtils.getMessage("enter00", "DebugHandler::invoke") );
        try {
            Message       msg = msgContext.getRequestMessage();

            SOAPEnvelope message = (SOAPEnvelope)msg.getSOAPEnvelope();
            SOAPHeader header = message.getHeaderByName(Constants.URI_DEBUG,
                                                        "Debug");

            if (header != null) {
                Integer i = ((Integer)header
                             .getValueAsType(Constants.XSD_INT));
                if (i == null)
                    throw new AxisFault(JavaUtils.getMessage("cantConvert03"));

                int debugVal = i.intValue();
                log.debug(JavaUtils.getMessage("debugLevel00", "" + debugVal) );
                //Debug.setDebugLevel(debugVal);
                header.setProcessed(true);
            }
        }
        catch( Exception e ) {
            log.error( JavaUtils.getMessage("exception00"), e );
            throw AxisFault.makeFault(e);
View Full Code Here

     * Tests the happy path.
     *
     * @throws Exception
     */
    public void testExamineHeaderElements1() throws Exception {
        SOAPHeader header =
                (org.apache.axis.message.SOAPHeader) env.getHeader();
        Iterator iter = header.examineHeaderElements(ACTOR);

        // This would be a lot simpler if getHeadersByActor() were visible.
        SOAPHeaderElement headerElement = null;
        int expectedHeaders = 2;
        int foundHeaders = 0;
View Full Code Here

TOP

Related Classes of org.apache.axis.message.SOAPHeader

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.