Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 4318 invoked from network); 20 Oct 2004 11:13:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 20 Oct 2004 11:13:39 -0000 Received: (qmail 18149 invoked by uid 500); 20 Oct 2004 11:13:35 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 18095 invoked by uid 500); 20 Oct 2004 11:13:35 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 18080 invoked by uid 99); 20 Oct 2004 11:13:34 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 20 Oct 2004 04:13:34 -0700 Received: (qmail 4231 invoked by uid 1685); 20 Oct 2004 11:13:33 -0000 Date: 20 Oct 2004 11:13:33 -0000 Message-ID: <20041020111333.4230.qmail@minotaur.apache.org> From: sanjaya@apache.org To: ws-axis-cvs@apache.org Subject: cvs commit: ws-axis/c/samples/client/interoptests/groupB InteropGroupBClient.cpp X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N sanjaya 2004/10/20 04:13:33 Modified: c/samples/client/interoptests/groupB InteropGroupBClient.cpp Log: changed argument format to take the whole url Revision Changes Path 1.12 +33 -9 ws-axis/c/samples/client/interoptests/groupB/InteropGroupBClient.cpp Index: InteropGroupBClient.cpp =================================================================== RCS file: /home/cvs/ws-axis/c/samples/client/interoptests/groupB/InteropGroupBClient.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- InteropGroupBClient.cpp 16 Aug 2004 06:15:11 -0000 1.11 +++ InteropGroupBClient.cpp 20 Oct 2004 11:13:33 -0000 1.12 @@ -2,24 +2,48 @@ // #include "InteropTestPortTypeB.h" #include +#include #define ARRAYSIZE 5 +static void +usage (char *programName, char *defaultURL) +{ + cout << "\nUsage:\n" + << programName << " [-? | service_url] " << endl + << " -? Show this help.\n" + << " service_url URL of the service.\n" + << " Default service URL is assumed to be " << defaultURL + << + "\n Could use http://localhost:8080/axis/services/echo to test with Axis Java." + << endl; +} + int main(int argc, char* argv[]) { int x; char endpoint[256]; - const char* server="localhost"; - const char* port="80"; - if (argc == 3) + + // Set default service URL + sprintf (endpoint, "http://localhost/axis/groupB"); + // 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 \n\n", argv[0]); - printf("Sending Requests to Server http://%s:%s ........\n\n", server, port); - sprintf(endpoint, "http://%s:%s/axis/groupB", server, port); - try + + + cout << endl << " Using service at " << endpoint << endl << endl; + + try { InteropTestPortTypeB ws(endpoint); /*we do not support multi-dimensional arrays.*/