You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2006/01/24 06:52:41 UTC

svn commit: r371827 - /webservices/axis2/trunk/c/test/core/clientapi/test_client.c

Author: samisa
Date: Mon Jan 23 21:52:37 2006
New Revision: 371827

URL: http://svn.apache.org/viewcvs?rev=371827&view=rev
Log:

Added getopt 

Modified:
    webservices/axis2/trunk/c/test/core/clientapi/test_client.c

Modified: webservices/axis2/trunk/c/test/core/clientapi/test_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/core/clientapi/test_client.c?rev=371827&r1=371826&r2=371827&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/core/clientapi/test_client.c (original)
+++ webservices/axis2/trunk/c/test/core/clientapi/test_client.c Mon Jan 23 21:52:37 2006
@@ -19,22 +19,29 @@
     char *hostname = "localhost";
     char *port = "9090";
     char *filename = "soap_req";
+    char* endpoint = "/axis2/services/echo/echo";
+    char c;
+    extern char *optarg;
     
-    if (argc > 1) 
+    while ((c = getopt(argc, argv, ":h:p:f:e:")) != -1) 
     {
-        hostname = argv[1];
+        switch(c) 
+        {
+            case 'h':
+                hostname = optarg;
+                break;
+            case 'p':
+                port = optarg;
+                break;
+            case 'f':
+                filename = optarg;
+                break;
+            case 'e':
+                endpoint = optarg;
+                break;
+        }
     }
 
-    if (argc > 2) 
-    {
-        port = argv[2];
-    }
-    
-    if (argc > 3) 
-    {
-        filename = argv[3];
-    }
-    
 	write_to_socket(hostname, port, filename);
     return 0;
 }