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 na...@apache.org on 2006/05/19 04:34:18 UTC

svn commit: r407688 - in /webservices/axis/trunk/c/tests/auto_build/testcases: client/c/ tests/

Author: nadiramra
Date: Thu May 18 19:34:18 2006
New Revision: 407688

URL: http://svn.apache.org/viewvc?rev=407688&view=rev
Log:
C support fixes/enhancements. Testcases for C bindings.

Added:
    webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest5Client.c
    webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest7Client.c
    webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest8Client.c
    webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest5C.xml
    webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest7C.xml
    webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest8C.xml

Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest5Client.c
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest5Client.c?rev=407688&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest5Client.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest5Client.c Thu May 18 19:34:18 2006
@@ -0,0 +1,100 @@
+/*
+ *   Copyright 2003-2004 The Apache Software Foundation.
+// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+/*
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ * @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "CommonClientTestCode.h"
+#include "InteropTestPortType.h"
+
+#define ARRAYSIZE 2
+
+int
+main(int argc, char *argv[])
+{
+    AXISCHANDLE ws;
+    
+    int x;
+    char buffer1[100];
+    char endpoint[256];
+    const char *server = "localhost";
+    const char *port = "80";
+    const char *key = NULL;
+    int count = 1;
+    
+    xsdc__string result;
+
+    //endpoint for Axis CPP sample
+    sprintf(endpoint, "http://%s:%s/axis/base", server, port);
+
+    // Set the endpoint from command line argument if set
+    if (argc > 1)
+        strcpy(endpoint, argv[1]);
+
+    /*Set for HTTP transport */
+    ws = get_InteropTestPortType_stub(endpoint);    
+
+    //set HTTP headers
+    axiscStubSetTransportProperty(ws, "SOAPAction", "InteropBase#echoString");
+
+    printf( "invoking echoString...\n" );
+
+    result = echoString(ws, "hello world");
+    if (result && 0 == strcmp(result, "hello world"))
+        printf( "successful\n" );
+    else
+        printf( "failed\n" );
+    axiscAxisDelete(result, XSDC_STRING);
+
+ 
+    printf( "Test transport property accessors\n" );
+    printf( "First transport key = %s\n", axiscStubGetFirstTransportPropertyKey(ws, 0) );
+    printf( "First transport value = %s\n", axiscStubGetCurrentTransportPropertyValue(ws, 0) );
+
+    while (key = axiscStubGetNextTransportPropertyKey(ws, 0))
+    {
+        printf( "Next transport key = %s\n", key );
+        printf( "Next transport value = %s\n", axiscStubGetCurrentTransportPropertyValue(ws, 0) );
+        count++;
+    }
+
+    //test removing HTTP headers
+    axiscStubDeleteTransportProperty(ws, "SOAPAction", 1);
+
+    //now the request should not have these removed headers
+    result = echoString(ws, "hello world");
+    if (result && 0 == strcmp(result, "hello world"))
+        printf( "successful\n" );
+    else
+        printf( "failed\n" );
+    axiscAxisDelete(result, XSDC_STRING);
+
+    destroy_InteropTestPortType_stub(ws);
+
+
+    printf( "HTTP Header test end\n" );
+    return 0;
+}

Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest7Client.c
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest7Client.c?rev=407688&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest7Client.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest7Client.c Thu May 18 19:34:18 2006
@@ -0,0 +1,100 @@
+/*
+ *   Copyright 2003-2004 The Apache Software Foundation.
+// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+/*
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ * @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "CommonClientTestCode.h"
+#include "InteropTestPortType.h"
+
+#define ARRAYSIZE 2
+
+int
+main(int argc, char *argv[])
+{
+    AXISCHANDLE ws;
+    
+    int x;
+    char buffer1[100];
+    char endpoint[256];
+    const char *server = "localhost";
+    const char *port = "80";
+    const char *key = NULL;
+    int count = 1;
+    
+    xsdc__string result;
+
+    //endpoint for Axis CPP sample
+    sprintf(endpoint, "http://%s:%s/axis/base", server, port);
+
+    // Set the endpoint from command line argument if set
+    if (argc > 1)
+        strcpy(endpoint, argv[1]);
+
+    /*Set for HTTP transport */
+    ws = get_InteropTestPortType_stub(endpoint);
+
+    //set HTTP headers
+    axiscStubSetTransportProperty(ws, "Accept-Language", NULL);
+
+    printf( "invoking echoString...\n" );
+
+    result = echoString(ws, "hello world");
+    if (result && 0 == strcmp(result, "hello world"))
+        printf( "successful\n" );
+    else
+        printf( "failed\n" );
+    axiscAxisDelete(result, XSDC_STRING);
+
+    printf( "Test transport property accessors\n" );
+    printf( "First transport key = %s\n", axiscStubGetFirstTransportPropertyKey(ws, 0) );
+    printf( "First transport value = %s\n", axiscStubGetCurrentTransportPropertyValue(ws, 0) );
+
+    while (key = axiscStubGetNextTransportPropertyKey(ws, 0))
+    {
+        printf( "Next transport key = %s\n", key );
+        printf( "Next transport value = %s\n", axiscStubGetCurrentTransportPropertyValue(ws, 0) );
+        count++;
+    }
+
+    //test removing HTTP headers
+    axiscStubDeleteTransportProperty(ws, "Accept-Language", 1);
+
+    //now the request should not have these removed headers
+
+    result = echoString(ws, "hello world");
+    if (result && 0 == strcmp(result, "hello world"))
+        printf( "successful\n" );
+    else
+        printf( "failed\n" );
+    axiscAxisDelete(result, XSDC_STRING);
+
+    destroy_InteropTestPortType_stub(ws);
+
+    printf( "HTTP Header test end\n" );
+
+    return 0;
+}

Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest8Client.c
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest8Client.c?rev=407688&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest8Client.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/RpcHttpHeaderTest8Client.c Thu May 18 19:34:18 2006
@@ -0,0 +1,113 @@
+/*
+ *   Copyright 2003-2004 The Apache Software Foundation.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+/*
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ * @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "CommonClientTestCode.h"
+#include "InteropTestPortType.h"
+
+#define ARRAYSIZE 2
+
+int main( int argc, char * argv[])
+{
+    AXISCHANDLE ws;
+        
+    char                        endpoint[256];
+    const char *        server = "localhost";
+    const char *        port = "80";
+    const char *key = NULL;
+    int count = 1;    
+    char *  pszPropertyKey;
+    char *  pszPropertyValue;
+    xsdc__string result;
+
+    //endpoint for Axis CPP sample
+    sprintf( endpoint, "http://%s:%s/axis/base", server, port);
+
+    // Set the endpoint from command line argument if set
+    if( argc > 1)
+        strcpy( endpoint, argv[1]);
+
+    /*Set for HTTP transport */
+    ws = get_InteropTestPortType_stub(endpoint);
+
+    axiscStubSetTransportProperty(ws,  "SOAPAction" , "InteropBase#echoString");
+
+    //set HTTP headers
+    axiscStubSetTransportProperty(ws,  NULL, "lang2");
+
+    printf( "invoking echoString...\n" );
+
+    result = echoString(ws, "hello world");
+    if (result && 0 == strcmp(result, "hello world"))
+        printf( "successful\n" );
+    else
+        printf( "failed\n" );
+    axiscAxisDelete(result, XSDC_STRING);
+
+
+    printf( "Test transport property accessors\n" );
+
+    // Extra lines added because printf in AIX dos not output (null) when the parameter is NULL.  This just forces the
+    // printf to output (null) when it is.
+    pszPropertyKey = (char *) axiscStubGetFirstTransportPropertyKey(ws, 1);
+    pszPropertyValue = (char *) axiscStubGetCurrentTransportPropertyValue(ws, 1);
+
+    if( pszPropertyKey == NULL)
+        pszPropertyKey = "(null)";
+
+    if( pszPropertyValue == NULL)
+        pszPropertyValue = "(null)";
+
+    printf( "First transport key = %s\n", pszPropertyKey );
+    printf( "First transport value = %s\n", pszPropertyValue );
+
+
+    while (key = axiscStubGetNextTransportPropertyKey(ws, 1))
+    {
+        printf( "Next transport key = %s\n" , key );
+        printf( "Next transport value = %s\n" , axiscStubGetCurrentTransportPropertyValue(ws, 1) );
+        count++;
+    }
+
+    //test removing HTTP headers
+    axiscStubDeleteTransportProperty(ws, "Accept-Language", 1);
+
+    //now the request should not have these removed headers
+    result = echoString(ws, "hello world");
+    if (result && 0 == strcmp(result, "hello world"))
+        printf( "successful\n" );
+    else
+        printf( "failed\n" );
+    axiscAxisDelete(result, XSDC_STRING);
+
+    destroy_InteropTestPortType_stub(ws);
+
+    printf( "HTTP Header test end\n" );
+
+
+    return 0;
+}

Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest5C.xml
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest5C.xml?rev=407688&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest5C.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest5C.xml Thu May 18 19:34:18 2006
@@ -0,0 +1,14 @@
+<test>
+    <name>RpcHttpHeaderTest5C</name>
+    <description>RpcHttpHeaderTest5C</description>
+    <clientLang>c</clientLang>
+    <clientCode>RpcHttpHeaderTest5Client.c</clientCode>
+    <wsdl>RpcHttpHeaderTest5.wsdl</wsdl>
+    <expected>
+        <output>
+            RpcHttpHeaderTest5.cpp.out
+        </output>
+		<serverResponse>RpcHttpHeaderTest5_ServerResponse.expected</serverResponse>
+    </expected>
+	<endpoint>http://localhost:80/axis/InteropBase</endpoint>
+</test>

Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest7C.xml
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest7C.xml?rev=407688&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest7C.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest7C.xml Thu May 18 19:34:18 2006
@@ -0,0 +1,14 @@
+<test>
+    <name>RpcHttpHeaderTest7C</name>
+    <description>RpcHttpHeaderTest7C</description>
+    <clientLang>c</clientLang>
+    <clientCode>RpcHttpHeaderTest7Client.c</clientCode>
+    <wsdl>RpcHttpHeaderTest7.wsdl</wsdl>
+    <expected>
+        <output>
+            RpcHttpHeaderTest7.cpp.out
+        </output>
+    <serverResponse>RpcHttpHeaderTest7_ServerResponse.expected</serverResponse>
+    </expected>
+	<endpoint>http://localhost:80/axis/InteropBase</endpoint>
+</test>

Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest8C.xml
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest8C.xml?rev=407688&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest8C.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/RpcHttpHeaderTest8C.xml Thu May 18 19:34:18 2006
@@ -0,0 +1,14 @@
+<test>
+    <name>RpcHttpHeaderTest8C</name>
+    <description>RpcHttpHeaderTest8C</description>
+    <clientLang>c</clientLang>
+    <clientCode>RpcHttpHeaderTest8Client.c</clientCode>
+    <wsdl>RpcHttpHeaderTest8.wsdl</wsdl>
+    <expected>
+        <output>
+            RpcHttpHeaderTest8.cpp.out
+        </output>
+    <serverResponse>RpcHttpHeaderTest8_ServerResponse.expected</serverResponse>
+    </expected>
+	<endpoint>http://localhost:80/axis/InteropBase</endpoint>
+</test>



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org