Examples of addNamespaceDeclaration()


Examples of javax.xml.soap.DetailEntry.addNamespaceDeclaration()

                  String nsURI = deElement.getNamespaceURI();
                  if (nsURI.length() > 0 && deElement.getAttributeNS(Constants.NS_XMLNS, prefix).length() == 0)
                  {
                     try
                     {
                        deElement.addNamespaceDeclaration(prefix, nsURI);
                     }
                     catch (SOAPException e)
                     {
                        log.warn("Declaration of detail entry namespace failed", e);
                     }
View Full Code Here

Examples of javax.xml.soap.SOAPBody.addNamespaceDeclaration()

        try {
            String s = "MyName1";
            String p = "MyPrefix1";
            String u = "myURI";
            SOAPBody body = MessageFactory.newInstance().createMessage().getSOAPBody();
            SOAPElement myse = body.addNamespaceDeclaration(p, u);
            SOAPElement se = body.addChildElement(s, p);
            if (se == null) {
                fail("SOAPElement was null");
            } else {
                Iterator i = body.getChildElements();
View Full Code Here

Examples of javax.xml.soap.SOAPBodyElement.addNamespaceDeclaration()

       SOAPBody soapBody = soapPart.getEnvelope().getBody();
       //Create the outer body element
       String uddins = IRegistry.UDDI_V2_NAMESPACE;
       Name bodyName = factory.createName(elem.getNodeName(), prefix, uddins);
       SOAPBodyElement bodyElement = soapBody.addBodyElement(bodyName);
       bodyElement.addNamespaceDeclaration(prefix,uddins);     
       appendAttributes(bodyElement, elem.getAttributes(), factory);
       appendElements(bodyElement,elem.getChildNodes(), factory);
       return message;
    }
   
View Full Code Here

Examples of javax.xml.soap.SOAPElement.addNamespaceDeclaration()

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

        SOAPFactory factory = SOAPFactory.newInstance();
        SOAPElement x = factory.createElement("hello", "foo", "http://some.url.com");
        x.addNamespaceDeclaration("foo", "http://some.url.com");
        x.addTextNode("This is the text of the node");

        SOAPElement x2 = factory.createElement("hello2", "foo", "http://some.url.com");
        x2.addNamespaceDeclaration("foo", "http://some.url.com");
        x2.addTextNode("This is the text of the node for the second struct");
View Full Code Here

Examples of javax.xml.soap.SOAPEnvelope.addNamespaceDeclaration()

    @Test
    public void testToNameNamespace() throws Exception {
        SOAPMessage message = messageFactory.createMessage();
        QName qName = new QName("namespace", "localPart");
        SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
        envelope.addNamespaceDeclaration("prefix", "namespace");
        Name name = SaajUtils.toName(qName, envelope);
        Assert.assertNotNull("Invalid name", name);
        Assert.assertEquals("Invalid namespace", qName.getNamespaceURI(), name.getURI());
        Assert.assertEquals("Invalid local part", qName.getLocalPart(), name.getLocalName());
        Assert.assertEquals("Invalid prefix", "prefix", name.getPrefix());
View Full Code Here

Examples of javax.xml.soap.SOAPHeader.addNamespaceDeclaration()

            SOAPHeader header = env.getHeader() != null
                                ? env.getHeader()
                                : env.addHeader();
                               
            discardRMHeaders(header);
            header.addNamespaceDeclaration(Names.WSRM_NAMESPACE_PREFIX,
                                           Names.WSRM_NAMESPACE_NAME);
            Marshaller marshaller = getJAXBContext().createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
          
            SequenceType seq = rmps.getSequence();
View Full Code Here

Examples of javax.xml.soap.SOAPHeaderElement.addNamespaceDeclaration()

        if (header == null) {
            header = soapenv.addHeader();
        }
        final Name name = soapenv.createName(CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT, CoordinationConstants.WSCOOR_PREFIX, CoordinationConstants.WSCOOR_NAMESPACE);
        final SOAPHeaderElement root = header.addHeaderElement(name);
        root.addNamespaceDeclaration(CoordinationConstants.WSCOOR_PREFIX, CoordinationConstants.WSCOOR_NAMESPACE);
       
        /*
         * TODO Is it possible to craft plain DOM element but not to create whole SOAPMessage?
         * following code hits an NPE in the CoordinationContextHelper.serialise() when it invokes
         * getPrefix().equals("xmlns") against the attribute generated by JAXB marshaller.
View Full Code Here

Examples of nu.xom.Element.addNamespaceDeclaration()

        }
        else {
          if (DEBUG) System.err.println(
            "Adding additional namespace declaration for prefix="
            + prefix + ", uri=" + uri);
          elem.addNamespaceDeclaration(prefix, uri);
        }
      }
      i++;
    }
    prefixes = null; // help gc
View Full Code Here

Examples of org.apache.axis.message.MessageElement.addNamespaceDeclaration()

    }

    public void testGetCompleteAttributes() throws Exception {
        MessageElement me =
            new MessageElement("http://www.wolfram.com","Test");
        me.addNamespaceDeclaration("pre", "http://www.wolfram2.com");
        Attributes attrs = me.getCompleteAttributes();
        assertEquals(attrs.getLength(), 1);
    }
   
    public void testAddNamespaceDeclaration() throws Exception {
View Full Code Here

Examples of org.apache.axis.message.SOAPEnvelope.addNamespaceDeclaration()

        URL url = UrlUtilities.buildUrl(getHost(), getPort(), path, Collections.EMPTY_LIST);

        try {
            //build the envelope
            SOAPEnvelope env = new SOAPEnvelope();
            env.addNamespaceDeclaration("xsi", "http://www.w3.org/1999/XMLSchema-instance");
            env.addNamespaceDeclaration("xsd", "http://www.w3.org/1999/XMLSchema");

            //build the body
            Name bodyName = env.createName(BODYELEMENT, "x", URN);
            SOAPBodyElement body = new SOAPBodyElement(bodyName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.