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 na...@apache.org on 2006/05/15 06:05:17 UTC
svn commit: r406524 - in /webservices/axis/trunk/c:
src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
tests/auto_build/testcases/client/c/MultiOutClient.c
tests/auto_build/testcases/tests/MultiOutC.xml
Author: nadiramra
Date: Sun May 14 21:05:16 2006
New Revision: 406524
URL: http://svn.apache.org/viewcvs?rev=406524&view=rev
Log:
C support fixes/enhancements. Testcases for C bindings.
Added:
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/MultiOutClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/tests/MultiOutC.xml
Modified:
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java?rev=406524&r1=406523&r2=406524&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java Sun May 14 21:05:16 2006
@@ -296,8 +296,7 @@
boolean bTypeHasStar = paramType.endsWith("*");
- if (paramsB.size()!=0 || 0!=i)
- writer.write(", ");
+ writer.write(", ");
writer.write("AXISC_OUT_PARAM " + paramType);
if (CUtils.isSimpleType(baseTypeName))
@@ -741,9 +740,7 @@
if (currentType.isNillable() || currentType.isOptional())
{
writer.write( "\t\t\t\tif( *OutValue" + i + " == NULL)\n");
- writer.write( "\t\t\t\t{\n");
- writer.write( "\t\t\t\t\t*OutValue" + i + " = new " + currentParaType + "();\n");
- writer.write( "\t\t\t\t}\n");
+ writer.write( "\t\t\t\t\t*OutValue" + i + " = axiscAxisNew(" + CUtils.getXSDTypeForBasicType( baseTypeName) + ", 0);\n");
writer.write( "\n");
writer.write( "\t\t\t\t*");
}
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/MultiOutClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/MultiOutClient.c?rev=406524&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/MultiOutClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/MultiOutClient.c Sun May 14 21:05:16 2006
@@ -0,0 +1,75 @@
+// 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.
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+
+#include "CommonClientTestCode.h"
+#include "MultiOut.h"
+
+int main(int argc, char* argv[])
+{
+ AXISCHANDLE ws;
+
+ xsdc__string OutValue0 = NULL;
+ xsdc__integer * pOutValue1 = NULL;
+ xsdc__int outValue2;
+ xsdc__long outValue3;
+ xsdc__short outValue4;
+ xsdc__decimal outValue5;
+ xsdc__float outValue6;
+ xsdc__double outValue7;
+ xsdc__boolean outValue8;
+ xsdc__byte outValue9;
+
+ axiscAxisRegisterExceptionHandler(exceptionHandler);
+
+ ws = get_MultiOut_stub(argv[1]);
+
+ get(ws,&OutValue0,
+ &pOutValue1,
+ &outValue2,
+ &outValue3,
+ &outValue4,
+ &outValue5,
+ &outValue6,
+ &outValue7,
+ &outValue8,
+ &outValue9);
+
+ printf("%s\n", OutValue0 );
+ printf("%lld\n", *pOutValue1 );
+ printf("%d\n", outValue2 );
+ printf("%lld\n", outValue3 );
+ printf("%hd\n", outValue4 );
+ printf("%.0f\n", outValue5 );
+ printf("%.6g\n", outValue6 );
+ printf("%g\n", outValue7 );
+ printf("%s\n", (outValue8==false_)?"false":"true");
+#ifdef __OS400__
+ if (outValue9 == 0x41) // Ascii 'A'
+ outValue9 = 'A'; // Set to ebcdic A
+#endif
+ printf("%c\n", outValue9 );
+
+ axiscAxisDelete(OutValue0, XSDC_STRING);
+ axiscAxisDelete(pOutValue1, XSDC_INTEGER);
+
+ destroy_MultiOut_stub(ws);
+
+ printf("---------------------- TEST COMPLETE -----------------------------\n");
+ return 0;
+}
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/MultiOutC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/MultiOutC.xml?rev=406524&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/MultiOutC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/MultiOutC.xml Sun May 14 21:05:16 2006
@@ -0,0 +1,16 @@
+<test>
+ <name>MultiOutC</name>
+ <description>MultiOutC</description>
+ <clientLang>c</clientLang>
+ <clientCode>MultiOutClient.c</clientCode>
+ <wsdl>MultiOut.wsdl</wsdl>
+ <expected>
+ <output>
+ MultiOut.expected
+ </output>
+ <serverResponse>
+ MultiOutServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/MultiOut</endpoint>
+</test>