You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2004/10/20 13:12:42 UTC
cvs commit: ws-axis/c/samples/client/interoptests/cgroupB InteropGroupBClient.c
sanjaya 2004/10/20 04:12:42
Modified: c/samples/client/interoptests/cgroupB InteropGroupBClient.c
Log:
changed argument format to take the whole url
Revision Changes Path
1.9 +27 -8 ws-axis/c/samples/client/interoptests/cgroupB/InteropGroupBClient.c
Index: InteropGroupBClient.c
===================================================================
RCS file: /home/cvs/ws-axis/c/samples/client/interoptests/cgroupB/InteropGroupBClient.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- InteropGroupBClient.c 16 Aug 2004 06:15:09 -0000 1.8
+++ InteropGroupBClient.c 20 Oct 2004 11:12:42 -0000 1.9
@@ -6,6 +6,17 @@
#define ARRAYSIZE 2
+static void
+usage (char *programName, char *defaultURL)
+{
+ printf("\nUsage:\n");
+ printf("programName [-? | service_url] \n");
+ printf(" -? Show this help.\n");
+ printf(" service_url URL of the service.\n");
+ printf(" Default service URL is assumed to be %s\n", defaultURL);
+ printf("Could use http://localhost:8080/axis/services/echo to test with Axis Java.\n");
+}
+
int main(int argc, char* argv[])
{
int x;
@@ -17,17 +28,25 @@
int outInt;
float outFloat;
char* str;
+
char endpoint[256];
- const char* server="localhost";
- const char* port="80";
- if (argc == 3)
+ // Set default service URL
+ sprintf (endpoint, "http://localhost/axis/cgroupB");
+ // Could use http://localhost:8080/axis/services/echo to test with Axis Java
+
+ if (argc > 1)
{
- server = argv[1];
- port = argv[2];
+ // Watch for special case help request
+ if (!strncmp (argv[1], "-", 1)) // Check for - only so that it works for
+ //-?, -h or --help; -anything
+ {
+ usage (argv[0], endpoint);
+ return 2;
+ }
+ sprintf (endpoint, argv[1]);
}
- printf("Usage :\n %s <server> <port>\n\n", argv[0]);
- printf("Sending Requests to Server http://%s:%s ........\n\n", server, port);
- sprintf(endpoint, "http://%s:%s/axis/cgroupB", server, port);
+ printf(" Using service at %s\n", endpoint);
+
pstub = get_InteropTestPortTypeB_stub(endpoint);
sas.varFloat = 12345.67890;