Package org.apache.axis.message

Examples of org.apache.axis.message.SOAPHeader


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

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


     * 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

           
            Message msg = context.getResponseMessage();
            if (msg == null)
                return;
            SOAPEnvelope env = msg.getSOAPEnvelope();
            SOAPHeader header = new SOAPHeader(HEADER_NS,
                                               HEADER_RESNAME,
                                               strVal);
            env.addHeader(header);
        } else {
            // Request. look for the header
            Message msg = context.getRequestMessage();
            if (msg == null)
                throw new AxisFault(JavaUtils.getMessage("noRequest00"));
           
            SOAPEnvelope env = msg.getSOAPEnvelope();
            SOAPHeader header = env.getHeaderByName(HEADER_NS,
                                                    HEADER_REQNAME);
           
            if (header != null) {
                // seems Axis has already ignored any headers not tageted
                // at us
                String strVal ;
                // header.getValue() doesn't seem to be connected to anything
                // we always get null.
                try {
                    strVal = (String)header.getValueAsType(Constants.XSD_STRING);
                } catch (Exception e) {
                    throw AxisFault.makeFault(e);
                }
                context.setProperty(ECHOHEADER_STRING_ID, strVal) ;
            }
View Full Code Here

           
            Message msg = context.getResponseMessage();
            if (msg == null)
                return;
            SOAPEnvelope env = msg.getSOAPEnvelope();
            SOAPHeader header = new SOAPHeader(HEADER_NS,
                                               HEADER_RESNAME,
                                               hdrVal);
            env.addHeader(header);
        } else {
            // Request. look for the header
            Message msg = context.getRequestMessage();
            if (msg == null)
                throw new AxisFault(JavaUtils.getMessage("noRequest00"));
           
            SOAPEnvelope env = msg.getSOAPEnvelope();
            SOAPHeader header = env.getHeaderByName(HEADER_NS,
                                                    HEADER_REQNAME);
           
            if (header != null) {
                // seems Axis has already ignored any headers not tageted
                // at us
                SOAPStruct hdrVal ;
                // header.getValue() doesn't seem to be connected to anything
                // we always get null.
                try {
                    hdrVal = (SOAPStruct)header.getValueAsType(SOAPStructType);
                } catch (Exception e) {
                    throw AxisFault.makeFault(e);
                }
                context.setProperty(ECHOHEADER_STRUCT_ID, hdrVal) ;
            }
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.