Examples of SOAPElement


Examples of javax.xml.soap.SOAPElement

        };
   

    public void testStructWithAnyStrict() throws Exception {
        SOAPFactory factory = SOAPFactory.newInstance();
        SOAPElement elem = factory.createElement("StringElementQualified",
            "x1", "http://objectweb.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://objectweb.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");
        x.setAny(elem);
       
        elem = factory.createElement("StringElementQualified",
            "x1", "http://objectweb.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://objectweb.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");
        yOrig.setAny(elem);
View Full Code Here

Examples of javax.xml.soap.SOAPElement

        }
    }

    public void testStructWithAnyStrictComplex() throws Exception {
        SOAPFactory factory = SOAPFactory.newInstance();
        SOAPElement elem = factory.createElement("AnonTypeElementQualified",
            "x1", "http://objectweb.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://objectweb.org/type_test/types1");
        SOAPElement floatElem = factory.createElement("varFloat", "x1",
            "http://objectweb.org/type_test/types1");
        floatElem.addTextNode("12.5");
        elem.addChildElement(floatElem);
        SOAPElement intElem = factory.createElement("varInt", "x1",
            "http://objectweb.org/type_test/types1");
        intElem.addTextNode("34");
        elem.addChildElement(intElem);
        SOAPElement stringElem = factory.createElement("varString", "x1",
            "http://objectweb.org/type_test/types1");
        stringElem.addTextNode("test string within any");
        elem.addChildElement(stringElem);
                                
        StructWithAnyStrict x = new StructWithAnyStrict();
        x.setName("Name x");
        x.setAddress("Some Address x");
        x.setAny(elem);
       
        elem = factory.createElement("AnonTypeElementQualified", "x1",
            "http://objectweb.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://objectweb.org/type_test/types1");
        floatElem = factory.createElement("varFloat", "x1",
            "http://objectweb.org/type_test/types1");
        floatElem.addTextNode("12.76");
        elem.addChildElement(floatElem);
        intElem = factory.createElement("varInt", "x1",
            "http://objectweb.org/type_test/types1");
        intElem.addTextNode("56");
        elem.addChildElement(intElem);
        stringElem = factory.createElement("varString", "x1",
            "http://objectweb.org/type_test/types1");
        stringElem.addTextNode("test string");
        elem.addChildElement(stringElem);
       
        StructWithAnyStrict yOrig = new StructWithAnyStrict();
        yOrig.setName("Name y");
        yOrig.setAddress("Some Address y");
View Full Code Here

Examples of javax.xml.soap.SOAPElement

        }
    }

    public void testStructWithAnyArrayLax() throws Exception {
        SOAPFactory factory = SOAPFactory.newInstance();
        SOAPElement elem = factory.createElement("StringElementQualified",
            "x1", "http://objectweb.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://objectweb.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");
        x.getAny().add(elem);

        elem = factory.createElement("StringElementQualified", "x1",
            "http://objectweb.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://objectweb.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");
        yOrig.getAny().add(elem);
View Full Code Here

Examples of javax.xml.soap.SOAPElement

        }
    }
   
    public void testStructWithAnyArrayLaxComplex() throws Exception {
        SOAPFactory factory = SOAPFactory.newInstance();
        SOAPElement elem = factory.createElement("AnonTypeElementQualified", "x1",
            "http://objectweb.org/type_test/types1");
        elem.addNamespaceDeclaration("x1", "http://objectweb.org/type_test/types1");
        SOAPElement floatElem = factory.createElement("varFloat", "x1",
            "http://objectweb.org/type_test/types1");
        floatElem.addTextNode("12.76");
        elem.addChildElement(floatElem);
        SOAPElement intElem = factory.createElement("varInt", "x1",
            "http://objectweb.org/type_test/types1");
        intElem.addTextNode("56");
        elem.addChildElement(intElem);
        SOAPElement stringElem = factory.createElement("varString", "x1",
            "http://objectweb.org/type_test/types1");
        stringElem.addTextNode("test string");
        elem.addChildElement(stringElem);

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

Examples of javax.xml.soap.SOAPElement

    }
   
    public void testMarshalRPCLit() throws Exception {
        SOAPFactory soapElFactory = SOAPFactory.newInstance();
        QName elName = new QName("http://test_jaxb_marshall", "in");
        SOAPElement elNode = soapElFactory.createElement(elName);
        JAXBEncoderDecoder.marshall(context, null, new String("TestSOAPMessage"), elName,  elNode);
       
        assertNotNull(elNode.getChildNodes());
        assertEquals("TestSOAPMessage", elNode.getFirstChild().getFirstChild().getNodeValue());
    }
View Full Code Here

Examples of javax.xml.soap.SOAPElement

        QName elName = new QName(wrapperAnnotation.targetNamespace(),
                                 wrapperAnnotation.localName());
        //Create a XML Tree of
        //<GreetMe><requestType>Hello</requestType></GreetMe>
        SOAPFactory soapElFactory = SOAPFactory.newInstance();
        SOAPElement elNode = soapElFactory.createElement(elName);
        elNode.addNamespaceDeclaration("", elName.getNamespaceURI());

        String str = new String("Hello Test");
        elNode.addChildElement("requestType").setValue(str);

        Object obj = JAXBEncoderDecoder.unmarshall(context, null,
                         elNode, elName, Class.forName(wrapperAnnotation.className()));
        assertNotNull(obj);

        //Add a Node and then test
        assertEquals(GreetMe.class,  obj.getClass());
        assertEquals(str, ((GreetMe)obj).getRequestType());
       
        try {
            JAXBEncoderDecoder.unmarshall(context, null, null, null, String.class);
            fail("Should have received a ProtocolException");
        } catch (ProtocolException pe) {
            //Expected Exception
        } catch (Exception ex) {
            fail("Should have received a ProtocolException, not: " + ex);
        }
       
        // Now test schema validation during unmarshaling
        elName = new QName(wrapperAnnotation.targetNamespace(),
                           "stringStruct");
        // Create an XML Tree of
        // <StringStruct><arg1>World</arg1></StringStruct>
        elNode = soapElFactory.createElement(elName);
        elNode.addNamespaceDeclaration("", elName.getNamespaceURI());
        str = new String("World");
        elNode.addChildElement("arg1").setValue(str);
        // Should unmarshal without problems when no schema used.
        obj = JAXBEncoderDecoder.unmarshall(context, null, elNode,  elName,
            Class.forName("org.objectweb.hello_world_soap_http.types.StringStruct"));
        assertNotNull(obj);
        assertEquals(StringStruct.class,  obj.getClass());
View Full Code Here

Examples of javax.xml.soap.SOAPElement

                    }

                    // add in, out and inout header params
                    addHeaderParts(msg.getSOAPPart().getEnvelope(), objContext, isInputMsg, callback);

                    SOAPElement soapElement = addOperationNode(msg.getSOAPBody(), callback, isInputMsg);
                    // add in, out and inout non-header params
                    addParts(soapElement, objContext, isInputMsg, callback);
                } else if (callback.getMode() == DataBindingCallback.Mode.MESSAGE) {

                    Object src = isInputMsg ? objContext.getReturn() : objContext.getMessageObjects()[0];
View Full Code Here

Examples of javax.xml.soap.SOAPElement

            nsStack.add(namespaceURI);
            String prefix = nsStack.getPrefix(namespaceURI);
            QName operationName = new QName(namespaceURI, callback.getOperationName() + responseSuffix,
                                            prefix);

            SOAPElement el = body.addChildElement(operationName);
            if (el.lookupPrefix(namespaceURI) == null) {
                el.addNamespaceDeclaration(prefix, namespaceURI);
            }
            return el;
        }
        return body;
    }
View Full Code Here

Examples of javax.xml.soap.SOAPElement

        assertEquals(expectedMessageNumbers.length, outbound ? outboundMessages.size()
            : inboundContexts.size());

        for (int i = 0; i < expectedMessageNumbers.length; i++) {
            if (outbound) {
                SOAPElement se = getSequence(outboundMessages.get(i));
                if (null == expectedMessageNumbers[i]) {
                    assertNull("Outbound message " + i + " contains unexpected message number ", se);
                } else {
                    assertEquals("Outbound message " + i + " does not contain expected message number "
                                 + expectedMessageNumbers[i], expectedMessageNumbers[i],
View Full Code Here

Examples of javax.xml.soap.SOAPElement

            : inboundContexts.size());
       
        for (int i = 0; i < expectedLastMessages.length; i++) {
            boolean lastMessage;
            if (outbound) {
                SOAPElement se = getSequence(outboundMessages.get(i));
                lastMessage = null == se ? false : getLastMessage(se);
            } else {
                SequenceType s = getSequence(inboundContexts.get(i));
                lastMessage = null == s ? false : null != s.getLastMessage();
            }
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.