Java 类javax.xml.rpc.holders.StringHolder 实例源码

项目:wso2-wss4j    文件:TestJAXRPCHandler.java   
public void invokeService (Map config, int interopNum) throws Exception {
    PingServiceLocator service = new PingServiceLocator();

    List handlerChain = new ArrayList();
    handlerChain.add(new HandlerInfo( WSS4JHandler.class, config, null));

    HandlerRegistry registry = service.getHandlerRegistry();
    registry.setHandlerChain(new QName("Ping" + interopNum), handlerChain);

    service.getHandlerRegistry().getHandlerChain(new QName("http://xmlsoap.org/Ping", "ticketType"));

    java.lang.reflect.Method method = service.getClass().getMethod("getPing" + interopNum, new Class[] {URL.class});

    PingPort port = (PingPort) method.invoke (service, new Object[] {new URL("http://localhost:8080/axis/services/Ping" + interopNum)});
    StringHolder text =
            new StringHolder("WSS4J - Scenario" + interopNum + " @ [" + new java.util.Date(System.currentTimeMillis()) + "]");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J" + interopNum), text);
    System.out.println(text.value);
}
项目:witsml-client    文件:Client.java   
/**
 * Returns the capabilites that are supported by the remote server
 * @return The XML document representing the capabilities of the server
 * @throws RemoteException Thrown if there is an exception on the remote WITSML STORE API
 */
@Override
public String getCapabilities() throws RemoteException {
    StringHolder capabilities = new StringHolder();
    StringHolder suppMsgOut = new StringHolder();
    String optionsIn = "";
    if (version.toString().equals("1.4.1.1"))
        optionsIn = "dataVersion=1.4.1.1";
    witsmlClient.WMLS_GetCap(optionsIn, capabilities, suppMsgOut);
    return capabilities.value;
}
项目:wso2-wss4j    文件:PingBindingImpl.java   
public void ping(
    org.apache.ws.axis.oasis.ping.TicketType pingTicket, 
    StringHolder text
) throws java.rmi.RemoteException {
    MessageContext msgContext = MessageContext.getCurrentContext();
    Message reqMsg = msgContext.getRequestMessage();

    Vector results = 
        (Vector) msgContext.getProperty(WSHandlerConstants.RECV_RESULTS);
    if (results == null) {
        System.out.println("No security results!!");
    }
    // System.out.println("Number of results: " + results.size());
    for (int i = 0; i < results.size(); i++) {
        WSHandlerResult rResult =
            (WSHandlerResult) results.get(i);
        Vector wsSecEngineResults = rResult.getResults();

        for (int j = 0; j < wsSecEngineResults.size(); j++) {
            WSSecurityEngineResult wser =
                (WSSecurityEngineResult) wsSecEngineResults.get(j);
            int action = 
                ((java.lang.Integer)wser.get(WSSecurityEngineResult.TAG_ACTION)).intValue();
            Principal principal = 
                (Principal)wser.get(WSSecurityEngineResult.TAG_PRINCIPAL);
            if (action != WSConstants.ENCR && principal != null) {
                // System.out.println(principal.getName());
            }
        }
    }
}
项目:wso2-wss4j    文件:STScenario1.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getSTPing1(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - ST Scenario 1 text");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:wso2-wss4j    文件:Scenario5.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getPing5(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - Scenario 5 - text");
    TicketType type = 
            new TicketType("WSS4J - Scenario 5 - TicketType");

    port.ping(type, text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(type, text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:wso2-wss4j    文件:STScenario4.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getSTPing4(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - ST Scenario 4 text");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:wso2-wss4j    文件:Scenario6.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getPing6(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - Scenario 6 text");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:wso2-wss4j    文件:Scenario4.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getPing4(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - Scenario 4 text");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:wso2-wss4j    文件:Scenario1.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getPing1(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - Scenario 1 text");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:wso2-wss4j    文件:STScenario3.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getSTPing3(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - ST Scenario 3 text");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:wso2-wss4j    文件:Scenario2.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getPing2(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - Scenario 2 text");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:wso2-wss4j    文件:Scenario2a.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getPing2a(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - Scenario 2a text");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:wso2-wss4j    文件:Scenario3.java   
/**
     * Method main
     * 
     * @param args 
     * @throws Exception 
     */
    public static void main(String[] args) throws Exception {

        Options opts = new Options(args);
        opts.setDefaultURL(address);

        /*
         *     Start to prepare service call. Once this is done, several
         *     calls can be made on the port (see below)
         *
         *     Fist: get the service locator. This implements the functionality
         *     to get a client stub (aka port).
         */
        PingServiceLocator service = new PingServiceLocator();

        /*
         *     this is a JAX-RPC compliant call. It uses a preconfigured
         *     endpoint address (usually contained in the WSDL). Note the
         *     cast.
         *    
         * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
         */

        /*
         *     Here we use an Axis specific call that allows to override the
         *     port address (service endpoint address) with an own URL. Comes
         *     in handy for testing.
         */
        java.net.URL endpoint;

        try {
            endpoint = new java.net.URL(opts.getURL());
        } catch (java.net.MalformedURLException e) {
            throw new javax.xml.rpc.ServiceException(e);
        }

        PingPort port = (PingPort) service.getPing3(endpoint);

        /*
         *     At this point all preparations are done. Using the port we can
         *     now perform as many calls as necessary.
         */

        // perform call
        StringHolder text =
                new StringHolder("WSS4J - Scenario 3 text");
        port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
//        System.out.println(text.value);

        if (opts.isFlagSet('t') > 0) {
            long startTime = System.currentTimeMillis();

            for (int i = 0; i < 20; i++) {
//                System.out.println("\nLoop #" + i);
                port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
            }

            long endTime = System.currentTimeMillis();

            System.out.println("Time used: " + (endTime - startTime) + "ms");
        }
    }
项目:wso2-wss4j    文件:Scenario7.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getPing7(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - Scenario 7 text");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:wso2-wss4j    文件:Scenario2b.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getPing2b(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - Scenario 2b text");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:wso2-wss4j    文件:Tester.java   
/**
 * Method main
 * 
 * @param args 
 * @throws Exception 
 */
public static void main(String[] args) throws Exception {

    Options opts = new Options(args);
    opts.setDefaultURL(address);

    /*
     *     Start to prepare service call. Once this is done, several
     *     calls can be made on the port (see below)
     *
     *     Fist: get the service locator. This implements the functionality
     *     to get a client stub (aka port).
     */
    PingServiceLocator service = new PingServiceLocator();

    /*
     *     this is a JAX-RPC compliant call. It uses a preconfigured
     *     endpoint address (usually contained in the WSDL). Note the
     *     cast.
     *    
     * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
     */

    /*
     *     Here we use an Axis specific call that allows to override the
     *     port address (service endpoint address) with an own URL. Comes
     *     in handy for testing.
     */
    java.net.URL endpoint;

    try {
        endpoint = new java.net.URL(opts.getURL());
    } catch (java.net.MalformedURLException e) {
        throw new javax.xml.rpc.ServiceException(e);
    }

    PingPort port = (PingPort) service.getPing1(endpoint);

    /*
     *     At this point all preparations are done. Using the port we can
     *     now perform as many calls as necessary.
     */

    // perform call
    StringHolder text =
            new StringHolder("WSS4J - Tester text");
    port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
    System.out.println(text.value);

    if (opts.isFlagSet('t') > 0) {
        long startTime = System.currentTimeMillis();

        for (int i = 0; i < 20; i++) {
            port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
        }

        long endTime = System.currentTimeMillis();

        System.out.println("Time used: " + (endTime - startTime) + "ms");
    }
}
项目:witsml-client    文件:Client.java   
/**
 * Executes a log query in either 1.3.1.1 or 1.4.1.1
 * @param query The query to send to the server
 * @param optionsIn The options to send (only supported in 1.4.1.1)
 * @param capabilitiesIn The capabilities to send (only supported in 1.4.1.1)
 * @return a string representing the response from the server
 * @throws RemoteException thrown on any exception encountered from the server
 */
@Override
public String executeLogQuery(String query, String optionsIn, String capabilitiesIn) throws RemoteException {
    StringHolder xmlOut = new StringHolder();
    StringHolder suppMsgOut = new StringHolder();
    witsmlClient.WMLS_GetFromStore("log", query, optionsIn, capabilitiesIn,  xmlOut, suppMsgOut);
    return xmlOut.value;
}
项目:witsml-client    文件:Client.java   
/**
 * Executes a mudLog query in either 1.3.1.1 or 1.4.1.1
 * @param query The query to send to the server
 * @param optionsIn The options to send (only supported in 1.4.1.1)
 * @param capabilitiesIn The capabilities to send (only supported in 1.4.1.1)
 * @return a string representing the response from the server
 * @throws RemoteException thrown on any exception encountered from the server
 */
@Override
public String executeMudlogQuery(String query, String optionsIn, String capabilitiesIn) throws RemoteException {
    StringHolder xmlOut = new StringHolder();
    StringHolder suppMsgOut = new StringHolder();
    witsmlClient.WMLS_GetFromStore("mudLog", query, optionsIn, capabilitiesIn,  xmlOut, suppMsgOut);
    return xmlOut.value;
}
项目:witsml-client    文件:Client.java   
/**
 * Executes a trajectory query in either 1.3.1.1 or 1.4.1.1
 * @param query The query to send to the server
 * @param optionsIn The options to send (only supported in 1.4.1.1)
 * @param capabilitiesIn The capabilities to send (only supported in 1.4.1.1)
 * @return a string representing the response from the server
 * @throws RemoteException thrown on any exception encountered from the server
 */
@Override
public String executeTrajectoryQuery(String query, String optionsIn, String capabilitiesIn) throws RemoteException {
    StringHolder xmlOut = new StringHolder();
    StringHolder suppMsgOut = new StringHolder();
    witsmlClient.WMLS_GetFromStore("trajectory", query, optionsIn, capabilitiesIn,  xmlOut, suppMsgOut);
    return xmlOut.value;
}
项目:witsml-client    文件:Client.java   
/**
 * Executes a object query in either 1.3.1.1 or 1.4.1.1
 * @param objectType The type of WMLtypeIn object
 * @param query The query to send to the server
 * @param optionsIn The options to send (only supported in 1.4.1.1)
 * @param capabilitiesIn The capabilities to send (only supported in 1.4.1.1)
 * @return a string representing the response from the server
 * @throws RemoteException thrown on any exception encountered from the server
 */
@Override
public String executeObjectQuery(String objectType, String query, String optionsIn, String capabilitiesIn) throws RemoteException {
    StringHolder xmlOut = new StringHolder();
    StringHolder suppMsgOut = new StringHolder();
    witsmlClient.WMLS_GetFromStore(objectType.toLowerCase(), query, optionsIn, capabilitiesIn,  xmlOut, suppMsgOut);
    return xmlOut.value;
}
项目:witsml-client    文件:StoreSoapPort_PortType.java   
public short WMLS_AddToStore(String WMLtypeIn, String XMLin, String optionsIn, String capabilitiesIn, StringHolder suppMsgOut) throws RemoteException;
项目:witsml-client    文件:StoreSoapPort_PortType.java   
public short WMLS_DeleteFromStore(String WMLtypeIn, String queryIn, String optionsIn, String capabilitiesIn, StringHolder suppMsgOut) throws RemoteException;
项目:witsml-client    文件:StoreSoapPort_PortType.java   
public short WMLS_GetCap(String optionsIn, StringHolder capabilitiesOut, StringHolder suppMsgOut) throws RemoteException;
项目:witsml-client    文件:StoreSoapPort_PortType.java   
public short WMLS_GetFromStore(String WMLtypeIn, String queryIn, String optionsIn, String capabilitiesIn, StringHolder XMLout, StringHolder suppMsgOut) throws RemoteException;
项目:witsml-client    文件:StoreSoapPort_PortType.java   
public short WMLS_UpdateInStore(String WMLtypeIn, String XMLin, String optionsIn, String capabilitiesIn, StringHolder suppMsgOut) throws RemoteException;