Examples of Dispatch


Examples of com.jacob.com.Dispatch

   * @param qd
   * @return Variant results of query?
   */
  public static Variant getByQueryDef(Dispatch qd) {
    // get a reference to the recordset
    Dispatch recset = Dispatch.call(qd, "OpenRecordset").toDispatch();
    // get the values as a safe array
    String[] cols = getColumns(recset);
    for (int i = 0; i < cols.length; i++) {
      System.out.print(cols[i] + " ");
    }
View Full Code Here

Examples of com.jacob.com.Dispatch

   *
   * @param recset
   * @return list of column names
   */
  public static String[] getColumns(Dispatch recset) {
    Dispatch flds = Dispatch.get(recset, "Fields").toDispatch();
    int n_flds = Dispatch.get(flds, "Count").getInt();
    String[] s = new String[n_flds];
    Variant vi = new Variant();
    for (int i = 0; i < n_flds; i++) {
      vi.putInt(i);
      // must use the invoke method because this is a method call
      // that wants to have a Dispatch.Get flag...
      Dispatch fld = Dispatch.invoke(recset, "Fields", Dispatch.Get,
          new Object[] { vi }, new int[1]).toDispatch();
      Variant name = Dispatch.get(fld, "Name");
      s[i] = name.toString();
    }
    return s;
View Full Code Here

Examples of com.jacob.com.Dispatch

public class ItunesEvents {
  public void OnPlayerPlayEvent(Variant[] args) {
    System.out.println("OnPlayerPlayEvent");

    Dispatch event = (Dispatch)args[0].getDispatch();
    String artist = Dispatch.get(event, "Artist")+"";
    String title = Dispatch.get(event, "Name")+"";
    String album = Dispatch.get(event, "Album")+"";
    String email = "j@am.com";
   
View Full Code Here

Examples of javax.xml.ws.Dispatch

        URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl");
        assertNotNull(wsdl1);
       
        ServiceImpl service = new ServiceImpl(getBus(), wsdl1, SERVICE_1, ServiceImpl.class);

        Dispatch dispatch = service.createDispatch(PORT_1, Source.class, Service.Mode.PAYLOAD);
        assertNotNull(dispatch);
    }
View Full Code Here

Examples of javax.xml.ws.Dispatch

        URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl");
        assertNotNull(wsdl1);
       
        ServiceImpl service = new ServiceImpl(getBus(), wsdl1, SERVICE_1, ServiceImpl.class);

        Dispatch dispatch = service.createDispatch(PORT_1, Source.class, Service.Mode.PAYLOAD);
        assertNotNull(dispatch);
    }
View Full Code Here

Examples of javax.xml.ws.Dispatch

        TestLogger.logger.debug("test: " + getName());
       
        BookStoreService service = new BookStoreService();
       
        JAXBContext ctx = JAXBContext.newInstance("org.apache.axis2.jaxws.client.soapaction");
        Dispatch dispatch = service.createDispatch(new QName(targetNamespace, portName),
                ctx, Mode.PAYLOAD);
       
        Map<String, Object> requestCtx = dispatch.getRequestContext();
        requestCtx.put(BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
        requestCtx.put(BindingProvider.SOAPACTION_URI_PROPERTY, "http://jaxws.axis2.apache.org/client/soapaction/getPrice");
       
        ObjectFactory of = new ObjectFactory();
        GetPriceType gpt = of.createGetPriceType();
        gpt.setItem("TEST");
       
        // The element that is sent should be <getPriceWithAction>
        // so it will resolve to the getPriceWithAction operation
        // defined in the WSDL.
        JAXBElement<GetPriceType> getPrice = of.createGetPriceWithAction(gpt);
        JAXBElement<GetPriceResponseType> getPriceResponse = (JAXBElement<GetPriceResponseType>) dispatch.invoke(getPrice);
       
        GetPriceResponseType value = getPriceResponse.getValue();
        assertNotNull("The response was null", value);
       
        float price = value.getPrice();
View Full Code Here

Examples of javax.xml.ws.Dispatch

        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
       
        Service svc = Service.create(url, new QName("http://jaxws.axis2.apache.org", "EchoService"));
        Dispatch dispatch = svc.createDispatch(new QName("http://jaxws.axis2.apache.org", "EchoPort"),
                String.class, Mode.PAYLOAD);
       
        try {
            dispatch.invoke("");
           
            // If an exception wasn't thrown, then it's an error.
            fail();
        } catch (WebServiceException e) {
            // We should only get a WebServiceException here.  Anything else
View Full Code Here

Examples of javax.xml.ws.Dispatch

   
    public void testSetInvalidClientProperties() throws Exception {
        Service svc = Service.create(new QName("http://test", "TestService"));
        QName portQName = new QName("http://test", "TestPort");
        svc.addPort(portQName, null, null);
        Dispatch dispatch = svc.createDispatch(portQName, String.class, Mode.PAYLOAD);
       
        Map<String, Object> map = dispatch.getRequestContext();
       
        try {
            map.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, new Integer(4));
            fail();
        }
View Full Code Here

Examples of javax.xml.ws.Dispatch

        URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl");
        assertNotNull(wsdl1);
       
        ServiceImpl service = new ServiceImpl(getBus(), wsdl1, SERVICE_1, ServiceImpl.class);

        Dispatch dispatch = service.createDispatch(PORT_1, Source.class, Service.Mode.PAYLOAD);
        assertNotNull(dispatch);
    }
View Full Code Here

Examples of javax.xml.ws.Dispatch

        TestLogger.logger.debug("test: " + getName());
       
        BookStoreService service = new BookStoreService();
       
        JAXBContext ctx = JAXBContext.newInstance("org.apache.axis2.jaxws.client.soapaction");
        Dispatch dispatch = service.createDispatch(new QName(targetNamespace, portName),
                ctx, Mode.PAYLOAD);
       
        Map<String, Object> requestCtx = dispatch.getRequestContext();
        requestCtx.put(BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
        requestCtx.put(BindingProvider.SOAPACTION_URI_PROPERTY, "http://jaxws.axis2.apache.org/client/soapaction/getPrice");
       
        ObjectFactory of = new ObjectFactory();
        GetPriceType gpt = of.createGetPriceType();
        gpt.setItem("TEST");
       
        // The element that is sent should be <getPriceWithAction>
        // so it will resolve to the getPriceWithAction operation
        // defined in the WSDL.
        JAXBElement<GetPriceType> getPrice = of.createGetPriceWithAction(gpt);
        JAXBElement<GetPriceResponseType> getPriceResponse = (JAXBElement<GetPriceResponseType>) dispatch.invoke(getPrice);
       
        GetPriceResponseType value = getPriceResponse.getValue();
        assertNotNull("The response was null", value);
       
        float price = value.getPrice();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.