Package org.apache.axis.soap

Examples of org.apache.axis.soap.SOAPConstants


            } else if (responseMessage == null) {
                res.setStatus(HttpServletResponse.SC_ACCEPTED);
                return;
            }
            try {
                SOAPConstants soapConstants = messageContext.getSOAPConstants();
                String contentType1 = responseMessage.getContentType(soapConstants);
                res.setContentType(contentType1);
                // Transfer MIME headers to HTTP headers for response message.
                MimeHeaders responseMimeHeaders = responseMessage.getMimeHeaders();
                for (Iterator i = responseMimeHeaders.getAllHeaders(); i.hasNext();) {
View Full Code Here


            throw new IOException(Messages.getMessage("can not serialize!"));
  }

        MessageContext msgContext = context.getMessageContext();
        SchemaVersion schema = SchemaVersion.SCHEMA_2001;
        SOAPConstants soap = SOAPConstants.SOAP11_CONSTANTS;
        if(msgContext != null) {
            schema = msgContext.getSchemaVersion();
            soap = msgContext.getSOAPConstants();
        }

  try {
      int typeIdx = attributes.getIndex (schema.getXsiURI(), "type");
      if (typeIdx >= 0) {
    String prefixForSoapEnc
        = context.getPrefixForURI(soap.getEncodingURI());
    if (logger.isDebugEnabled ()) {
        logger.debug
      ("Type is \"" + attributes.getValue(typeIdx) + "\""
       + " (\""+prefixForSoapEnc+":Array\" denotes array)");
    }
    if (attributes.getValue(typeIdx)
        .equals(prefixForSoapEnc + ":Array")
        && attributes.getIndex(soap.getEncodingURI(),
             soap.getAttrItemType()) == -1) {
        AttributesImpl attrs = new AttributesImpl (attributes);
        attrs.addAttribute
      (soap.getEncodingURI(), soap.getAttrItemType(),
       prefixForSoapEnc + ":arrayType", "CDATA",
       determineArrayType ((SAXEventBuffer)value, context));
        attributes = attrs;
    }
      }
View Full Code Here

        String id = attributes.getValue("id");
        if (id != null) {
            context.addObjectById(id, value);
        }

        SOAPConstants soapConstants
      = context.getMessageContext().getSOAPConstants();
        String href = attributes.getValue(soapConstants.getAttrHref());
        if (href == null) {
            onStartElement(namespace, localName, prefix, attributes, context);
  } else {
            Object ref = context.getObjectByRef(href);           
            if (ref == null) {
View Full Code Here

        }
        context.pushNewElement(myElement);
      }
    }

    SOAPConstants soapConstants = context.getMessageContext().getSOAPConstants();

    QName type = context.getTypeFromAttributes(namespace, localName, attributes);
    if (log.isDebugEnabled()) {
      log.debug(Messages.getMessage("gotType00", "Deser", "" + type));
    }

    String href = attributes.getValue(soapConstants.getAttrHref());
    // System.out.println(soapConstants.getAttrHref() + " = " + href);
    if (href != null) {
      Object ref = context.getObjectByRef(href);
      // System.out.println(ref.getClass().getName());
      // System.out.println(ref);
      if (ref instanceof SOAPBodyElement) // multiref, deref. again
      {
        SOAPBodyElement bodyElem = (SOAPBodyElement) ref;
        href = bodyElem.getAttributeValue(soapConstants.getAttrHref());
        ref = context.getObjectByRef(href);
        // System.out.println(ref.getClass().getName());
        // System.out.println(ref);
      }
      if (ref instanceof org.apache.axis.Part) {
View Full Code Here

        }
        context.pushNewElement(myElement);
      }
    }

    SOAPConstants soapConstants = context.getMessageContext().getSOAPConstants();

    QName type = context.getTypeFromAttributes(namespace, localName, attributes);
    if (log.isDebugEnabled()) {
      log.debug(Messages.getMessage("gotType00", "Deser", "" + type));
    }

    String href = attributes.getValue(soapConstants.getAttrHref());
    // System.out.println(soapConstants.getAttrHref() + " = " + href);
    if (href != null) {
      Object ref = context.getObjectByRef(href);
      // System.out.println(ref.getClass().getName());
      // System.out.println(ref);
      if (ref instanceof SOAPBodyElement) // multiref, deref. again
      {
        SOAPBodyElement bodyElem = (SOAPBodyElement) ref;
        href = bodyElem.getAttributeValue(soapConstants.getAttrHref());
        ref = context.getObjectByRef(href);
        // System.out.println(ref.getClass().getName());
        // System.out.println(ref);
      }
      if (ref instanceof org.apache.axis.Part) {
View Full Code Here

            } else if (responseMessage == null) {
                res.setStatusCode(202);
                return;
            }
            try {
                SOAPConstants soapConstants = messageContext.getSOAPConstants();
                String contentType1 = responseMessage.getContentType(soapConstants);
                res.setContentType(contentType1);
                // Transfer MIME headers to HTTP headers for response message.
                MimeHeaders responseMimeHeaders = responseMessage.getMimeHeaders();
                for (Iterator i = responseMimeHeaders.getAllHeaders(); i.hasNext();) {
View Full Code Here

        }
        context.pushNewElement(myElement);
      }
    }

    SOAPConstants soapConstants = context.getMessageContext().getSOAPConstants();

    QName type = context.getTypeFromAttributes(namespace, localName, attributes);
    if (log.isDebugEnabled()) {
      log.debug(Messages.getMessage("gotType00", "Deser", "" + type));
    }

    String href = attributes.getValue(soapConstants.getAttrHref());
    // System.out.println(soapConstants.getAttrHref() + " = " + href);
    if (href != null) {
      Object ref = context.getObjectByRef(href);
      // System.out.println(ref.getClass().getName());
      // System.out.println(ref);
      if (ref instanceof SOAPBodyElement) // multiref, deref. again
      {
        SOAPBodyElement bodyElem = (SOAPBodyElement) ref;
        href = bodyElem.getAttributeValue(soapConstants.getAttrHref());
        ref = context.getObjectByRef(href);
        // System.out.println(ref.getClass().getName());
        // System.out.println(ref);
      }
      if (ref instanceof org.apache.axis.Part) {
View Full Code Here

                || context.getMessageContext().getRequestMessage().getAttachments().hasNext();
      }
      // if we have attachment support, do this as an attachment
      if (useAttachments) {
        // System.out.println("Creating attachment"); //DEBUG
        SOAPConstants soapConstants = context.getMessageContext().getSOAPConstants();
        DataHandler dataHandler = new DataHandler(new OctetStreamDataSource("test",
                new OctetStream(bytes)));
        Part attachmentPart = attachments.createAttachmentPart(dataHandler);

        AttributesImpl attrs = new AttributesImpl();
        if (attributes != null && 0 < attributes.getLength())
          attrs.setAttributes(attributes); // copy the existing ones.

        int typeIndex = -1;
        if ((typeIndex = attrs.getIndex(Constants.URI_DEFAULT_SCHEMA_XSI, "type")) != -1) {
          // Found a xsi:type which should not be there for attachments.
          attrs.removeAttribute(typeIndex);
        }

        attrs.addAttribute("", soapConstants.getAttrHref(), soapConstants.getAttrHref(), "CDATA",
                attachmentPart.getContentIdRef());
        context.startElement(name, attrs);
        context.endElement();
      } else {
        // no attachment support - Base64 encode
View Full Code Here

                || context.getMessageContext().getRequestMessage().getAttachments().hasNext();
      }
      // if we have attachment support, do this as an attachment
      if (useAttachments) {
        // System.out.println("Creating attachment"); //DEBUG
        SOAPConstants soapConstants = context.getMessageContext().getSOAPConstants();
        DataHandler dataHandler = new DataHandler(new OctetStreamDataSource("test",
                new OctetStream(bytes)));
        Part attachmentPart = attachments.createAttachmentPart(dataHandler);

        AttributesImpl attrs = new AttributesImpl();
        if (attributes != null && 0 < attributes.getLength())
          attrs.setAttributes(attributes); // copy the existing ones.

        int typeIndex = -1;
        if ((typeIndex = attrs.getIndex(Constants.URI_DEFAULT_SCHEMA_XSI, "type")) != -1) {
          // Found a xsi:type which should not be there for attachments.
          attrs.removeAttribute(typeIndex);
        }

        attrs.addAttribute("", soapConstants.getAttrHref(), soapConstants.getAttrHref(), "CDATA",
                attachmentPart.getContentIdRef());
        context.startElement(name, attrs);
        context.endElement();
      } else {
        // no attachment support - Base64 encode
View Full Code Here

        }
        context.pushNewElement(myElement);
      }
    }

    SOAPConstants soapConstants = context.getMessageContext().getSOAPConstants();

    QName type = context.getTypeFromAttributes(namespace, localName, attributes);
    if (log.isDebugEnabled()) {
      log.debug(Messages.getMessage("gotType00", "Deser", "" + type));
    }

    String href = attributes.getValue(soapConstants.getAttrHref());
    // System.out.println(soapConstants.getAttrHref() + " = " + href);
    if (href != null) {
      Object ref = context.getObjectByRef(href);
      // System.out.println(ref.getClass().getName());
      // System.out.println(ref);
      if (ref instanceof SOAPBodyElement) // multiref, deref. again
      {
        SOAPBodyElement bodyElem = (SOAPBodyElement) ref;
        href = bodyElem.getAttributeValue(soapConstants.getAttrHref());
        ref = context.getObjectByRef(href);
        // System.out.println(ref.getClass().getName());
        // System.out.println(ref);
      }
      if (ref instanceof org.apache.axis.Part) {
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.