Examples of XmlRpcRequest


Examples of org.apache.xmlrpc.XmlRpcRequest

    public static XmlRpcRequest toXmlRpcRequest(final Object[] parameters, Exchange exchange) {
        // get the message operation name
        String operationName = exchange.getIn().getHeader(XmlRpcConstants.METHOD_NAME, String.class);
       
        // create the request object here
        XmlRpcRequest request = new XmlRpcRequestImpl(operationName, parameters);
       
        return request;
    }
View Full Code Here

Examples of org.apache.xmlrpc.XmlRpcRequest

    public static XmlRpcRequest toXmlRpcRequest(final List<?> parameters, Exchange exchange) {
        // get the message operation name
        String operationName = exchange.getIn().getHeader(XmlRpcConstants.METHOD_NAME, String.class);
       
        // create the request object here
        XmlRpcRequest request = new XmlRpcRequestImpl(operationName, parameters);
       
        return request;
    }
View Full Code Here

Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcRequest

   * service specified in the XML-RPC request.
   */
  public void testHandleRequest() throws Exception {
    this.setUpMockObjects();

    XmlRpcRequest xmlRpcRequest = new XmlRpcRequest();
    xmlRpcRequest.setServiceName(this.serviceName);

    // expectation: parse the XML-RPC request.
    this.xmlRpcRequestParser.parseRequest(this.request.getInputStream());
    this.xmlRpcRequestParserControl.setReturnValue(xmlRpcRequest);

View Full Code Here

Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcRequest

   */
  public void testHandleRequestWhenServiceInvocationThrowsException()
      throws Exception {
    this.setUpMockObjects();

    XmlRpcRequest xmlRpcRequest = new XmlRpcRequest();
    xmlRpcRequest.setServiceName(this.serviceName);

    // expectation: parse the XML-RPC request.
    this.xmlRpcRequestParser.parseRequest(this.request.getInputStream());
    this.xmlRpcRequestParserControl.setReturnValue(xmlRpcRequest);

View Full Code Here

Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcRequest

  public void testHandleRequestWhenServiceIsNotFound() {
    this.setUpMockObjects();

    String notExistingServiceName = "anotherService";

    XmlRpcRequest xmlRpcRequest = new XmlRpcRequest();
    xmlRpcRequest.setServiceName(notExistingServiceName);

    // expectation: parse the XML-RPC request.
    this.xmlRpcRequestParser.parseRequest(this.request.getInputStream());
    this.xmlRpcRequestParserControl.setReturnValue(xmlRpcRequest);
View Full Code Here

Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcRequest

    Long customerId = new Long(542);

    String methodName = "getCustomerName";
    XmlRpcElement[] parameters = { new XmlRpcString(customerId.toString()) };

    XmlRpcRequest request = new XmlRpcRequest();
    request.setMethodName(methodName);
    request.setParameters(parameters);

    RemoteInvocation remoteInvocation = this.serviceExporter
        .findMatchingMethod(request);

    assertEquals("<Method name>", methodName, remoteInvocation.getMethodName());
View Full Code Here

Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcRequest

   * throws a <code>{@link XmlRpcMethodNotFoundException}</code> if the method
   * name of the given XML-RPC request does not match any method name of the
   * service.
   */
  public void testFindMatchingMethodWithNotMatchingMethodName() {
    XmlRpcRequest request = new XmlRpcRequest();
    request.setMethodName("notExistingMethod");

    try {
      this.serviceExporter.findMatchingMethod(request);
      fail("A 'XmlRpcMethodNotFoundException' should have been thrown");

View Full Code Here

Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcRequest

   * throws a <code>{@link XmlRpcMethodNotFoundException}</code> if the number
   * of parameters of the given XML-RPC request does not match the number of
   * parameters of the service method with matching name.
   */
  public void testFindMatchingMethodWithNotMatchingParameterCount() {
    XmlRpcRequest request = new XmlRpcRequest();
    request.setMethodName("getCustomerName");

    XmlRpcElement[] parameters = { new XmlRpcString("Luke"),
        new XmlRpcString("Anakin") };
    request.setParameters(parameters);

    try {
      this.serviceExporter.findMatchingMethod(request);
      fail("A 'XmlRpcMethodNotFoundException' should have been thrown");

View Full Code Here

Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcRequest

   * throws a <code>{@link XmlRpcMethodNotFoundException}</code> if the type
   * of the parameters of the given XML-RPC request does not match the type of
   * the parameters of the service method with matching name.
   */
  public void testFindMatchingMethodWithNotMatchingParameterType() {
    XmlRpcRequest request = new XmlRpcRequest();
    request.setMethodName("getCustomerName");

    XmlRpcElement[] parameters = { new XmlRpcString("Luke") };
    request.setParameters(parameters);

    try {
      this.serviceExporter.findMatchingMethod(request);
      fail("A 'XmlRpcMethodNotFoundException' should have been thrown");

View Full Code Here

Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcRequest

    String customerName = "Luke";

    String methodName = "getCustomerName";
    XmlRpcElement[] parameters = { new XmlRpcString(argument.toString()) };

    XmlRpcRequest request = new XmlRpcRequest();
    request.setMethodName(methodName);
    request.setParameters(parameters);
   
    RemoteInvocation invocation = new RemoteInvocation();
    invocation.setMethodName("getCustomerName");
    invocation.setParameterTypes(new Class[] { Long.class });
    invocation.setArguments(new Object[] { argument });
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.