Package org.apache.axis.soap

Examples of org.apache.axis.soap.SOAPConstants


                typeQName = Constants.SOAP_ARRAY;

            // Set the encoding style to the attribute value.  If null,
            // we just automatically use our parent's (see getEncodingStyle)
            MessageContext mc = context.getMessageContext();
            SOAPConstants sc = (mc != null) ?
                                            mc.getSOAPConstants() :
                                            SOAPConstants.SOAP11_CONSTANTS;

            encodingStyle =
                    attributes.getValue(sc.getEncodingURI(),
                                        Constants.ATTR_ENCODING_STYLE);
        }
    }
View Full Code Here


         * Write the encoding style attribute IF it's different from
         * whatever encoding style is in scope....
         */
        if (encodingStyle != null) {
            MessageContext mc = context.getMessageContext();
            SOAPConstants soapConstants = (mc != null) ?
                                            mc.getSOAPConstants() :
                                            SOAPConstants.SOAP11_CONSTANTS;
            if (parent == null) {
                // don't emit an encoding style if its "" (literal)
                if (!encodingStyle.equals("")) {
                    setAttribute(soapConstants.getEnvelopeURI(),
                                 Constants.ATTR_ENCODING_STYLE,
                                 encodingStyle);
                }
            } else if (!encodingStyle.equals(parent.getEncodingStyle())) {
                setAttribute(soapConstants.getEnvelopeURI(),
                             Constants.ATTR_ENCODING_STYLE,
                             encodingStyle);
            }
        }

View Full Code Here

    /**
     * returns the soap constants.
     */
    private SOAPConstants getSOAPConstants(){
        SOAPConstants constants = null;
        if(msgContext != null)
            constants = msgContext.getSOAPConstants();
        if(constants == null)
            constants = SOAPConstants.SOAP11_CONSTANTS;
        return constants;
View Full Code Here

     * set a fault code string that is turned into a qname
     * in the axis namespace
     * @param code fault code
     */
    public void setFaultCodeAsString(String code) {
        SOAPConstants soapConstants = MessageContext.getCurrentContext() == null ?
                                        SOAPConstants.SOAP11_CONSTANTS :
                                        MessageContext.getCurrentContext().getSOAPConstants();
       
        faultCode = new QName(soapConstants.getEnvelopeURI(), code);
    }
View Full Code Here

    {
        super(elem);

        // FIXME : This needs to come from someplace reasonable, perhaps
        // TLS (SOAPConstants.getCurrentVersion() ?)
        SOAPConstants soapConstants = SOAPConstants.SOAP11_CONSTANTS;

        if (getNamespaceURI().equals(SOAPConstants.SOAP12_CONSTANTS.getEnvelopeURI()))
            soapConstants = SOAPConstants.SOAP12_CONSTANTS;

        String val = elem.getAttributeNS(soapConstants.getEnvelopeURI(),
                                         Constants.ATTR_MUST_UNDERSTAND);

        if (soapConstants == SOAPConstants.SOAP12_CONSTANTS)
            mustUnderstand = ((val != null) && val.equals("true")) ? true : false;
        else
            mustUnderstand = ((val != null) && val.equals("1")) ? true : false;

        QName roleQName = soapConstants.getRoleAttributeQName();
        actor = elem.getAttributeNS(roleQName.getNamespaceURI(),
                                    roleQName.getLocalPart());
        if (actor == null) {
            actor = "";
        }
View Full Code Here

    public SOAPHeaderElement(String namespace, String localPart, String prefix,
                      Attributes attributes, DeserializationContext context) {
        super(namespace, localPart, prefix, attributes, context);

        SOAPConstants soapConstants = context.getMessageContext() == null ?
                                        SOAPConstants.SOAP11_CONSTANTS :
                                        context.getMessageContext().getSOAPConstants();

        // Check for mustUnderstand
        String val = attributes.getValue(soapConstants.getEnvelopeURI(),
                                         Constants.ATTR_MUST_UNDERSTAND);

        if (soapConstants == SOAPConstants.SOAP12_CONSTANTS)
            mustUnderstand = ((val != null) && val.equals("true")) ? true : false;
        else
            mustUnderstand = ((val != null) && val.equals("1")) ? true : false;

        QName roleQName = soapConstants.getRoleAttributeQName();
        actor = attributes.getValue(roleQName.getNamespaceURI(),
                                    roleQName.getLocalPart());
        if (actor == null) {
            actor = "";
        }
View Full Code Here

    /** Subclasses can override
     */
    protected void outputImpl(SerializationContext context) throws Exception {
        if (!alreadySerialized) {
            SOAPConstants soapVer = getEnvelope().getSOAPConstants();
            QName roleQName = soapVer.getRoleAttributeQName();

            setAttribute(roleQName.getNamespaceURI(),
                         roleQName.getLocalPart(), actor);

            String val;
            if (context.getMessageContext() != null && context.getMessageContext().getSOAPConstants() == SOAPConstants.SOAP12_CONSTANTS)
                val = mustUnderstand ? "true" : "false";
            else
                val = mustUnderstand ? "1" : "0";

            setAttribute(soapVer.getEnvelopeURI(),
                         Constants.ATTR_MUST_UNDERSTAND,
                         val);
        }

        super.outputImpl(context);
View Full Code Here

    }
   
    public void outputImpl(SerializationContext context)
            throws IOException
    {
        SOAPConstants soapConstants = context.getMessageContext() == null ?
                                        SOAPConstants.SOAP11_CONSTANTS :
                                        context.getMessageContext().getSOAPConstants();

        namespaceURI = soapConstants.getEnvelopeURI();
        name = Constants.ELEM_FAULT;
       
        context.registerPrefixForURI(prefix, soapConstants.getEnvelopeURI());
        context.startElement(new QName(this.getNamespaceURI(),
                                       this.getName()),
                             attributes);
       
        // XXX - Can fault be anything but an AxisFault here?
View Full Code Here

        child.setParentElement(parent);
        assertEquals("Parent is not as set", parent, child.getParentElement());
    }

    public void testAddChild() throws Exception {
        SOAPConstants sc = SOAPConstants.SOAP11_CONSTANTS;
        EnvelopeBuilder eb = new EnvelopeBuilder(Message.REQUEST, sc);
        DeserializationContext dc = new DeserializationContextImpl(null,
                                                                   eb);
        MessageElement parent = new MessageElement("parent.names",
                                                "parent",
View Full Code Here

        Iterator c1only = parent.getChildElements(c1);
        assertEquals("Child 1 not found", child1, c1only.next());
        assertTrue("Unexpected child", !c1only.hasNext());
    }
    public void testDetachNode() throws Exception {
        SOAPConstants sc = SOAPConstants.SOAP11_CONSTANTS;
        EnvelopeBuilder eb = new EnvelopeBuilder(Message.REQUEST, sc);
        DeserializationContext dc = new DeserializationContextImpl(null,
                                                                   eb);
        SOAPElement parent = new MessageElement("parent.names",
                                                "parent",
View Full Code Here

TOP

Related Classes of org.apache.axis.soap.SOAPConstants

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.