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

StubHeaderImpl

public class StubHeaderImpl extends Object implements test.wsdl.stubheaders.StubHeaderInterface
StubHeaderImpl.java 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("http://test.org/inputheader", "headerin");
        if (header != null)
        {
            ret = header.getObjectValue().toString();
        }

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

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