FileDocCategorySizeDatePackage
Client.javaAPI DocApache Axis 1.42068Sat Apr 22 18:56:52 BST 2006samples.security

Client

public class Client extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        try {
            Options opts = new Options(args);

            Service service = new Service();
            Call call = (Call) service.createCall();
            call.setTargetEndpointAddress(new java.net.URL(opts.getURL()));

            SOAPEnvelope env = new SOAPEnvelope();
            SOAPBodyElement sbe = new SOAPBodyElement(XMLUtils.StringToElement("http://localhost:8080/LogTestService", "testMethod", ""));
            env.addBodyElement(sbe);

            env = new SignedSOAPEnvelope(env, "http://xml-security");

            System.out.println("\n============= Request ==============");
            XMLUtils.PrettyElementToStream(env.getAsDOM(), System.out);

            call.invoke(env);

            MessageContext mc = call.getMessageContext();
            System.out.println("\n============= Response ==============");
            XMLUtils.PrettyElementToStream(mc.getResponseMessage().getSOAPEnvelope().getAsDOM(), System.out);
        }
        catch (Exception e) {
            e.printStackTrace();
        }