FileDocCategorySizeDatePackage
TestService.javaAPI DocApache Axis 1.43434Sat Apr 22 18:57:28 BST 2006test.MSGDispatch

TestService

public class TestService extends Object
This class is a message-based service with three methods. It tests: 1) Our ability to dispatch to multiple methods for a message service 2) That each of the valid signatures works as expected
author
Glen Daniels (gdaniels@apache.org)

Fields Summary
Constructors Summary
Methods Summary
public voidtestBody(int t)

public org.apache.axis.message.SOAPBodyElement[]testBody(org.apache.axis.message.SOAPBodyElement[] bodies)


        String xml = "<m:bodyResult xmlns:m=\"http://db.com\"/>" ;
        InputStream is = new ByteArrayInputStream(xml.getBytes());
        SOAPBodyElement result = new SOAPBodyElement(is);
        return new SOAPBodyElement [] { result };
    
public voidtestElement(int t)

public org.w3c.dom.Element[]testElement(org.w3c.dom.Element[] bodyElems)

        if (bodyElems == null || bodyElems.length != 1) {
            throw new AxisFault("Wrong number of Elements in array!");
        }
        Element el = bodyElems[0];
        if (el == null) {
            throw new AxisFault("Null Element in array!");
        }
        if (!"http://db.com".equals(el.getNamespaceURI())) {
            throw new AxisFault("Wrong namespace for Element (was \"" +
                                el.getNamespaceURI() + "\" should be " +
                                "\"http://db.com\"!");
        }
        String xml = "<m:elementResult xmlns:m=\"http://db.com\"/>" ;
        Document doc = XMLUtils.newDocument(
                new ByteArrayInputStream(xml.getBytes()));
        Element result = doc.getDocumentElement();
        return new Element [] { result };
    
public org.w3c.dom.Element[]testElementEcho(org.w3c.dom.Element[] bodyElems)

        return bodyElems;
    
public voidtestEnvelope(int t)

public voidtestEnvelope(org.apache.axis.message.SOAPEnvelope req, org.apache.axis.message.SOAPEnvelope resp)

        // Throw a header in and echo back.
        SOAPBodyElement body = req.getFirstBody();
        resp.addBodyElement(body);
        resp.addHeader(new SOAPHeaderElement("http://db.com", "local", "value"));