Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPBody


      return name;
    }
   
    public void onComplete(AsyncResult result) {
      //System.out.println("On Complete Called for " + text);
      SOAPBody body = result.getResponseEnvelope().getBody();
     
      OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));
      if (echoStringResponseElem==null) {
        System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child");
        return;
      }
     
View Full Code Here


    public TestCallback (String name) {
      this.name = name;
    }
   
    public void onComplete(AsyncResult result) {
      SOAPBody body = result.getResponseEnvelope().getBody();
      OMElement contents = body.getFirstElement();
      this.resultStr = checkEchoOMBlock(contents);
      completed = true;
      System.out.println("TestCallback got text: '" + resultStr + "'");
    }
View Full Code Here

                .newInstance().createXMLStreamReader(is);
        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser,
                null);
        SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
        // retrieve SOAP body
        SOAPBody soapBody = envelope.getBody();
        OMElement messageNode = soapBody.getFirstChildWithName(new QName(
                FIX_MSG));
        Iterator<?> messageElements = (Iterator<?>) messageNode
                .getChildElements();
        while (messageElements.hasNext()) {
            OMElement node = (OMElement) messageElements.next();
View Full Code Here

        mepClient.addMessageContext(mc);
        mepClient.execute(true);
        MessageContext response = mepClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

        SOAPBody body = response.getEnvelope().getBody();
        String imageContentId = body.
                getFirstChildWithName(new QName("http://services.samples", "uploadFileUsingSwAResponse")).
                getFirstChildWithName(new QName("http://services.samples", "response")).
                getFirstChildWithName(new QName("http://services.samples", "imageId")).
                getText();
View Full Code Here

                createOMNamespace("http://ws.apache.org/ns/synapse", "syn");
        OMElement clientIDElement = soapFactory.createOMElement("ClientID", synNamespace);
        clientIDElement.setText(clientID);
        header.addChild(clientIDElement);

        SOAPBody body = soapFactory.createSOAPBody();
        envelope.addChild(body);

        OMElement valueElement = soapFactory.createOMElement("Value", null);
        valueElement.setText(value);
        body.addChild(valueElement);

        return envelope;
    }
View Full Code Here

    public BinaryExtractMediator(){}

    public boolean mediate(MessageContext msgCtx) {
        try {
            log.debug("BinaryExtractMediator Process, with offset: "+offset+" ,length "+length);
            SOAPBody soapBody = msgCtx.getEnvelope().getBody();
            OMElement firstElement = soapBody.getFirstElement();
            log.debug("First Element : "+firstElement.getLocalName());
            log.debug("First Element Text : "+firstElement.getText());
            OMText binaryNode =(OMText) firstElement.getFirstOMChild();
            log.debug("First Element Node Text : "+binaryNode.getText());
            DataHandler dataHandler =(DataHandler) binaryNode.getDataHandler();
View Full Code Here

    public TestCreateSOAPFault(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPBody body = soapFactory.getDefaultEnvelope().getBody();
        SOAPFault fault = soapFactory.createSOAPFault(body, new Exception("Testing soap fault"));
        assertTrue("SOAP body has no SOAP fault", body.hasFault());
        assertSame("SOAP body has no SOAP fault", fault, body.getFault());
        assertTrue("Programatically created SOAPFault should have done = true",
                fault.isComplete());
    }
View Full Code Here

        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPEnvelope sourceEnv = soapFactory.getDefaultEnvelope();
        SOAPBody body = sourceEnv.getBody();
        SOAPHeader header = sourceEnv.getHeader();
        String encoding = "UTF-8";
       
        // Create a header OMSE
        String hdrText = "<hdr:myheader xmlns:hdr=\"urn://test\">Hello World</hdr:myheader>";
        ByteArrayDataSource badsHdr =
            new ByteArrayDataSource(hdrText.getBytes(encoding), encoding);
        OMNamespace hdrNS = header.getOMFactory().createOMNamespace("urn://test", "hdr");
        SOAPFactory sf = (SOAPFactory) header.getOMFactory();
        SOAPHeaderBlock shb = sf.createSOAPHeaderBlock("myheader", hdrNS, badsHdr);
        shb.setProcessed()// test setting processing flag
        header.addChild(shb);
       
        // Create a payload
        String text = "<tns:payload xmlns:tns=\"urn://test\">Hello World</tns:payload>";
        ByteArrayDataSource bads = new ByteArrayDataSource(text.getBytes(encoding), encoding);
        OMNamespace ns = body.getOMFactory().createOMNamespace("urn://test", "tns");
        OMSourcedElement omse =body.getOMFactory().createOMElement(bads, "payload", ns);
        body.addChild(omse);
       
        copyAndCheck(sourceEnv);
       
        // The source SOAPHeaderBlock should not be expanded in the process
        assertFalse(shb.isExpanded());
View Full Code Here

    public TestHasFaultWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPBody body = getTestMessage(MESSAGE).getBody();
        assertTrue(
                "Body Test With parser :- hasFault method returns false",
                body.hasFault());
    }
View Full Code Here

        addTestProperty("uri", qname.getNamespaceURI());
        addTestProperty("localName", qname.getLocalPart());
    }

    protected void runTest() throws Throwable {
        SOAPBody body = soapFactory.getDefaultEnvelope().getBody();
        body.addChild(soapFactory.createOMElement(
                qname.getLocalPart(), qname.getNamespaceURI(), qname.getPrefix()));
        assertFalse(body.hasFault());
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.SOAPBody

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.