Package javax.xml.soap

Examples of javax.xml.soap.SOAPHeaderElement


                        ex);
            }

            Iterator headers = sHeader.examineHeaderElements(actor);

            SOAPHeaderElement headerElement = null;
            while (headers.hasNext()) {
                org.apache.axis.message.SOAPHeaderElement hE = (org.apache.axis.message.SOAPHeaderElement) headers.next();
                if (hE.getLocalName().equals(WSConstants.WSSE_LN)
                        && hE.getNamespaceURI().equals(WSConstants.WSSE_NS)) {
                    headerElement = hE;
View Full Code Here


      SOAPFactory       factory = SOAPFactory.newInstance(  );

      String            namespace = "http://schemas.xmlsoap.org/ws/2004/03/addressing";
      String            localPart = "To";

      SOAPHeaderElement h = header.addHeaderElement( factory.createName( localPart, "ns1", namespace ) );
      h.addTextNode( consumerEPR.getAddress(  ).getStringValue(  ) );

      String value = "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/Notify";

      localPart    = "Action";
      h            = header.addHeaderElement( factory.createName( localPart, "ns2", namespace ) );
      h.addTextNode( value );

      ReferencePropertiesType props  = consumerEPR.getReferenceProperties(  );
      XmlCursor               cursor = props.newCursor(  );

      boolean                 haveChild = cursor.toFirstChild(  );

      while ( haveChild )
      {
         SOAPElement e = XmlBeansUtils.toSOAPElement( cursor.getObject(  ) );
         h = header.addHeaderElement( e.getElementName(  ) );
         h.addTextNode( e.getValue(  ) );

         haveChild = cursor.toNextSibling(  );
      }

      cursor.dispose(  );
View Full Code Here

            // to form the content of the wsa:From header
            // EndpointReference fromEPR = new
            // EndpointReference(callbackEndpoint.getBinding().getURI());
            //
            // addWSAFromHeader(sh, fromEPR);
            SOAPHeaderElement fromH = sh.addHeaderElement(QNAME_WSA_FROM);
            fromH.setTextContent(callbackEndpoint.getBinding().getURI());

            addWSAActionHeader(sh, action);

            // requestMC.setFrom(fromEPR);
        } // end if
View Full Code Here

    private void addWSAToHeader(SOAPHeader sh, String address, Message msg) throws SOAPException {
        // Create wsa:To header which is required by ws-addressing spec
        // OMElement wsaToOM = sh.getOMFactory().createOMElement(QNAME_WSA_TO);
        // wsaToOM.setText( address );
        // sh.addChild(wsaToOM);
        SOAPHeaderElement toH = sh.addHeaderElement(QNAME_WSA_TO);
        toH.setTextContent(address);

        // Deal with Reference Parameters, if present - copy to the header
        // without the wsa:ReferenceParameters wrapper
        // OMElement refParms = (OMElement) msg.getHeaders().get(WS_REF_PARMS);
        // Iterator ces = sh.getChildElements(new QName(WSA_FINAL_NAMESPACE,
        // WS_REF_PARMS));
        Iterator<SOAPElement> ces = sh.getChildElements();
        while (ces.hasNext()) {
            SOAPElement se = ces.next();
            if (WS_REF_PARMS.equals(se.getElementQName().getLocalPart())) {
                // if( refParms != null ) {
                Iterator<SOAPElement> children = se.getChildElements();
                while (children.hasNext()) {
                    SOAPElement node = (SOAPElement)children.next();
                    toH.addChildElement(node);
                }
                // } // end if
            }
        }
View Full Code Here

        // OMElement actionOM =
        // sh.getOMFactory().createOMElement(QNAME_WSA_ACTION);
        // actionOM.setText(action == null ? "" : action);
        // sh.addChild(actionOM);

        SOAPHeaderElement actionH = sh.addHeaderElement(QNAME_WSA_ACTION);
        actionH.setTextContent(action == null ? "" : action);

    } // end method addWSAActionHeader
View Full Code Here

     * @throws SOAPException
     */
    private void addWSARelatesTo(SOAPHeader sh, Message msg) throws SOAPException {
        String idValue = (String)msg.getHeaders().get(WS_MESSAGE_ID);
        if (idValue != null) {
            SOAPHeaderElement relatesToH = sh.addHeaderElement(QNAME_WSA_RELATESTO);
            relatesToH.addAttribute(new QName(null, "RelationshipType"), SCA_CALLBACK_REL);
            relatesToH.setTextContent(idValue);
            // OMElement relatesToOM = sh.getOMFactory().createOMElement(
            // QNAME_WSA_RELATESTO );
            // OMAttribute relType =
            // sh.getOMFactory().createOMAttribute("RelationshipType", null,
            // SCA_CALLBACK_REL);
View Full Code Here

                return new Object[0];
            }
            List<Object> ret = new ArrayList<Object>();
            Iterator<SOAPHeaderElement> it = CastUtils.cast(header.examineAllHeaderElements());
            while (it.hasNext()) {
                SOAPHeaderElement she = it.next();
                if ((allRoles
                    || roles.contains(she.getActor()))
                    && name.equals(she.getElementQName())) {
                   
                    ret.add(context.createUnmarshaller().unmarshal(she));
                   
                }
            }
View Full Code Here

                    SOAPHeader header = envelope.getHeader();
                    if (header == null) {
                        header = envelope.addHeader();
                    }

                    SOAPHeaderElement headerElement = header.addHeaderElement(qname);

                    // QName soapMustUnderstand = new QName("http://schemas.xmlsoap.org/soap/envelope/",
                    // "mustUnderstand");
                    Name name = SOAPFactory.newInstance()
                        .createName("mustUnderstand", "soap", "http://schemas.xmlsoap.org/soap/envelope/");
                    headerElement.addAttribute(name, "1");
                } else {
                    getHandlerInfoList(ctx).add(getHandlerId());
                }
            }
        } catch (SOAPException e) {
View Full Code Here

      {
         LOG.debug( MSG.getMessage( Keys.NULL_RESOURCE_NAME) );
         return null;
      }

      SOAPHeaderElement headerElem = getResourceKeyHeader( keyName );
      if ( headerElem == null )
      {
         throw new ResoureKeyHeaderNotFoundFaultException( keyName );
      }
View Full Code Here

      }

      Iterator iter = header.examineHeaderElements( actorURI );
      while ( iter.hasNext() )
      {
         SOAPHeaderElement headerElem = (SOAPHeaderElement) iter.next();
         Name headerName = headerElem.getElementName();

         if ( headerName.getLocalName().equals( keyName.getLocalPart() )
               && headerName.getURI().equals( keyName.getNamespaceURI() ) )
         {
            // found my header element;
View Full Code Here

TOP

Related Classes of javax.xml.soap.SOAPHeaderElement

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.