Uploaded image for project: 'XML-RPC'
  1. XML-RPC
  2. XMLRPC-95

Client hangs on execute

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 3.0b1
    • None
    • Releases
    • None
    • Win XP
      Java 1.5.0_06

    Description

      Problem description:

      When this server is running and the client is executed, nothing happens.
      The client hangs on the "execute" statement, and neither of them throws any exception or message.
      No indication what goes wrong or were the problem exists.

      Server code:

      ###################################################
      import java.io.IOException;

      import org.apache.xmlrpc.XmlRpcException;
      import org.apache.xmlrpc.common.TypeConverterFactoryImpl;
      import org.apache.xmlrpc.server.DynamicHandlerMapping;
      import org.apache.xmlrpc.server.XmlRpcServerConfigImpl;
      import org.apache.xmlrpc.webserver.WebServer;

      public class RpcServer {

      static int port = 3099;
      private WebServer server;

      public static void main(String[] args)

      { new RpcServer(); }

      public RpcServer(){
      try

      { server = new WebServer(port); XmlRpcServerConfigImpl config = new XmlRpcServerConfigImpl(); config.setEnabledForExtensions(true); config.setContentLengthOptional(true); DynamicHandlerMapping dhm = new DynamicHandlerMapping(new TypeConverterFactoryImpl(), false); dhm.addHandler("Start", this.getClass()); server.getXmlRpcServer().setConfig(config); server.getXmlRpcServer().setHandlerMapping(dhm); server.start(); System.out.println("RPC server running. "); }


      catch (XmlRpcException e)

      { System.out.println("RPC EXcep"); e.printStackTrace(); }


      catch (IOException e)

      { System.out.println("IO EXcep"); e.printStackTrace(); }

      }

      public int loginUser(String userId )

      { System.out.println("In de method"); return 0; }

      }

      ###################################################

      Server includes following jars:

      • commons-logging-1.1.jar
      • ws-commons-util-1.0-SNAPSHOT.jar
      • xmlrpc-common-3.0b1.jar
      • xmlrpc-server-3.0b1.jar

      Client code:

      ###################################################
      import java.net.URL;
      import java.util.List;
      import java.util.Vector;

      import org.apache.xmlrpc.client.XmlRpcClient;
      import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

      public class RpcClient {
      static XmlRpcClient xmlrpc;

      public static void main( String args[] ) {
      try

      { List<String> params = new Vector<String>(); params.add( "48504852" ); XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(new URL("http://192.168.1.1:3099/")); config.setEnabledForExtensions(true); config.setContentLengthOptional(true); xmlrpc = new XmlRpcClient(); xmlrpc.setConfig(config); Integer r = (Integer) xmlrpc.execute ("Start.loginUser", params); System.out.println(r); }

      catch (Exception e)

      { e.printStackTrace(); }

      }
      }

      ###################################################

      Client includes following jars:

      • ws-commons-util-1.0-SNAPSHOT.jar
      • xmlrpc-common-3.0b1.jar
      • xmlrpc-client-3.0b1.jar

      Attachments

        Activity

          People

            Unassigned Unassigned
            buzzer Bit Buzzer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: