Package javax.xml.soap

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


            SOAPBodyElement propsNode)
        throws RemoteException, SOAPException {
        SOAPElement contextData
            = propsNode.addChildElement("ContextData", Consts.ASAP_PREFIX);
               
        contextData.addNamespaceDeclaration
            (Consts.CD_PREFIX, getResourceReference().getNamespace());
       
        ProcessData context = proc.processContext();
       
        Iterator iterator = context.keySet().iterator();
View Full Code Here


            = propsNode.addChildElement("ResultData", Consts.ASAP_PREFIX);
       
        ProcessDefinition procdef = proc.processDefinition();
        ProcessDataInfo resultSignature = procdef.resultSignature();

        resultData.addNamespaceDeclaration
            (Consts.RS_PREFIX, getResourceReference().getNamespace());
       
        ProcessData result;
        result = proc.result();
       
View Full Code Here

    public void testAddNamespaceDeclarationDefaultNamespace() throws SOAPException {
        SOAPMessage msg = MessageFactory.newInstance().createMessage();
        SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
        SOAPBody body = envelope.getBody();
        SOAPElement element = body.addChildElement("test", "p", "urn:test");
        element.addNamespaceDeclaration("", "urn:ns");
        Attr attr = (Attr)element.getAttributes().getNamedItemNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns");
        assertEquals("urn:ns", attr.getValue());
    }
   
    @Validated @Test
View Full Code Here

        if (attributes != null) {
            for (int i = 0; i < attributes.getLength(); i++) {
                Attr att = (Attr) parent.getAttributes().item(i);
                if (att.getName().startsWith(XMLConstants.XMLNS_ATTRIBUTE + ":")
                        && elem.getAttributeNodeNS(att.getNamespaceURI(), att.getLocalName()) == null) {
                elem.addNamespaceDeclaration(att.getName().substring(XMLConstants.XMLNS_ATTRIBUTE.length() + 1), att.getValue());
                    elem.setAttributeNS(att.getNamespaceURI(), att.getName(), att.getValue());
                }
            }
        }
        // The following code works with axis saaj implementation
View Full Code Here

        // The following code works with axis saaj implementation
          for (Iterator itNs = parent.getNamespacePrefixes(); itNs.hasNext();) {
            String prefix = (String) itNs.next();
            String nsuri = parent.getNamespaceURI(prefix);
            if (elem.getAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, prefix) == null) {
              elem.addNamespaceDeclaration(prefix, nsuri);
              elem.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, XMLConstants.XMLNS_ATTRIBUTE + ":" + prefix, nsuri);
            }
          }
    }
       
View Full Code Here

    @Test
    public void testStructWithAnyStrict() throws Exception {
        SOAPFactory factory = SOAPFactory.newInstance();
        SOAPElement elem = factory.createElement("StringElementQualified",
            "x1", "http://apache.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://apache.org/type_test/types1");
        elem.addTextNode("This is the text of the node");

        StructWithAnyStrict x = new StructWithAnyStrict();
        x.setName("Name x");
        x.setAddress("Some Address x");
View Full Code Here

        x.setAddress("Some Address x");
        x.setAny(elem);
       
        elem = factory.createElement("StringElementQualified",
            "x1", "http://apache.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://apache.org/type_test/types1");
        elem.addTextNode("This is the text of the second node");
                               
        StructWithAnyStrict yOrig = new StructWithAnyStrict();
        yOrig.setName("Name y");
        yOrig.setAddress("Some Address y");
View Full Code Here

    @Test
    public void testStructWithAnyStrictComplex() throws Exception {
        SOAPFactory factory = SOAPFactory.newInstance();
        SOAPElement elem = factory.createElement("AnonTypeElementQualified",
            "x1", "http://apache.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://apache.org/type_test/types1");
        SOAPElement floatElem = factory.createElement("varFloat", "x1",
            "http://apache.org/type_test/types1");
        floatElem.addTextNode("12.5");
        elem.addChildElement(floatElem);
        SOAPElement intElem = factory.createElement("varInt", "x1",
View Full Code Here

    @Test
    public void testStructWithAnyArrayLax() throws Exception {
        SOAPFactory factory = SOAPFactory.newInstance();
        SOAPElement elem = factory.createElement("StringElementQualified",
            "x1", "http://apache.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://apache.org/type_test/types1");
        elem.addTextNode("This is the text of the node");

        StructWithAnyArrayLax x = new StructWithAnyArrayLax();
        x.setName("Name x");
        x.setAddress("Some Address x");
View Full Code Here

        x.setAddress("Some Address x");
        x.getAny().add(elem);

        elem = factory.createElement("StringElementQualified", "x1",
            "http://apache.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://apache.org/type_test/types1");
        elem.addTextNode("This is the text of the node for the second struct");

        StructWithAnyArrayLax yOrig = new StructWithAnyArrayLax();
        yOrig.setName("Name y");
        yOrig.setAddress("Some Other Address y");
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.