StubHeaderImpl.javaAPI DocApache Axis 1.41319Sat Apr 22 18:57:28 BST 2006test.wsdl.stubheaders


public class StubHeaderImpl extends Object implements test.wsdl.stubheaders.StubHeaderInterface Test implimentation. Make sure the service sees a SOAP header added by the Sub API. Set a different header in the response to the test can verify it.

Fields Summary
Constructors Summary
Methods Summary
public java.lang.Stringecho(java.lang.String in)

        String ret = null;
        MessageContext mc = MessageContext.getCurrentContext();

        // Verify the existence of in the input header
        SOAPEnvelope env = mc.getRequestMessage().getSOAPEnvelope();
        SOAPHeaderElement header = env.getHeaderByName("", "headerin");
        if (header != null)
            ret = header.getObjectValue().toString();

        // add a different output header to the response
        env = mc.getResponseMessage().getSOAPEnvelope();
        SOAPHeaderElement hdr =
                new SOAPHeaderElement("", "headerout", "outputvalue");

        // just return the input header, so test can validate it
        return ret;