Package javax.xml.soap

Examples of javax.xml.soap.SOAPEnvelope


        }

        QueryResourcePropertiesResponseDocument responseDoc = createResponseDocument();
        QueryExpressionType queryExprElem =
                requestDoc.getQueryResourceProperties().getQueryExpression();
        SOAPEnvelope envelope;
        try
        {
            envelope = getResourceContext().getSOAPMessage().getSOAPPart().getEnvelope();
        }
        catch ( SOAPException soape )
View Full Code Here


   {
      List children;

      children = new ArrayList(  );

      SOAPEnvelope soap_env = (SOAPEnvelope) soap_elem;
      SOAPHeader   header = null;
      SOAPBody     body   = null;

      try
      {
         header    = soap_env.getHeader(  );
         body      = soap_env.getBody(  );
      }
      catch ( SOAPException soape )
      {
         //LOG.warn( ResourceKeys.MSG.getMsg( ResourceKeys.EX_FAILED_TO_GET_SOAP_BODY, soape ) );
      }
View Full Code Here

    public void startElement (String namespaceURI, String localName,
            String qName, Attributes atts)
    throws SAXException {
        try {
            HandlerStack stack = getStack();
            SOAPEnvelope env = (SOAPEnvelope) stack.getContextData ("envelope");
            String prefix = stack.getPrefixForURI(namespaceURI);
            Name name = env.createName (localName, prefix, namespaceURI);
            SOAPElement parent = (SOAPElement)elemStack.get(0);
            SOAPElement current = null;
            if (parent instanceof SOAPBody) {
                current = ((SOAPBody)parent).addBodyElement (name);
            } else if (parent instanceof SOAPHeader) {
View Full Code Here

            SOAPConnection connection = factory.createConnection();
           
            MessageFactory messageFactory = MessageFactory.newInstance();
            SOAPMessage message = messageFactory.createMessage();
            MimeHeaders mimeHeaders = message.getMimeHeaders();
            SOAPEnvelope env = message.getSOAPPart().getEnvelope();
           
            // Add headers, if any
            if (httpHeaders != null) {
                for (StringTokenizer st
                        = new StringTokenizer(httpHeaders, "\n");
                    st.hasMoreElements();) {
                    String hdr = st.nextToken();
                    int sep = hdr.indexOf(':');
                    if (sep < 0) {
                        throw new CannotExecuteException
                            ("Invalid header (missing ':'): " + hdr);
                    }
                    mimeHeaders.addHeader
                        (hdr.substring(0, sep),
                         hdr.substring(sep + 1).trim());
                }
            }

            // Add header content, if any
            if (headerContent != null) {
                SOAPHeader hdr = env.getHeader();
                appendNodes (env, hdr, headerContent);
            }

            // Add body content
            SOAPBody body = env.getBody();
            appendNodes (env, body, bodyContent);
           
            // Now invoke with the created message
            SOAPMessage response = null;
            try {
View Full Code Here

     * @throws SOAPException
     *         error manipulating the SOAP message.
     */
    static void fillRequestHeadet(SOAPMessage message, String receiver,
            String sender, String id) throws SOAPException {
        SOAPEnvelope env = message.getSOAPPart().getEnvelope();
        SOAPHeader header = env.getHeader ();
        SOAPHeaderElement req = header.addHeaderElement
            (env.createName("Request", "as", Basic.ASAP_NS));
        SOAPElement receiverkey = req.addChildElement("ReceiverKey", "as");
        receiverkey.addTextNode(receiver);
        SOAPElement senderkey = req.addChildElement("SenderKey", "as");
        senderkey.addTextNode(sender);
        if (id != null) {
View Full Code Here

     * @return
     * @throws SOAPException
     */
    static SOAPBodyElement createActionElement(SOAPMessage message,
            String request) throws SOAPException {
        SOAPEnvelope env = message.getSOAPPart().getEnvelope();
        SOAPBody body = env.getBody();
        return body.addBodyElement(env.createName(request, "wfx",
                Basic.WFXML_NS));
    }
View Full Code Here

        (String observer, String newState, String oldState)
        throws SOAPException {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
       
        SOAPEnvelope env = message.getSOAPPart().getEnvelope();
        SOAPHeader header = env.getHeader ();
        SOAPHeaderElement req = header.addHeaderElement
            (env.createName("Request", "as", Consts.ASAP_NS));
        SOAPElement receiverkey
            = req.addChildElement("ReceiverKey", Consts.ASAP_PREFIX);
        receiverkey.addTextNode(observer);
        SOAPElement senderkey = req.addChildElement("SenderKey",
                Consts.ASAP_PREFIX);
        senderkey.addTextNode(getResourceReference().getResourceKey());
        SOAPElement responseRequired = req.addChildElement("ResponseRequired",
                Consts.ASAP_PREFIX);
        responseRequired.addTextNode("No");
       
        SOAPBody body = env.getBody();
        Name respName = env.createName(Consts.STATE_CHANGE_REQUEST,
                Consts.ASAP_PREFIX, Consts.ASAP_NS);

        SOAPBodyElement action = body.addBodyElement(respName);
        SOAPElement newStateNode
            = action.addChildElement("State", Consts.ASAP_PREFIX);
View Full Code Here

        (String observer, ProcessData result)
        throws SOAPException, RemoteException {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
       
        SOAPEnvelope env = message.getSOAPPart().getEnvelope();
        SOAPHeader header = env.getHeader ();
        SOAPHeaderElement req = header.addHeaderElement
            (env.createName("Request", "as", Consts.ASAP_NS));
        SOAPElement receiverKey
            = req.addChildElement("ReceiverKey", Consts.ASAP_PREFIX);
        receiverKey.addTextNode(observer);
        SOAPElement senderKey = req.addChildElement("SenderKey",
                Consts.ASAP_PREFIX);
        senderKey.addTextNode(getResourceReference().getResourceKey());
        SOAPElement responseRequired = req.addChildElement("ResponseRequired",
                Consts.ASAP_PREFIX);
        responseRequired.addTextNode("No");
       
        SOAPBody body = env.getBody();
        Name respName = env.createName(Consts.COMPLETED_REQUEST,
                Consts.ASAP_PREFIX, Consts.ASAP_NS);

        SOAPBodyElement action = body.addBodyElement(respName);
        appendResultData(message, result, action);
       
View Full Code Here

     * @throws SOAPException
     */
    private void addContextDataSchema(SOAPMessage message, String ns,
            ProcessDefinition pd, SOAPElement cds) throws RemoteException,
            SOAPException {
        SOAPEnvelope env = message.getSOAPPart().getEnvelope();

        SOAPElement schema = cds.addChildElement("schema", "xsd",
                "http://www.w3.org/2001/XMLSchema");
        Name nsAttribute = env.createName("targetNamespace");
        schema.addAttribute(nsAttribute, ns);
        Name attdefAttribute = env.createName("attributeFormDefault");
        schema.addAttribute(attdefAttribute, "unqualified");
        Name elemdefAttribute = env.createName("elementFormDefault");
        schema.addAttribute(elemdefAttribute, "qualified");

        SOAPElement complexType = schema.addChildElement("complexType", "xsd");
        Name nameAttribute = env.createName("name");
        complexType.addAttribute(nameAttribute, "ContextDataType");
        Name mixedAttribute = env.createName("mixed");
        complexType.addAttribute(mixedAttribute, "true");

        ProcessDataInfo context = pd.contextSignature();
        if (context.isEmpty()) {
            return;
View Full Code Here

     * @throws SOAPException
     */
    private void addResultDataSchema(SOAPMessage message, String ns,
            ProcessDefinition pd, SOAPElement cds) throws RemoteException,
            SOAPException {
        SOAPEnvelope env = message.getSOAPPart().getEnvelope();

        SOAPElement schema = cds.addChildElement("schema", "xsd",
                "http://www.w3.org/2001/XMLSchema");
        Name nsAttribute = env.createName("targetNamespace");
        schema.addAttribute(nsAttribute, ns);
        Name attdefAttribute = env.createName("attributeFormDefault");
        schema.addAttribute(attdefAttribute, "unqualified");
        Name elemdefAttribute = env.createName("elementFormDefault");
        schema.addAttribute(elemdefAttribute, "qualified");

        SOAPElement complexType = schema.addChildElement("complexType", "xsd");
        Name nameAttribute = env.createName("name");
        complexType.addAttribute(nameAttribute, "ResultDataType");
        Name mixedAttribute = env.createName("mixed");
        complexType.addAttribute(mixedAttribute, "true");

        ProcessDataInfo result = pd.resultSignature();
        if (result.isEmpty()) {
            return;
View Full Code Here

TOP

Related Classes of javax.xml.soap.SOAPEnvelope

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.