" ---------------------------------------------------------------------------------------

This file contains scripts to configure and invoke the VAST Web services insurance example using SOAP 1.2 messages.
Packaged runtime images should include the application SstWebServicesSoap12App.  The application will not be included
by default.

The files in this directory are as follows:


	SstWSSoap12ServerContainer.xml -  A container deployment descriptor configured to process both SOAP 1.1 and SOAP 1.2 messages.
	Configuration for SOAP 1.2 is accomplished by deploying the SOAP 1.2 schemas and mapping specs in the deployment descriptor
	as shown below.  Users may consider downloading the references URLs and referencing a local copy to insure availability.
	<schemaUrls>
			<schemaUrl>http://www.w3.org/2003/05/soap-envelope/</schemaUrl>

			<schemaUrl>http://www.w3.org/2003/05/soap-encoding</schemaUrl>

			<schemaUrl>http://www.w3.org/2003/05/soap-rpc</schemaUrl>

	</schemaUrls>  

	<!-- mapping spec resources below are resolved using the Xml 'DefaultResourceQualifier'  -->
	<mappingSpecUrls>
		<mappingSpecUrl>sstsoenv12.map</mappingSpecUrl> 
		<mappingSpecUrl>sstsoenc12.map</mappingSpecUrl> 
	</mappingSpecUrls>

	SstWSSoap12ClientContainer.xml
	A container deployment descriptor configured to process both SOAP 1.1 and SOAP 1.2 messages.
	Configuration for SOAP 1.2 is accomplished by deploying the SOAP 1.2 schemas in the <schemaUrls> section of the deployment descriptor
	as shown above.

	SstWSInsurancePolicyInterface-interface.wsdl  - The interface WSDL for the insurance example which 
	describes the abstract interfaces and bindings of all operations supported by the SstWSInsurancePolicyInterface 

	service.  The 'binding' section of this WSDL document specifies that operations will be serialized
	with style='rpc' and use='encoded'.  The 'encodingStyle' is set to the SOAP 1.2 encoding namespace
	(http://www.w3.org/2003/05/soap-encoding).

	soap12-env.xsd - A local copy of the URL http://www.w3.org/2003/05/soap-envelope/.  Use this local copy of the
	network or target URL is not accessible.


"  -----------   Resource file generation and test setup ---------------------------------------------------------- "


" Start an HTTP file server to serve required service deployment files.  The server  "

 |server|

 server := SstHttpServerExample runAt: 'http://:63001' 

	in: SstWebServicesInsuranceExample wsCommonResourceDirectory

" Updates configuration so that the test resources are properly resolved.  
  This step establishes settings in the active XML configuration causing unqualified WSDL

  resources to be retrieved from the 'soap12' test directory.  "
SstWebServicesInsuranceExample setupSoap12


" Clear all existing containers and deploy the container described in the resource SstWSSampleSoap12ServerContainer.xml.
  The new container is configured to process both SOAP 1.1 and SOAP 1.2 requests "
| container |
SstWSContainer clearAll.

container := SstWSContainer deploy: 'SstWSSampleSoap12ServerContainer.xml'


" Deploy the container described in the resource SstWSSampleSoap12ClientContainer.xml.  The deployment descriptor is coded
to enable automatic deployment of the insurance example service.  The new container is configured to process both SOAP 1.1 and
SOAP 1.2.  The #sstSoapEnvelopeNamespace for the insurance service is set to the SOAP 1.2 namespace, so all outgoing SOAP
envelopes will be defined using the rules from the SOAP 1.2 namespace. "
| container service |
container := SstWSContainer deploy: 'SstWSSampleSoap12ClientContainer.xml'.
service := container serviceManager serviceNamed: 'SstWSInsurancePolicyInterface' 

	inNamespace: 'http://www.SstWSInsurancePolicyInterface.com/SstWSInsurancePolicyInterface-impl'.

service sstSoapEnvelopeNamespace: SstSoapConstants::SstSoap12EnvelopeNamespace.


" Invoke the #about operation of the insurance example.  The request is passed using SOAP 1.2 envelope "
[|aContainer service |

aContainer := SstWSContainer containerNamed:  'VastSampleClientContainer'.

service := aContainer serviceManager serviceNamed: 'SstWSInsurancePolicyInterface' 

	inNamespace: 'http://www.SstWSInsurancePolicyInterface.com/SstWSInsurancePolicyInterface-impl'.

service about inspect ] fork.



" This code passes an invalid business partner argument (2nd argument) and causes the server application logic to 

  issue an exception.  The exception is passed back to the client as a SOAP fault "

[|aContainer service   policy  |

 aContainer := SstWSContainer containerNamed:  'VastSampleClientContainer'.

 service := aContainer serviceNamed: 'SstWSInsurancePolicyInterface' 

	 inNamespace: 'http://www.SstWSInsurancePolicyInterface.com/SstWSInsurancePolicyInterface-impl'.

(policy:= service getInfoForPolicy: '85496328'  withVerification: 'Big boy insurance' ) inspect.

] fork
