Package javax.xml.rpc

Examples of javax.xml.rpc.Call.invoke()


        /**********************************************/
        call.setOperationName(new QName("urn:xmltoday-delayed-quotes", "test"));
        call.removeAllParameters();
        call.setReturnType(XMLType.XSD_STRING);

        System.out.println(call.invoke(new Object[]{}));
        return ((Float) result).floatValue();
    } // getQuote3

    public static void main(String args[]) throws Exception {
        String    save_args[] = new String[args.length];
View Full Code Here


        call.addParameter("info", XMLType.XSD_STRING, ParameterMode.IN);
        call.setReturnType(XMLType.XSD_STRING);
        call.setProperty(Call.USERNAME_PROPERTY, opts.getUser());
        call.setProperty(Call.PASSWORD_PROPERTY, opts.getPassword());

        String res = (String) call.invoke(new Object[] {args[0], args[1]});

        System.out.println(symbol + ": " + res);
    } // main
}
View Full Code Here

        }
        System.out.println("Executing operation " + operationName + " with parameters:");
        for (int j = 0; j < inputs.size(); j++) {
            System.out.println(inNames.get(j) + "=" + inputs.get(j));
        }
        Object ret = call.invoke(inputs.toArray());
        Map outputs = call.getOutputParams();
        HashMap map = new HashMap();

        for (int pos = 0; pos < outNames.size(); ++pos) {
            String name = (String) outNames.get(pos);
View Full Code Here

      call.setOperationName(new QName(TARGET_NAMESPACE, "echoQName"));
      call.addParameter("QName_1", Constants.TYPE_LITERAL_QNAME, ParameterMode.INOUT);
      call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);

      QNameHolder holder = new QNameHolder(new QName("http://somens", "localPart", "ns1"));
      Object retObj = call.invoke(new Object[]{holder});
      assertNull(retObj);
      assertEquals("{http://somens}localPartResponse", holder.value.toString());
   }

   public void testEchoShort() throws Exception
View Full Code Here

      call.setOperationName(new QName(TARGET_NAMESPACE, "echoShort"));
      call.addParameter("short_1", Constants.TYPE_LITERAL_SHORT, ParameterMode.INOUT);
      call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);

      ShortHolder holder = new ShortHolder((short)1);
      Object retObj = call.invoke(new Object[]{holder});
      assertNull(retObj);
      assertEquals(2, holder.value);
   }

   public void testEchoShortWrapper() throws Exception
View Full Code Here

      call.setOperationName(new QName(TARGET_NAMESPACE, "echoShortWrapper"));
      call.addParameter("Short_1", Constants.TYPE_LITERAL_SHORT, ParameterMode.INOUT);
      call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);

      ShortWrapperHolder holder = new ShortWrapperHolder(new Short((short)1));
      Object retObj = call.invoke(new Object[]{holder});
      assertNull(retObj);
      assertEquals(2, holder.value.shortValue());
   }

   public void testEchoString() throws Exception
View Full Code Here

      call.setOperationName(new QName(TARGET_NAMESPACE, "echoString"));
      call.addParameter("String_1", Constants.TYPE_LITERAL_STRING, ParameterMode.INOUT);
      call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);

      StringHolder holder = new StringHolder("Hello world!");
      Object retObj = call.invoke(new Object[]{holder});
      assertNull(retObj);
      assertEquals("Hello world!Response", holder.value);
   }
}
View Full Code Here

      // Add a bound header to the call
      CallImpl mycall = (CallImpl)call;
      QName xmlName = new QName(HEADER_NAMESPACE_URI, "headerMsg");
      mycall.addParameter(xmlName, Constants.TYPE_LITERAL_STRING, String.class, ParameterMode.IN, true);

      Object retObj = call.invoke(new Object[]{"Hello world!", "IN header message"});
      assertNull(retObj);
   }

   public void testBoundInOutHeader() throws Exception
   {
View Full Code Here

      CallImpl mycall = (CallImpl)call;
      QName xmlName = new QName(HEADER_NAMESPACE_URI, "headerMsg");
      mycall.addParameter(xmlName, Constants.TYPE_LITERAL_STRING, String.class, ParameterMode.INOUT, true);

      StringHolder holder = new StringHolder("INOUT header message");
      Object retObj = call.invoke(new Object[]{"Hello world!", holder});
      assertNull(retObj);

      Map outputParams = call.getOutputParams();
      Object headerValue = outputParams.get(xmlName.getLocalPart());
      assertEquals("INOUT header message - response", headerValue);
View Full Code Here

      CallImpl mycall = (CallImpl)call;
      QName xmlName = new QName(HEADER_NAMESPACE_URI, "headerMsg");
      mycall.addParameter(xmlName, Constants.TYPE_LITERAL_STRING, String.class, ParameterMode.OUT, true);

      StringHolder holder = new StringHolder();
      Object retObj = call.invoke(new Object[]{"Hello world!", holder});
      assertNull(retObj);

      Map outputParams = call.getOutputParams();
      Object headerValue = outputParams.get(xmlName.getLocalPart());
      assertEquals("OUT header message", headerValue);
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.