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 di...@apache.org on 2005/11/30 17:47:57 UTC
svn commit: r349984 - in /webservices/axis/trunk/c:
src/wsdl/org/apache/axis/wsdl/wsdl2ws/
src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/
src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ src/xml/ src/xml/xerces/
tests/auto_build/testcases/ tests/auto_bu...
Author: dicka
Date: Wed Nov 30 08:47:39 2005
New Revision: 349984
URL: http://svn.apache.org/viewcvs?rev=349984&view=rev
Log:
Provide support for minOccurs="0" (ie: optional elements)
Added:
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/MinOccursIsZeroClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZero.expected
webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZeroRequest.out
webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZero_ServerResponse.expected
webservices/axis/trunk/c/tests/auto_build/testcases/tests/MinOccursIsZero.xml
webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/MinOccursIsZero.wsdl
Modified:
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java
webservices/axis/trunk/c/src/xml/AnyElement.h
webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.cpp
webservices/axis/trunk/c/src/xml/xerces/XercesHandler.cpp
webservices/axis/trunk/c/src/xml/xerces/XercesHandler.h
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/EnumerationClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ManyTypeRefRootClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/MultiOutClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedInOutputClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java Wed Nov 30 08:47:39 2005
@@ -411,6 +411,14 @@
pinfo.setArray(true);
}
pinfo.setNillable(eleinfo.getNillable());
+ if (eleinfo.getMinOccurs() == 0)
+ {
+ pinfo.setOptional(true);
+ }
+ else
+ {
+ pinfo.setOptional(false);
+ }
pinfo.setElementName(
type.getElementForElementName(elementname).getName());
if (innerType.getName().equals(CUtils.anyTypeQname))
@@ -594,6 +602,14 @@
if (innerType.getName().equals(CUtils.anyTypeQname))
pinfo.setAnyType(true);
pinfo.setNillable(eleinfo.getNillable());
+ if (eleinfo.getMinOccurs() == 0)
+ {
+ pinfo.setOptional(true);
+ }
+ else
+ {
+ pinfo.setOptional(false);
+ }
minfo.addInputParameter(pinfo);
}
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java Wed Nov 30 08:47:39 2005
@@ -185,7 +185,7 @@
else
{
// FJP Nillable vv
- if (isElementNillable(i))
+ if (isElementNillable(i) || isElementOptional(i))
{
@@ -528,6 +528,11 @@
}
else if (attribs[i].isSimpleType())
{
+ if (attribs[i].isOptional())
+ {
+ writer.write("\tif (param->" + attribs[i].getParamNameWithoutSymbols() + " != NULL)\n\t{\n\t");
+ }
+
if (CUtils.isPointerType(attribs[i].getTypeName()))
{
writer.write("\tpSZ->serializeAsElement(\""
@@ -549,7 +554,7 @@
*/
if (attribs[i].getChoiceElement()
|| attribs[i].getAllElement()
- || isElementNillable(i))
+ || isElementNillable(i) || isElementOptional(i))
{
if (((attribs[i].getChoiceElement())&&(isElementNillable(i)))&& !(attribs[i].getTypeName().equals("xsd__string")) )
@@ -587,6 +592,11 @@
+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName()) + ");\n");
}
}
+
+ if (attribs[i].isOptional())
+ {
+ writer.write("\t}\n");
+ }
}
else
{
@@ -607,6 +617,11 @@
elm = attribs[i].getTypeName();
}
+ if (attribs[i].isOptional())
+ {
+ writer.write("\tif (param->" + attribs[i].getParamName() + " != NULL)\n\t{\n");
+ }
+
if (attribs[i].getNsQualified())
{
writer.write("\tpSZ->serialize(\"<\", pSZ->getNamespacePrefix(\""
@@ -625,6 +640,11 @@
+ "(param->" + attribs[i].getParamName() + ", pSZ);\n");
writer.write("\tpSZ->serialize(\"</" + elm + "\", \">\", 0);\n");
}
+
+ if (attribs[i].isOptional())
+ {
+ writer.write("\t}\n");
+ }
}
//Dushshantha:
@@ -826,8 +846,17 @@
}
//end remove _Ref sufix and _ prefix in SOAP tag name
+
+ if (attribs[i].isOptional())
+ {
+ writer.write("\tconst char* elementName" + i + " = pIWSDZ->peekNextElementName();\n");
+ writer.write("\tif(strcmp(elementName" + i + ", \"" + soapTagName + "\") == 0)\n");
+ writer.write("\t{\n");
+ }
+
if (attribs[i].isNillable() ||
isElementNillable(i) ||
+ isElementOptional(i) ||
CUtils.isPointerType(attribs[i].getTypeName()))
{
if (attribs[i].getChoiceElement() && !attribs[i].getTypeName().equals("xsd__string"))
@@ -935,6 +964,14 @@
}
}
}
+ if (attribs[i].isOptional())
+ {
+ writer.write("\t}\n");
+ writer.write("\telse\n");
+ writer.write("\t{\n");
+ writer.write("\t\tparam->" + attribs[i].getParamNameAsMember() + " = NULL;\n");
+ writer.write("\t}\n\n");
+ }
}
else
{
@@ -952,6 +989,13 @@
{
soapTagName = soapTagName.substring(1, soapTagName.length());
}
+
+ if (attribs[i].isOptional())
+ {
+ writer.write("\tconst char* elementName" + i + " = pIWSDZ->peekNextElementName();\n");
+ writer.write("\tif(strcmp(elementName" + i + ", \"" + soapTagName + "\") == 0)\n");
+ writer.write("\t{\n");
+ }
//end remove _Ref sufix and _ prefix in SOAP tag name
writer.write("\tparam->" + attribs[i].getParamNameAsMember()
@@ -962,6 +1006,15 @@
+ attribs[i].getTypeName() + ", (void*)Axis_Delete_"
+ attribs[i].getTypeName() + "\n\t\t, \"" + soapTagName
+ "\", Axis_URI_" + attribs[i].getTypeName() + ");\n");
+
+ if (attribs[i].isOptional())
+ {
+ writer.write("\t}\n");
+ writer.write("\telse\n");
+ writer.write("\t{\n");
+ writer.write("\t\tparam->" + attribs[i].getParamNameAsMember() + " = NULL;\n");
+ writer.write("\t}\n\n");
+ }
}
//Dushshantha:
@@ -1421,4 +1474,21 @@
return bNillable;
}
// FJP Nillable ^^
+
+ protected boolean isElementOptional(int index)
+ {
+ //ElementInfo ei = type.getElementForElementName(attribs[index].getParamName());
+ boolean bOptional = false;
+
+ if (//ei != null
+ // &&
+ attribs[index].isSimpleType()
+ && !attribs[index].isArray()
+ && !CUtils.isPointerType(attribs[index].getTypeName()) )
+ {
+ bOptional = attribs[index].isOptional();
+ }
+
+ return bOptional;
+ }
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java Wed Nov 30 08:47:39 2005
@@ -81,7 +81,7 @@
String outParamTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(returnParam, wscontext);
if ((outParamTypeName.lastIndexOf ("_Array") > 0)
|| (CUtils.isSimpleType(outParamTypeName)
- && returnParam.isNillable()
+ && (returnParam.isNillable() || returnParam.isOptional())
&& !(CUtils.isPointerType(outParamTypeName))))
{
writer.write(
@@ -120,7 +120,7 @@
}
else if ((paramTypeName.lastIndexOf ("_Array") > 0)
|| (CUtils.isSimpleType(paramTypeName)
- && nparam.isNillable()
+ && (nparam.isNillable() || nparam.isOptional())
&& !(CUtils.isPointerType(paramTypeName))))
{
writer.write(paramTypeName + " * Value" + j);
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java Wed Nov 30 08:47:39 2005
@@ -222,7 +222,7 @@
else
{
if (returntypeissimple
- && (!returntype.isNillable() || CUtils
+ && (!(returntype.isNillable() || returntype.isOptional()) || CUtils
.isPointerType(outparamType)))
{
writer.write (outparamType);
@@ -280,7 +280,7 @@
writer.write("ISoapAttachment *Value0");
}
else if (typeissimple
- && (!((ParameterInfo) paramsB.get (0)).isNillable ()
+ && (!(((ParameterInfo) paramsB.get (0)).isNillable () || ((ParameterInfo) paramsB.get (0)).isOptional())
|| CUtils.isPointerType(paraTypeName)))
{
writer.write (paraTypeName + " Value0");
@@ -337,7 +337,7 @@
writer.write(", ISoapAttachment *Value" + i);
}
else if (typeissimple
- && (!((ParameterInfo) paramsB.get (i)).isNillable ()
+ && (!(((ParameterInfo) paramsB.get (i)).isNillable () || ((ParameterInfo) paramsB.get (i)).isOptional())
|| CUtils.isPointerType(paraTypeName)))
{
writer.write (", " + paraTypeName + " Value" + i);
@@ -409,7 +409,7 @@
else
{
//for simple types
- if (returntype.isNillable ()
+ if ((returntype.isNillable () || returntype.isOptional())
&& !(CUtils.isPointerType(outparamType)))
{
writer.write (outparamType + "* Ret = NULL;\n");
@@ -581,6 +581,11 @@
((ParameterInfo) paramsB.get (i)).getElementName ().
getNamespaceURI ();
+ if (((ParameterInfo)paramsB.get(i)).isOptional())
+ {
+ writer.write("\tif (Value" + i + " != NULL)\n\t{\n");
+ }
+
if (namespace.length () == 0)
{
writer.write ("\tchar cPrefixAndParamName"
@@ -692,7 +697,7 @@
{
// Simple Type
- if (param.isNillable ()
+ if (param.isNillable () || param.isOptional()
|| CUtils.isPointerType(paraTypeName))
{
writer.write ("\tm_pCall->addParameter(");
@@ -734,9 +739,14 @@
+ i + ", Axis_URI_" + paraTypeName);
}
}
+
}
// Adrian - end of namespace correction
writer.write (");\n");
+ if (((ParameterInfo)paramsB.get(i)).isOptional())
+ {
+ writer.write("\t}\n");
+ }
}
}
writer.write ("\tif (AXIS_SUCCESS == m_pCall->invoke())\n\t{\n");
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java Wed Nov 30 08:47:39 2005
@@ -262,7 +262,8 @@
attribs[i].setParamName( CUtils.sanitiseAttributeName( classname, attribs[i].getParamName()));
// FJP Nillable vv
- if (isElementNillable(i) || attribs[i].isArray()) {
+ if (isElementNillable(i) || attribs[i].isArray() || isElementOptional(i))
+ {
if(attribs[i].isAnyType()){
anyCounter += 1;
writer
@@ -272,7 +273,8 @@
+ Integer.toString(anyCounter)
+ ";\n");
}
- else{
+ else
+ {
if( attribs[i].isArray())
{
writer.write("\tclass "
@@ -355,7 +357,7 @@
}
// FJP Nillable vv
- if (isElementNillable(i) || attribs[i].isArray())
+ if (isElementNillable(i) || attribs[i].isArray() || isElementOptional(i))
{
if ( attribs[i].isAnyType()){
anyCounter += 1;
@@ -604,4 +606,17 @@
return bNillable;
}
// FJP Nillable ^^
+ protected boolean isElementOptional(int index)
+ {
+ boolean bOptional = false;
+
+ if (attribs[index].isSimpleType()
+ && !attribs[index].isArray()
+ && !CUtils.isPointerType(attribs[index].getTypeName()))
+ {
+ bOptional = attribs[index].isOptional();
+ }
+
+ return bOptional;
+ }
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java Wed Nov 30 08:47:39 2005
@@ -34,6 +34,7 @@
protected boolean isArray = false;
private boolean isAttribute = false;
private boolean isNillable = false;
+ private boolean isOptional;
public boolean isNillable()
@@ -271,4 +272,17 @@
isAnyType = b;
}
+ /**
+ * @param b
+ */
+ public void setOptional(boolean b)
+ {
+ this.isOptional = b;
+
+ }
+
+ public boolean isOptional()
+ {
+ return isOptional;
+ }
}
Modified: webservices/axis/trunk/c/src/xml/AnyElement.h
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/xml/AnyElement.h?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/xml/AnyElement.h (original)
+++ webservices/axis/trunk/c/src/xml/AnyElement.h Wed Nov 30 08:47:39 2005
@@ -51,7 +51,7 @@
* Enumeration that defines the SAX events that the AnyElement may contain
*/
typedef enum { START_ELEMENT=0, CHARACTER_ELEMENT, END_ELEMENT,
- START_PREFIX, END_PREFIX, START_END_ELEMENT} XML_NODE_TYPE;
+ START_PREFIX, END_PREFIX, START_END_ELEMENT, UNKNOWN} XML_NODE_TYPE;
/**
* @struct AnyElement
Modified: webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.cpp?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.cpp (original)
+++ webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.cpp Wed Nov 30 08:47:39 2005
@@ -130,28 +130,41 @@
//Here always Peek() will call after the first pase done
const char* XMLParserXerces::peek()
{
- if(!m_bFirstParsed)
+ if (!m_bPeeked)
{
- m_pParser->parseFirst(*m_pInputSource, m_ScanToken);
- m_bFirstParsed = true;
+ if(!m_bFirstParsed)
+ {
+ m_pParser->parseFirst(*m_pInputSource, m_ScanToken);
+ m_bFirstParsed = true;
+ }
+
+ bool bCanParseMore = true;
+
+ m_Xhandler.freeElement();
+ bCanParseMore = m_pParser->parseNext(m_ScanToken);
+ AnyElement* elem = m_Xhandler.getAnyElement();
+ while (CHARACTER_ELEMENT == elem->m_type) // we never peek for char data
+ //hence this is a white space
+ { /* ignorable white space */
+ m_Xhandler.freeElement();
+ bCanParseMore = m_pParser->parseNext(m_ScanToken);
+ elem = m_Xhandler.getAnyElement();
+ }
}
-
- bool bCanParseMore = true;
-
- m_Xhandler.freeElement();
- bCanParseMore = m_pParser->parseNext(m_ScanToken);
- AnyElement* elem = m_Xhandler.getAnyElement();
- while (CHARACTER_ELEMENT == elem->m_type) // we never peek for char data
- //hence this is a white space
- { /* ignorable white space */
- m_Xhandler.freeElement();
- bCanParseMore = m_pParser->parseNext(m_ScanToken);
- elem = m_Xhandler.getAnyElement();
- }
- const char* name = m_Xhandler.peekNextElementName();
m_bPeeked = true;
- return name;
+
+ const XML_NODE_TYPE type = m_Xhandler.peekNextElementType();
+ if(type != END_ELEMENT && type != END_PREFIX && type != UNKNOWN)
+ {
+ const char* name = m_Xhandler.peekNextElementName();
+ return name;
+ }
+ else
+ {
+ return "";
+ }
+
}
//27/04/2005
Modified: webservices/axis/trunk/c/src/xml/xerces/XercesHandler.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/xml/xerces/XercesHandler.cpp?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/xml/xerces/XercesHandler.cpp (original)
+++ webservices/axis/trunk/c/src/xml/xerces/XercesHandler.cpp Wed Nov 30 08:47:39 2005
@@ -304,6 +304,19 @@
else
return NULL;
}
+
+
+const XML_NODE_TYPE XercesHandler::peekNextElementType()
+{
+ if (m_pCurrElement)
+ {
+ return (const XML_NODE_TYPE) m_pCurrElement->m_type;
+ }
+ else
+ {
+ return UNKNOWN;
+ }
+}
//28/04/2005
void XercesHandler::setGetPrefixMappings(bool bValue)
Modified: webservices/axis/trunk/c/src/xml/xerces/XercesHandler.h
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/xml/xerces/XercesHandler.h?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/xml/xerces/XercesHandler.h (original)
+++ webservices/axis/trunk/c/src/xml/xerces/XercesHandler.h Wed Nov 30 08:47:39 2005
@@ -45,6 +45,7 @@
* //Chinthana:This is the method use by XercesPaser to peek ahead next element name
*/
const char* peekNextElementName();
+ const XML_NODE_TYPE XercesHandler::peekNextElementType();
void setGetPrefixMappings(bool bValue);
void reset();
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/EnumerationClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/EnumerationClient.cpp?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/EnumerationClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/EnumerationClient.cpp Wed Nov 30 08:47:39 2005
@@ -61,7 +61,7 @@
NEWCOPY(input->enum_string,"one");
NEWCOPY(input->att_enum_string,"one");
- input->enum_int=ENUMTYPEINT_0;
+ input->enum_int=new xsd__int(ENUMTYPEINT_0);
input->att_enum_int=ENUMTYPEINT_1;
NEWCOPY(input->att_enum_kind,"CHEQUE");
@@ -73,7 +73,7 @@
} else {
cout << "att_enum_int " << result->att_enum_int << endl;
cout << "att_enum_string " << result->att_enum_string << endl;
- cout << "enum_int " << result->enum_int << endl;
+ cout << "enum_int " << *result->enum_int << endl;
cout << "enum_string " << result->enum_string << endl;
cout << "enum_kind " << result->att_enum_kind << endl;
returnValue = 0; // Success
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ManyTypeRefRootClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ManyTypeRefRootClient.cpp?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ManyTypeRefRootClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ManyTypeRefRootClient.cpp Wed Nov 30 08:47:39 2005
@@ -62,7 +62,7 @@
for ( i = 0; i < 10; i++ ) {
types[i] = new Type1 ();
NEWCOPY(types[i]->kind, "Test type");
- types[i]->index = i;
+ types[i]->index = new xsd__int(i);
}
input.set(types,10);
@@ -72,7 +72,7 @@
int outputSize=0;
Type1 **arrayResult = result->get(outputSize);
for ( i = 0; i < 10; i++) {
- cout << " Result " << arrayResult[i]->index << " : " << arrayResult[i]->kind << endl;
+ cout << " Result " << *arrayResult[i]->index << " : " << arrayResult[i]->kind << endl;
}
returnValue = 0; // Success
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/MinOccursIsZeroClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/MinOccursIsZeroClient.cpp?rev=349984&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/MinOccursIsZeroClient.cpp (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/MinOccursIsZeroClient.cpp Wed Nov 30 08:47:39 2005
@@ -0,0 +1,374 @@
+// 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 "MinOccursIsZero.hpp"
+#include "CommonClientTestCode.hpp"
+#include <axis/AxisException.hpp>
+#include <ctype.h>
+#include <iostream>
+#include <signal.h>
+
+void sig_handler(int);
+void PrintUsage();
+bool IsNumber(const char* p);
+
+int main(int argc, char* argv[])
+{
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/MinOccursIsZero";
+
+ signal(SIGILL, sig_handler);
+ signal(SIGABRT, sig_handler);
+ signal(SIGSEGV, sig_handler);
+ //signal(SIGQUIT, sig_handler);
+ //signal(SIGBUS, sig_handler);
+ signal(SIGFPE, sig_handler);
+
+ url = argv[1];
+
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
+
+ do
+ {
+ try
+ {
+ sprintf(endpoint, "%s", url);
+ MinOccursIsZero ws(endpoint);
+
+ // Optional parameters with values
+ cout << "Optional parameters with values" << endl;
+ {
+ // Prepare input parameters
+ xsd__string stringElement = new char[7];
+ strcpy(stringElement, "Hello!");
+ xsd__integer * integerElement = new xsd__integer(123);
+ SimpleComplexType * complexType = new SimpleComplexType();
+ xsd__string stringElement2 = new char[9];
+ strcpy(stringElement2, "Goodbye!");
+ complexType->setstringElement(stringElement2);
+ xsd__integer * integerElement2 = new xsd__integer(234);
+ complexType->setintegerElement(integerElement2);
+ BasicComplexType * basicComplexType = new BasicComplexType();
+ xsd__string stringElement3 = new char[8];
+ strcpy(stringElement3, "Welcome!");
+ basicComplexType->setstringElement(stringElement3);
+ xsd__integer * integerElement3 = new xsd__integer(345);
+ basicComplexType->setintegerElement(integerElement3);
+ complexType->setcomplexType(basicComplexType);
+
+
+ // Prepare output parameters
+ xsd__string outStringElement = NULL;
+ xsd__integer * outIntegerElement = NULL;
+ SimpleComplexType * outComplexType = NULL;
+
+ // Invoke web service
+ ws.optionalElements(stringElement, integerElement, complexType, &outStringElement, &outIntegerElement, &outComplexType);
+
+ // Print results
+ if (outStringElement != NULL)
+ {
+ cout << "String element = " << outStringElement << endl;
+ }
+ else
+ {
+ cout << "String element = NULL" << endl;
+ }
+ if (outIntegerElement != NULL)
+ {
+ cout << "Integer element = " << *outIntegerElement << endl;
+ }
+ else
+ {
+ cout << "Integer element = NULL" << endl;
+ }
+ if (outComplexType != NULL)
+ {
+ cout << "ComplexType" << endl;
+ if (outComplexType->stringElement != NULL)
+ {
+ cout << " String element = " << outComplexType->stringElement << endl;
+ }
+ else
+ {
+ cout << " String element = NULL" << endl;
+ }
+ if (outComplexType->integerElement != NULL)
+ {
+ cout << " Integer element = " << *outComplexType->integerElement << endl;
+ }
+ else
+ {
+ cout << " Integer element = NULL" << endl;
+ }
+ if (outComplexType->complexType != NULL)
+ {
+ cout << " ComplexType" << endl;
+ if (outComplexType->complexType->stringElement != NULL)
+ {
+ cout << " String element = " << outComplexType->complexType->stringElement << endl;
+ }
+ else
+ {
+ cout << " String element = NULL" << endl;
+ }
+ if (outComplexType->complexType->integerElement != NULL)
+ {
+ cout << " Integer element = " << *outComplexType->complexType->integerElement << endl;
+ }
+ else
+ {
+ cout << " Integer element = NULL" << endl;
+ }
+ }
+ else
+ {
+ cout << " ComplexType = NULL" << endl;
+ }
+ }
+ else
+ {
+ cout << "ComplexType = NULL" << endl;
+ }
+ }
+
+
+ // Optional parameters with no values in complex type
+ cout << "Optional parameters with no values in complex type" << endl;
+ {
+ // Prepare input parameters
+ xsd__string stringElement = new char[7];
+ strcpy(stringElement, "Hello!");
+ xsd__integer * integerElement = new xsd__integer(123);
+ SimpleComplexType * complexType = new SimpleComplexType();
+ complexType->setstringElement(NULL);
+ complexType->setintegerElement(NULL);
+ complexType->setcomplexType(NULL);
+
+
+ // Prepare output parameters
+ xsd__string outStringElement = NULL;
+ xsd__integer * outIntegerElement = NULL;
+ SimpleComplexType * outComplexType = NULL;
+
+ // Invoke web service
+ ws.optionalElements(stringElement, integerElement, complexType, &outStringElement, &outIntegerElement, &outComplexType);
+
+ // Print results
+ if (outStringElement != NULL)
+ {
+ cout << "String element = " << outStringElement << endl;
+ }
+ else
+ {
+ cout << "String element = NULL" << endl;
+ }
+ if (outIntegerElement != NULL)
+ {
+ cout << "Integer element = " << *outIntegerElement << endl;
+ }
+ else
+ {
+ cout << "Integer element = NULL" << endl;
+ }
+ if (outComplexType != NULL)
+ {
+ cout << "ComplexType" << endl;
+ if (outComplexType->stringElement != NULL)
+ {
+ cout << " String element = " << outComplexType->stringElement << endl;
+ }
+ else
+ {
+ cout << " String element = NULL" << endl;
+ }
+ if (outComplexType->integerElement != NULL)
+ {
+ cout << " Integer element = " << *outComplexType->integerElement << endl;
+ }
+ else
+ {
+ cout << " Integer element = NULL" << endl;
+ }
+ if (outComplexType->complexType != NULL)
+ {
+ cout << " ComplexType" << endl;
+ if (outComplexType->complexType->stringElement != NULL)
+ {
+ cout << " String element = " << outComplexType->complexType->stringElement << endl;
+ }
+ else
+ {
+ cout << " String element = NULL" << endl;
+ }
+ if (outComplexType->complexType->integerElement != NULL)
+ {
+ cout << " Integer element = " << *outComplexType->complexType->integerElement << endl;
+ }
+ else
+ {
+ cout << " Integer element = NULL" << endl;
+ }
+ }
+ else
+ {
+ cout << " ComplexType = NULL" << endl;
+ }
+ }
+ else
+ {
+ cout << "ComplexType = NULL" << endl;
+ }
+ }
+
+ // Optional parameters with no values
+ cout << "Optional parameters with no values" << endl;
+ {
+ // Prepare output parameters
+ xsd__string outStringElement = NULL;
+ xsd__integer * outIntegerElement = NULL;
+ SimpleComplexType * outComplexType = NULL;
+
+ // Invoke web service
+ ws.optionalElements(NULL, NULL, NULL, &outStringElement, &outIntegerElement, &outComplexType);
+
+ // Print results
+ if (outStringElement != NULL)
+ {
+ cout << "String element = " << outStringElement << endl;
+ }
+ else
+ {
+ cout << "String element = NULL" << endl;
+ }
+ if (outIntegerElement != NULL)
+ {
+ cout << "Integer element = " << *outIntegerElement << endl;
+ }
+ else
+ {
+ cout << "Integer element = NULL" << endl;
+ }
+ if (outComplexType != NULL)
+ {
+ cout << "ComplexType" << endl;
+ if (outComplexType->stringElement != NULL)
+ {
+ cout << " String element = " << outComplexType->stringElement << endl;
+ }
+ else
+ {
+ cout << " String element = NULL" << endl;
+ }
+ if (outComplexType->integerElement != NULL)
+ {
+ cout << " Integer element = " << *outComplexType->integerElement << endl;
+ }
+ else
+ {
+ cout << " Integer element = NULL" << endl;
+ }
+ if (outComplexType->complexType != NULL)
+ {
+ cout << " ComplexType" << endl;
+ if (outComplexType->complexType->stringElement != NULL)
+ {
+ cout << " String element = " << outComplexType->complexType->stringElement << endl;
+ }
+ else
+ {
+ cout << " String element = NULL" << endl;
+ }
+ if (outComplexType->complexType->integerElement != NULL)
+ {
+ cout << " Integer element = " << *outComplexType->complexType->integerElement << endl;
+ }
+ else
+ {
+ cout << " Integer element = NULL" << endl;
+ }
+ }
+ else
+ {
+ cout << " ComplexType = NULL" << endl;
+ }
+ }
+ else
+ {
+ cout << "ComplexType = NULL" << endl;
+ }
+ }
+
+ bSuccess = true;
+ }
+ catch(AxisException& e)
+ {
+ bool bSilent = false;
+
+ if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+ {
+ if( iRetryIterationCount > 0)
+ {
+ bSilent = true;
+ }
+ }
+ else
+ {
+ iRetryIterationCount = 0;
+ }
+
+ if( !bSilent)
+ {
+ cout << "Exception : " << e.what() << endl;
+ }
+ }
+ catch(exception& e)
+ {
+ cout << "Unknown exception has occured" << endl;
+ }
+ catch(...)
+ {
+ cout << "Unknown exception has occured" << endl;
+ }
+ iRetryIterationCount--;
+ } while( iRetryIterationCount > 0 && !bSuccess);
+
+ cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+
+ return 0;
+}
+
+void PrintUsage()
+{
+ printf("Usage :\n Calculator <url>\n\n");
+ exit(1);
+}
+
+bool IsNumber(const char* p)
+{
+ for (int x=0; x < strlen(p); x++)
+ {
+ if (!isdigit(p[x])) return false;
+ }
+ return true;
+}
+
+void sig_handler(int sig) {
+ signal(sig, sig_handler);
+ cout << "SIGNAL RECEIVED " << sig << endl;
+ exit(1);
+}
+
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/MultiOutClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/MultiOutClient.cpp?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/MultiOutClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/MultiOutClient.cpp Wed Nov 30 08:47:39 2005
@@ -29,7 +29,7 @@
MultiOut ws(argv[1]);
xsd__string OutValue0 = NULL;
- xsd__integer OutValue1 = 0;
+ xsd__integer * OutValue1 = NULL;
xsd__int OutValue2 = 0;
xsd__long OutValue3 = 0;
xsd__short OutValue4 = 0;
@@ -52,7 +52,7 @@
char sInteger[128], sLong[128];
#ifdef WIN32
- sprintf(sInteger,"%I64d",OutValue1);
+ sprintf(sInteger,"%I64d",*OutValue1);
sprintf(sLong,"%I64d",OutValue3);
#else
sprintf(sInteger,"%lld",OutValue1);
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedClient.cpp?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedClient.cpp Wed Nov 30 08:47:39 2005
@@ -55,7 +55,7 @@
Type1* result;
int i;
- input->enum_int = ENUMTYPEINT_1;
+ input->enum_int = new xsd__int(ENUMTYPEINT_1);
input->enum_string = strdup("one");
input->att_enum_kind = strdup("CHEQUE");
input->att_enum_string = strdup("one");
@@ -88,7 +88,7 @@
else {
cout << "att_enum_int " << result->att_enum_int << endl;
cout << "att_enum_string " << result->att_enum_string << endl;
- cout << "enum_int " << result->enum_int << endl;
+ cout << "enum_int " << *result->enum_int << endl;
cout << "enum_string " << result->enum_string << endl;
cout << "enum_kind " << result->att_enum_kind << endl;
returnValue = 0; // Success
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedInOutputClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedInOutputClient.cpp?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedInOutputClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedInOutputClient.cpp Wed Nov 30 08:47:39 2005
@@ -53,7 +53,7 @@
Type1* result;
int i;
- int size = 10;
+ xsd__int * size = new xsd__int(10);
result = ws->getInput(size);
Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZero.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZero.expected?rev=349984&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZero.expected (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZero.expected Wed Nov 30 08:47:39 2005
@@ -0,0 +1,21 @@
+Optional parameters with values
+String element = Hello!
+Integer element = 123
+ComplexType
+ String element = Goodbye!
+ Integer element = 234
+ ComplexType
+ String element = Welcome!
+ Integer element = 345
+Optional parameters with no values in complex type
+String element = Hello!
+Integer element = 123
+ComplexType
+ String element = NULL
+ Integer element = NULL
+ ComplexType = NULL
+Optional parameters with no values
+String element = NULL
+Integer element = NULL
+ComplexType = NULL
+---------------------- TEST COMPLETE -----------------------------
Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZeroRequest.out
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZeroRequest.out?rev=349984&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZeroRequest.out (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZeroRequest.out Wed Nov 30 08:47:39 2005
@@ -0,0 +1,170 @@
+POST /XSD_string/services/XSD_stringSOAP HTTP/1.1
+Host: localhost:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "XSD_string#asNonNillableElement"
+Content-Length: 452
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:AsNonNillableElementRequest xmlns:ns1="http://xsd_string.test.apache.org">
+<nonNillableElement>A simple test message!</nonNillableElement>
+</ns1:AsNonNillableElementRequest>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
+POST /XSD_string/services/XSD_stringSOAP HTTP/1.1
+Host: localhost:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "XSD_string#asNonNillableElement"
+Content-Length: 430
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:AsNonNillableElementRequest xmlns:ns1="http://xsd_string.test.apache.org">
+<nonNillableElement></nonNillableElement>
+</ns1:AsNonNillableElementRequest>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
+POST /XSD_string/services/XSD_stringSOAP HTTP/1.1
+Host: localhost:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "XSD_string#asNonNillableElement"
+Content-Length: 455
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:AsNonNillableElementRequest xmlns:ns1="http://xsd_string.test.apache.org">
+<nonNillableElement><>&"'</nonNillableElement>
+</ns1:AsNonNillableElementRequest>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
+POST /XSD_string/services/XSD_stringSOAP HTTP/1.1
+Host: localhost:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "XSD_string#asNonNillableElement"
+Content-Length: 461
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:AsNonNillableElementRequest xmlns:ns1="http://xsd_string.test.apache.org">
+<nonNillableElement>
+some text
+more text
+</nonNillableElement>
+</ns1:AsNonNillableElementRequest>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
+POST /XSD_string/services/XSD_stringSOAP HTTP/1.1
+Host: localhost:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "XSD_string#asNonNillableElement"
+Content-Length: 440
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:asNillableElementRequest xmlns:ns1="http://xsd_string.test.apache.org">
+<nillableElement>A simple test message!</nillableElement>
+</ns1:asNillableElementRequest>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
+POST /XSD_string/services/XSD_stringSOAP HTTP/1.1
+Host: localhost:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "XSD_string#asNonNillableElement"
+Content-Length: 418
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:asNillableElementRequest xmlns:ns1="http://xsd_string.test.apache.org">
+<nillableElement></nillableElement>
+</ns1:asNillableElementRequest>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
+POST /XSD_string/services/XSD_stringSOAP HTTP/1.1
+Host: localhost:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "XSD_string#asNonNillableElement"
+Content-Length: 433
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:asNillableElementRequest xmlns:ns1="http://xsd_string.test.apache.org">
+<nillableElement xsi:nil="true"></nillableElement>
+</ns1:asNillableElementRequest>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
+POST /XSD_string/services/XSD_stringSOAP HTTP/1.1
+Host: localhost:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "XSD_string#asNonNillableElement"
+Content-Length: 483
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:asRequiredAttributeRequest xmlns:ns1="http://xsd_string.test.apache.org">
+<RequiredAttributeElement requiredAttribute="A simple test message!"></RequiredAttributeElement>
+</ns1:asRequiredAttributeRequest>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
+POST /XSD_string/services/XSD_stringSOAP HTTP/1.1
+Host: localhost:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "XSD_string#asNonNillableElement"
+Content-Length: 461
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:asRequiredAttributeRequest xmlns:ns1="http://xsd_string.test.apache.org">
+<RequiredAttributeElement requiredAttribute=""></RequiredAttributeElement>
+</ns1:asRequiredAttributeRequest>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
+POST /XSD_string/services/XSD_stringSOAP HTTP/1.1
+Host: localhost:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "XSD_string#asNonNillableElement"
+Content-Length: 466
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:asArrayRequest xmlns:ns1="http://xsd_string.test.apache.org">
+<arrayElement>A simple test message!</arrayElement>
+<arrayElement>A simple test message!</arrayElement>
+</ns1:asArrayRequest>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
+POST /XSD_string/services/XSD_stringSOAP HTTP/1.1
+Host: localhost:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "XSD_string#asNonNillableElement"
+Content-Length: 486
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:asComplexTypeRequest xmlns:ns1="http://xsd_string.test.apache.org">
+<SimpleComplexType><ns1:complexTypeElement>A simple test message!</ns1:complexTypeElement>
+</SimpleComplexType>
+</ns1:asComplexTypeRequest>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZero_ServerResponse.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZero_ServerResponse.expected?rev=349984&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZero_ServerResponse.expected (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/MinOccursIsZero_ServerResponse.expected Wed Nov 30 08:47:39 2005
@@ -0,0 +1,33 @@
+HTTP/1.1 200 OK
+Server: WebSphere Application Server/5.1
+Content-Type: text/xml; charset=utf-8
+Content-Language: en-GB
+Transfer-Encoding: chunked
+
+###
+<?xml version="1.0" encoding="utf-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:optionalElementsResponse xmlns:ns1="http://tempuri.org/MinOccursIsZero/"><stringElement>Hello!</stringElement><integerElement>123</integerElement><complexType><stringElement>Goodbye!</stringElement><integerElement>234</integerElement><complexType><stringElement>Welcome!</stringElement><integerElement>345</integerElement></complexType></complexType></ns1:optionalElementsResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+0
+
+HTTP/1.1 200 OK
+Server: WebSphere Application Server/5.1
+Content-Type: text/xml; charset=utf-8
+Content-Language: en-GB
+Transfer-Encoding: chunked
+
+###
+<?xml version="1.0" encoding="utf-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:optionalElementsResponse xmlns:ns1="http://tempuri.org/MinOccursIsZero/"><stringElement>Hello!</stringElement><integerElement>123</integerElement><complexType></complexType></ns1:optionalElementsResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+0
+
+HTTP/1.1 200 OK
+Server: WebSphere Application Server/5.1
+Content-Type: text/xml; charset=utf-8
+Content-Language: en-GB
+Transfer-Encoding: chunked
+
+###
+<?xml version="1.0" encoding="utf-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:optionalElementsResponse xmlns:ns1="http://tempuri.org/MinOccursIsZero/"></ns1:optionalElementsResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+0
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/MinOccursIsZero.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/MinOccursIsZero.xml?rev=349984&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/MinOccursIsZero.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/MinOccursIsZero.xml Wed Nov 30 08:47:39 2005
@@ -0,0 +1,20 @@
+<test>
+ <name>MinOccursIsZero</name>
+ <description>Test correct serialization, deserialization and detection of optional elements</description>
+ <clientLang>cpp</clientLang>
+ <clientCode>MinOccursIsZeroClient.cpp</clientCode>
+ <wsdl>MinOccursIsZero.wsdl</wsdl>
+ <expected>
+ <output>
+ MinOccursIsZero.expected
+ </output>
+ <request>
+ MinOccursIsZeroRequest.out
+ </request>
+ <serverResponse>
+ MinOccursIsZero_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/MinOccursIsZero</endpoint>
+</test>
+
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list?rev=349984&r1=349983&r2=349984&view=diff
==============================================================================
Binary files - no diff available.
Added: webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/MinOccursIsZero.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/MinOccursIsZero.wsdl?rev=349984&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/MinOccursIsZero.wsdl (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/MinOccursIsZero.wsdl Wed Nov 30 08:47:39 2005
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/MinOccursIsZero/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MinOccursIsZero" targetNamespace="http://tempuri.org/MinOccursIsZero/">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://tempuri.org/MinOccursIsZero/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="optionalElementsResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="stringElement" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="false"></xsd:element>
+ <xsd:element name="integerElement" type="xsd:integer" minOccurs="0" maxOccurs="1" nillable="false"></xsd:element>
+ <xsd:element name="complexType" type="tns:SimpleComplexType" minOccurs="0" maxOccurs="1" nillable="false"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="optionalElementsRequest">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="stringElement" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="false"></xsd:element>
+ <xsd:element name="integerElement" type="xsd:integer" minOccurs="0" maxOccurs="1" nillable="false"></xsd:element>
+ <xsd:element name="complexType" type="tns:SimpleComplexType" minOccurs="0" maxOccurs="1" nillable="false"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:complexType name="SimpleComplexType">
+ <xsd:sequence>
+ <xsd:element name="stringElement" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="false"/>
+ <xsd:element name="integerElement" type="xsd:integer" minOccurs="0" maxOccurs="1" nillable="false"/>
+ <xsd:element name="complexType" type="tns:BasicComplexType" minOccurs="0" maxOccurs="1" nillable="false"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="BasicComplexType">
+ <xsd:sequence>
+ <xsd:element name="stringElement" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="false"></xsd:element>
+ <xsd:element name="integerElement" type="xsd:integer" minOccurs="0" maxOccurs="1" nillable="false"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="optionalElementsResponse">
+ <wsdl:part element="tns:optionalElementsResponse" name="optionalElementsResponse"/>
+ </wsdl:message>
+ <wsdl:message name="optionalElementsRequest">
+ <wsdl:part element="tns:optionalElementsRequest" name="optionalElementsRequest"/>
+ </wsdl:message>
+ <wsdl:portType name="MinOccursIsZero">
+ <wsdl:operation name="optionalElements">
+ <wsdl:input message="tns:optionalElementsRequest"/>
+ <wsdl:output message="tns:optionalElementsResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="MinOccursIsZeroSOAP" type="tns:MinOccursIsZero">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="optionalElements">
+ <soap:operation soapAction="http://tempuri.org/MinOccursIsZero/NewOperation"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="MinOccursIsZero">
+ <wsdl:port binding="tns:MinOccursIsZeroSOAP" name="MinOccursIsZeroSOAP">
+ <soap:address location="http://tempuri.org"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>