Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 56647 invoked from network); 16 May 2006 01:16:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 May 2006 01:16:34 -0000 Received: (qmail 59488 invoked by uid 500); 16 May 2006 01:16:32 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 59403 invoked by uid 500); 16 May 2006 01:16:32 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 59391 invoked by uid 99); 16 May 2006 01:16:32 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 May 2006 18:16:32 -0700 X-ASF-Spam-Status: No, hits=-8.2 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,WEIRD_QUOTING 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.29) with SMTP; Mon, 15 May 2006 18:16:31 -0700 Received: (qmail 56573 invoked by uid 65534); 16 May 2006 01:16:09 -0000 Message-ID: <20060516011609.56570.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r406794 - in /webservices/axis/trunk/c: src/cbindings/ tests/auto_build/testcases/client/c/ tests/auto_build/testcases/tests/ Date: Tue, 16 May 2006 01:15:44 -0000 To: axis-cvs@ws.apache.org From: nadiramra@apache.org X-Mailer: svnmailer-1.0.8 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: nadiramra Date: Mon May 15 18:15:42 2006 New Revision: 406794 URL: http://svn.apache.org/viewcvs?rev=406794&view=rev Log: C support fixes/enhancements. Testcases for C bindings. Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest1Client.c webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest2Client.c webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest3Client.c webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest4Client.c webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest1C.xml webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest2C.xml webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest3C.xml webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest4C.xml Modified: webservices/axis/trunk/c/src/cbindings/IAttributeC.cpp Modified: webservices/axis/trunk/c/src/cbindings/IAttributeC.cpp URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/cbindings/IAttributeC.cpp?rev=406794&r1=406793&r2=406794&view=diff ============================================================================== --- webservices/axis/trunk/c/src/cbindings/IAttributeC.cpp (original) +++ webservices/axis/trunk/c/src/cbindings/IAttributeC.cpp Mon May 15 18:15:42 2006 @@ -70,7 +70,7 @@ } AXISC_STORAGE_CLASS_INFO -int axiscAttributeSetUri(AXISCHANDLE attribute, +int axiscAttributeSetURI(AXISCHANDLE attribute, const AxiscChar * uri) { IAttribute *attr = (IAttribute*)attribute; @@ -158,7 +158,7 @@ } AXISC_STORAGE_CLASS_INFO -const AxiscChar * axiscAttributeGetUri(AXISCHANDLE attribute) +const AxiscChar * axiscAttributeGetURI(AXISCHANDLE attribute) { IAttribute *attr = (IAttribute*)attribute; Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest1Client.c URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest1Client.c?rev=406794&view=auto ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest1Client.c (added) +++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest1Client.c Mon May 15 18:15:42 2006 @@ -0,0 +1,77 @@ +// 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. + +/* Tests setLocalName() and getLocalName()in IAttribute class + @Author : James Jose +*/ + + +#include +#include +#include + +#include "CommonClientTestCode.h" +#include "Calculator.h" + + +int main(int argc, char* argv[]) +{ + AXISCHANDLE ws; + + char endpoint[256]; + const char* url="http://localhost:80/axis/Calculator"; + const char* op = 0; + int i1=0, i2=0; + int iResult; + + const char *name="Name"; + + AXISCHANDLE phb; + AXISCHANDLE attr, attr1; + AXISCHANDLE bn; + + axiscAxisRegisterExceptionHandler(exceptionHandler); + + if (argc > 1) + url = argv[1]; + sprintf(endpoint, "%s", url); + + ws = get_Calculator_stub(endpoint); + + phb = axiscStubCreateSOAPHeaderBlock(ws, "TestHeader","http://ws.apache.org/","ns"); + attr=axiscHeaderBlockCreateAttribute(phb, "NAME","ns",NULL, "AXIS"); + printf("%d\n", axiscAttributeSetLocalName(attr, NULL)); + printf("%d\n", axiscAttributeSetLocalName(attr, name)); + bn=axiscHeaderBlockCreateImmediateChildBasicNode(phb, ELEMENT_NODE,"Project","","",""); + attr1=axiscBasicNodeCreateAttribute(bn, "TYPE", NULL, NULL, "Open Source"); + axiscAttributeSetLocalName(attr1, "Type"); + printf( "Header Attribute Name = %s\n" , axiscAttributeGetLocalName(attr)) ; + printf( "Child Node Attribute Name = %s\n" , axiscAttributeGetLocalName(attr1) ); + op = "add"; + i1 = 2; + i2 = 3; + if (strcmp(op, "add") == 0) + { + iResult = add(ws, i1, i2); + printf("%d\n", iResult ); + } + + destroy_Calculator_stub(ws); + + printf("---------------------- TEST COMPLETE -----------------------------\n" ); + + return 0; +} + Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest2Client.c URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest2Client.c?rev=406794&view=auto ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest2Client.c (added) +++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest2Client.c Mon May 15 18:15:42 2006 @@ -0,0 +1,81 @@ +// 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. + + +/* Tests setPrefix() and getPrefix()in IAttribute class +@ Author : James Jose +*/ + + +#include +#include +#include + +#include "CommonClientTestCode.h" +#include "Calculator.h" + +int main(int argc, char* argv[]) +{ + AXISCHANDLE ws; + + char endpoint[256]; + const char* url="http://localhost:80/axis/Calculator"; + const char* op = 0; + int i1=0, i2=0; + int iResult; + + const char *prefix="nsp"; + + AXISCHANDLE phb; + AXISCHANDLE attr1, attr2; + AXISCHANDLE bn; + + axiscAxisRegisterExceptionHandler(exceptionHandler); + + if (argc > 1) + url = argv[1]; + sprintf(endpoint, "%s", url); + + ws = get_Calculator_stub(endpoint); + + phb = axiscStubCreateSOAPHeaderBlock(ws, "TestHeader","http://ws.apache.org/","nsp"); + attr1=axiscHeaderBlockCreateAttribute(phb, "Name","ns", NULL, "AXIS"); + + /* Tests for NULL Value */ + printf("%d\n", axiscAttributeSetPrefix(attr1, NULL)); + printf("%d\n", axiscAttributeSetPrefix(attr1, prefix)); + bn=axiscHeaderBlockCreateImmediateChildBasicNode(phb, ELEMENT_NODE,"Project","","",""); + attr2=axiscBasicNodeCreateAttribute(bn, "TYPE",NULL, NULL, "Open Source"); + + /* Tests for non declared namespace prefix */ + printf("%d\n", axiscAttributeSetPrefix(attr2, "nd")); + printf( "Header Attribute Prefix = %s\n" , axiscAttributeGetPrefix(attr1)); + printf( "Child Node Attribute Prefix = %s\n" , axiscAttributeGetPrefix(attr2)); + op = "add"; + i1 = 2; + i2 = 3; + if (strcmp(op, "add") == 0) + { + iResult = add(ws, i1, i2); + printf("%d\n", iResult ); + } + + destroy_Calculator_stub(ws); + + printf("---------------------- TEST COMPLETE -----------------------------\n"); + + return 0; +} + Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest3Client.c URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest3Client.c?rev=406794&view=auto ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest3Client.c (added) +++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest3Client.c Mon May 15 18:15:42 2006 @@ -0,0 +1,78 @@ +// 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. + + +/* Tests setValue() and getValue()in IAttribute class +@ Author : James Jose +*/ + +#include +#include +#include + +#include "CommonClientTestCode.h" +#include "Calculator.h" + +int main(int argc, char* argv[]) +{ + AXISCHANDLE ws; + + char endpoint[256]; + const char* url="http://localhost:80/axis/Calculator"; + const char* op = 0; + int i1=0, i2=0; + int iResult; + + const char *Value="AXIS"; + + AXISCHANDLE phb; + AXISCHANDLE attr1, attr2; + AXISCHANDLE bn; + + axiscAxisRegisterExceptionHandler(exceptionHandler); + + if (argc > 1) + url = argv[1]; + sprintf(endpoint, "%s", url); + + ws = get_Calculator_stub(endpoint); + + phb = axiscStubCreateSOAPHeaderBlock(ws, "TestHeader","http://ws.apache.org/","ns"); + attr1=axiscHeaderBlockCreateAttribute(phb, "Name","ns", NULL, "axis"); + + /*Tests for NULL Value */ + printf("%d\n", axiscAttributeSetValue(attr1, NULL) ); + printf("%d\n", axiscAttributeSetValue(attr1, Value)); + + bn=axiscHeaderBlockCreateImmediateChildBasicNode(phb, ELEMENT_NODE,"Project","","",""); + attr2=axiscBasicNodeCreateAttribute(bn, "TYPE", NULL, NULL, "OPEN SOURCE"); + axiscAttributeSetValue(attr2, "Open Source"); + printf( "Header Attribute Value = %s\n" , axiscAttributeGetValue(attr1)); + printf( "Child Node Attribute Value = %s\n" , axiscAttributeGetValue(attr2)); + op = "add"; + i1 = 2; + i2 = 3; + if (strcmp(op, "add") == 0) + { + iResult = add(ws, i1, i2); + printf("%d\n", iResult ); + } + + destroy_Calculator_stub(ws); + + printf("---------------------- TEST COMPLETE -----------------------------\n"); + return 0; +} + Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest4Client.c URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest4Client.c?rev=406794&view=auto ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest4Client.c (added) +++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/IAttributeTest4Client.c Mon May 15 18:15:42 2006 @@ -0,0 +1,81 @@ +// 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. + + +/* Tests setURI() and getURI()in IAttribute Class +@ Author : James Jose +*/ + +#include +#include +#include + +#include "CommonClientTestCode.h" +#include "Calculator.h" + +int main(int argc, char* argv[]) +{ + AXISCHANDLE ws; + + char endpoint[256]; + const char* url="http://localhost:80/axis/Calculator"; + const char* op = 0; + int i1=0, i2=0; + int iResult; + const char *uri="http://axis.apache.com"; + + + AXISCHANDLE phb; + AXISCHANDLE nsp; + AXISCHANDLE attr1, *attr2; + AXISCHANDLE bn; + + axiscAxisRegisterExceptionHandler(exceptionHandler); + + if (argc > 1) + url = argv[1]; + sprintf(endpoint, "%s", url); + + ws = get_Calculator_stub(endpoint); + + phb = axiscStubCreateSOAPHeaderBlock(ws, "TestHeader","http://ws.apache.org/","ns"); + nsp=axiscHeaderBlockCreateNamespaceDeclINamespace(phb, "nsp","http://apache.com"); + attr1=axiscHeaderBlockCreateAttribute(phb, "Name","nsp", NULL,"axis"); + printf("%d\n", axiscAttributeSetURI(attr1, NULL)); + + /* Changing the URI associated with the attribute. Here the prefix should also will change. */ + printf("%d\n", axiscAttributeSetURI(attr1, "http://axis.apache.com")); + bn=axiscHeaderBlockCreateImmediateChildBasicNode(phb, ELEMENT_NODE,"Project","","",""); + attr2=axiscBasicNodeCreateAttribute(bn, "TYPE", NULL, NULL, "OPEN SOURCE"); + axiscAttributeSetURI(attr2, uri); + + printf( "Header Attribute Uri = %s\n" , axiscAttributeGetURI(attr1)); + printf( "Child Node Attribute Uri = %s\n" , axiscAttributeGetURI(attr2)); + op = "add"; + i1 = 2; + i2 = 3; + if (strcmp(op, "add") == 0) + { + iResult = add(ws, i1, i2); + printf("%d\n", iResult ); + } + + destroy_Calculator_stub(ws); + + printf("---------------------- TEST COMPLETE -----------------------------\n"); + + return 0; +} + Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest1C.xml URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest1C.xml?rev=406794&view=auto ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest1C.xml (added) +++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest1C.xml Mon May 15 18:15:42 2006 @@ -0,0 +1,16 @@ + + IAttributeTest1C + IAttributeTest1C + c + IAttributeTest1Client.c + CalculatorDocC.wsdl + + + IAttributeTest1.expected + + + IAttributeTest1Request.out + + + http://localhost:80/axis/CalculatorDoc + Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest2C.xml URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest2C.xml?rev=406794&view=auto ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest2C.xml (added) +++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest2C.xml Mon May 15 18:15:42 2006 @@ -0,0 +1,13 @@ + + IAttributeTest2C + IAttributeTest2C + c + IAttributeTest2Client.c + CalculatorDocC.wsdl + + + IAttributeTest2.expected + + + http://localhost:80/axis/CalculatorDoc + Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest3C.xml URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest3C.xml?rev=406794&view=auto ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest3C.xml (added) +++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest3C.xml Mon May 15 18:15:42 2006 @@ -0,0 +1,16 @@ + + IAttributeTest3C + IAttributeTest3C + c + IAttributeTest3Client.c + CalculatorDocC.wsdl + + + IAttributeTest3.expected + + + IAttributeTest3Request.out + + + http://localhost:80/axis/CalculatorDoc + Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest4C.xml URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest4C.xml?rev=406794&view=auto ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest4C.xml (added) +++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/IAttributeTest4C.xml Mon May 15 18:15:42 2006 @@ -0,0 +1,16 @@ + + IAttributeTest4C + IAttributeTest4C + c + IAttributeTest4Client.c + CalculatorDocC.wsdl + + + IAttributeTest4.expected + + + IAttributeTest4Request.out + + + http://localhost:80/axis/CalculatorDoc +