
Autotest Server Feature Demonstration
=====================================

The soapcpp2 option -T generates an autotest server soapTester.c[pp], which can
be used to test a client application against, or to test messaging and XML
databindings. Option -T can be used in combination with option -i to generate
test server object classes, instead of C code.

In this example an autotest server is generated and used to verify the schema
mapping capability against 294 schema patterns published by the W3C Schema
Patterns for Databinding Working Group.

XML Schema Patterns for Databinding Interoperability Testing
------------------------------------------------------------

Basic and advanced XML schema patterns test suite implementation in gSOAP.
Code is autogenerated from WSDL and XSD documents for interoperability testing.

This example shows the auto test functionality for a large WSDL with 294 echo
operations for basic and advanced XML schema patterns. The generated auto test
server implements the echo operations where the echo operations are generated
by soapcpp2 option -T based on the fact that the input and output operation
types are identical.

Acknowledgments and Licenses
----------------------------

W3C XML Schema Patterns for Databinding Working Group:

http://www.w3.org/2002/ws/databinding/

Schemas and XML documents duplicated here with permission:

	examples.wsdl			WSDL with some edits, see below
	examples.xsd			the schema only
	ChameleonIncluded.xsd		referenced in examples.wsdl
	Included.xsd			referenced in examples.wsdl
	RelativeIncluded.xsd		referenced in examples.wsdl
	redefineschema.xsd		referenced in examples.wsdl
	strict.xsd			referenced in examples.wsdl
	databinding/examples/6/09/.../	(copy of XML message files only)

W3C copyright and document licensing:

http://www.w3.org/Consortium/Legal/copyright-documents

Introduction and Usage
----------------------

This example demonstrates the auto-test code generation features of gSOAP. An
echo server is auto-generated and tested with auto-generated XML request
messages and the W3C working group's databingin patterns.

1. Invoke the 'wsdl2h' tool to generate the C++ databindings:

	> wsdl2h -P examples.wsdl

	Note: -P excludes anyType inheritance (to simplify code, not needed)

	Other suggested options for databinding interoperability:

	-c to generate ANSI C (disables support for type inheritance)
	-d to use DOM support for <xs:anyAttribute>, <xs:anyType>, and <xs:any>
	-s to remove STL dependence

2. Invoke the 'soapcpp2' tool to generate the C++ server logic and autotest:

	> soapcpp2 -SL -T -I../../import examples.wsdl

	Note: this generates server-side code w/o *Lib.cpp (-SL option)

	soapStub.h	copy of examples.h without annotations
	soapH.h		serializers
	soapC.cpp	serializers
	soapServer.cpp	server operation dispatcher (RPC skeleton)
	soapTester.cpp	echo server operation implementations (-T option)

3. Compile:

	> c++ -o autotest soapTester.cpp soapServer.cpp soapC.cpp -libgsoap++.a

	or use the stdsoap2.cpp source directly:

	> c++ -o autotest soapTester.cpp soapServer.cpp soapC.cpp stdsoap2.cpp

4. Run the tests:

	> ./autotest < SoapBinding.echoXYZ.req.xml

	Note: XYZ is one of the patterns used in the databinding test suite.

	The autotest server can also run as a standalone application on port
	8080:

	> ./autotest 0 8080

	It will accept the test message over HTTP, e.g. using a router app.

	A shell script is included to test all gSOAP auto-generated XML request
	messages:

	> sh test-self.sh

	which generates a test-self.log with request-response messages.

	A shell script is included to test all W3C basic and advanced XML
	schema patterns with SOAP 1.1 and SOAP 1.2, respectively:

	> sh test-patterns11.sh
	> sh test-patterns12.sh

	which generate test-patterns11.log and test-patterns12.log with
	request-response messages. The faults are not filtered, so skipped
	tests show up as faults in these log files (more details below).
	
Corrected errors and skipped tests in databinding test suite
------------------------------------------------------------

Note: changed <xs:import schemaLocation="..."> in examples.wsdl to make all
imported XSD files local (rather than http addresses to download)

1.	echoLocalElementSimpleType: fixed <ex:localElement>…</ex:localElement>
	in example XML messages in examples/6/09/echoLocalElementSimpleType
2.	echoBlockDefault: skipped
3.	echoElementReferenceUnqualified: fixed in examples.wsdl:
	xmlns="http://www.w3.org/2002/ws/databinding/examples/6/09/" added
4.	echoFinalDefault: skipped
5.	echoMinOccurs1-MinOccurs02: fixed in examples.wsdl: two value elements
	but maxOccurs=1 changed to 2
6.	echoMixedComplexContent: fails but passes with DOM support enabled
	(wsdl2h option -d) to capture mixed content
7.	echoMixedContentType: fails but passes with DOM support enabled (wsdl2h
	option -d) to capture miixed content
8.	echoNoTargetNamespace: skipped
9.	echoQualifiedLocalAttributes: skipped
10.	echoQualifiedLocalElements: skipped
11.	echoSOAPEncodedArray: skipped
12.	echoSchemaVersion: skipped
13.	echoTargetNamespace: skipped
14.	echoUnqualifiedLocalAttributes: skipped
15.	echoUnqualifiedLocalElements: skipped

Some errors could not be corrected and are indicated by "skipped". These
patterns are also skipped in the W3C working group interoperability report due
to the inherent problematic nature.

The following last remaining issue will be corrected in the 2.8 releases:

16.	reordering problem with nested choice and element in a sequence:
	  <sequence>
	    <choice>...
	    <element>...
	  </sequence>
	where the wsdl2h maps this to
	  <sequence>
	    <element>...
	    <choice>...
	  </sequence>
	The temporaty work-around is to edit the generated .h file to
	interchange the struct/class members.

For more information, please visit:

http://www.w3.org/2002/ws/databinding/
