Package javax.xml.soap

Examples of javax.xml.soap.Name


    public boolean equals(Object obj) {
        if (!(obj instanceof Name)) {
            return false;
        }

        Name otherName = (Name) obj;

        if (!uri.equals(otherName.getURI())) {
            return false;
        }

        if (!localName.equals(otherName.getLocalName())) {
            return false;
        }

        return true;
    }
View Full Code Here


    SOAPMessage soapMessage = createMessage();
      SOAPPart soapPart = soapMessage.getSOAPPart();
      SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
      SOAPHeader soapHeader = soapEnvelope.getHeader();
     
      Name security = soapEnvelope.createName(SoapConstants.WSSE_LN, "wsse", SoapConstants.WSSE_NS);
      SOAPHeaderElement headerElement = soapHeader.addHeaderElement( security );
     
      createBinaryHeaderElement(soapEnvelope, headerElement, encodingType, valueType, cert );

      return soapMessage;
View Full Code Here

    SOAPMessage soapMessage = createMessage();
      SOAPPart soapPart = soapMessage.getSOAPPart();
      SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
      SOAPHeader soapHeader = soapEnvelope.getHeader();
     
      Name security = soapEnvelope.createName(SoapConstants.WSSE_LN, "wsse", SoapConstants.WSSE_NS);
      SOAPHeaderElement headerElement = soapHeader.addHeaderElement( security );
     
      createUsernameTokenHeaderElement(soapEnvelope, headerElement, username, password );

      return soapMessage;
View Full Code Here

      final String encodingType,
      final String valueType,
      final String cert) throws SOAPException
  {
    //  create the BinarySecurityToken element
    Name binarySecurityTokenName = soapEnvelope.createName("BinarySecurityToken", "wsse", SoapConstants.WSSE_NS);
      SOAPElement binarySecurityTokenElement = headerElement.addChildElement(binarySecurityTokenName);
     
      //  add the EncodingType attribute
      binarySecurityTokenElement.addAttribute(soapEnvelope.createName("EncodingType"), encodingType);
      //  add the ValueType attribute
View Full Code Here

      final SOAPHeaderElement headerElement,
      final String username,
      final String password) throws SOAPException
  {
    //  create the UsernameToken element
    Name usernameTokenName = soapEnvelope.createName("UsernameToken", "wsse", SoapConstants.WSSE_NS);
      SOAPElement usernameTokenElement = headerElement.addChildElement(usernameTokenName);
     
      //  create and add the Username sub element
      if ( username != null )
      {
        Name usernameName = soapEnvelope.createName("Username", "wsse", SoapConstants.WSSE_NS);
          SOAPElement usernameNode = usernameTokenElement.addChildElement(usernameName);
          usernameNode.addTextNode(username);
      }
     
      //  create and add the password sub element
      if ( password != null )
      {
        Name passwordName = soapEnvelope.createName("password", "wsse", SoapConstants.WSSE_NS);
          SOAPElement passwordNode = usernameTokenElement.addChildElement(passwordName);
          passwordNode.addTextNode(password);
      }
   
      return usernameTokenElement;
View Full Code Here

                "Message does not have necessary info");
        fault.setFaultActor("http://gizmos.com/order");

        Detail detail = fault.addDetail();

        Name entryName = envelope.createName("order", "PO",
                "http://gizmos.com/orders/");
        DetailEntry entry = detail.addDetailEntry(entryName);
        entry.addTextNode(
                "quantity element does not have a value");

        Name entryName2 = envelope.createName("confirmation",
                "PO", "http://gizmos.com/confirm");
        DetailEntry entry2 = detail.addDetailEntry(entryName2);
        entry2.addTextNode("Incomplete address: no zip code");

        msg.saveChanges();
View Full Code Here

   {
      MetricAttributes metricAttribs = new MetricAttributesImpl(  );
      Iterator         attribIter = soapElem.getAllAttributes(  );
      while ( attribIter.hasNext(  ) )
      {
         Name   name  = (Name) attribIter.next(  );
         String value = soapElem.getAttributeValue( name );
         LOG.debug( "Found MuWS metric attribute " + name.getQualifiedName(  ) + "=" + value + " in element "
                    + soapElem.getElementName(  ).getQualifiedName(  ) );
         if ( NameUtils.toQName( name ).equals( Muws05Constants.METRIC_ATTRIBUTE_CHANGE_TYPE ) )
         {
            metricAttribs.setChangeType( ChangeType.forString( value ) );
         }
View Full Code Here

        StructWithAny yOrig = new StructWithAny();
        yOrig.setName("Name2");
        yOrig.setAddress("Some Other Address");

        SOAPFactory sf = SOAPFactory.newInstance();
        Name elementName = sf.createName("UKAddress", "", "http://apache.org/type_test");
        Name xsiAttrName = sf.createName("type", "xsi", "http://www.w3.org/2001/XMLSchema-instance");
        SOAPElement x = sf.createElement(elementName);
        x.addNamespaceDeclaration("tns", "http://apache.org/type_test");
        x.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        x.addAttribute(xsiAttrName, "tns:UKAddressType11");
        x.addTextNode("This is the text of the node for the first struct");

        Name elementName2 = sf.createName("UKAddress", "", "http://apache.org/type_test");
        Name xsiAttrName2 = sf.createName("type", "xsi", "http://www.w3.org/2001/XMLSchema-instance");
        SOAPElement x2 = sf.createElement(elementName2);
        x2.addNamespaceDeclaration("tns", "http://apache.org/type_test");
        x2.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        x2.addAttribute(xsiAttrName2, "tns:UKAddressType22");
        x2.addTextNode("This is the text of the node for the second struct");
View Full Code Here

                    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());
                }
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;
            return headerElem;
         }
      }
View Full Code Here

TOP

Related Classes of javax.xml.soap.Name

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.