ie) SstWSXmlGeneration forClass: SstWSInsurancePolicyInterface
Notice that the address element of
SstWSPerson has a type
tns:SstWSAddress. The type
SstWSAddress is defined within the same XML schema as
SstWSPerson. The prefix
tns is a namespace prefix which indicates that the
SstWSPerson type is defined in the namespace http://www.SstWSInsurancePolicyInterface.com/SstWSInsurancePolicyInterface-impl. The association between the 'tns' prefix and the http://www.SstWSInsurancePolicyInterface.com/SstWSInsurancePolicyInterface-impl namespace is established in the root schema tag using the special
xmlns attribute prefix.
imageComponentUrls - Specify the image components that should be loaded during deployment of the referenced services. Individual image components must be resolvable using standard IC loading protocol; therefore, the image component must be fully qualified, or it must be locatable in the IC_ROOT directory.
mappingSpecUrls - Specify the mapping specification resources that should be initialized during service deployment. All listed mapping specification files are parsed and stored by the
serializationManager of the container. The rules in these mapping specifications are used at execution time to map incoming SOAP messages into application domain objects.
wsdlUrls - Specify the WSDL implementation resources that are required to describe the services being deployed. WSDL resources that are resolved via WSDL
import elements should not be listed here.
handlers - Specify the Web service handlers for a specified namespace. Handlers defined in this section are typically referenced by one or more 'operation' elements from the service provider definition. Multiple
handlers elements are permitted, and each
handlers element contains one or more
handler,
chain, or
operationHandler elements.
service - This element identifies a WSDL service name and namespace that MUST match the name and namespace for a WSDL service element. The namespace for a
service is usually the same as the
targetNamespace of the definitions element that contains it. The contents of the service element are used to configure the implementation of a VA Smalltalk Web service.
serviceInterfaceClass - This element specifies the name of the service proxy class for the service. The default (
SstWSService) is sufficient for most cases, but can be replaced by a user-written interface class if desired.
provider - This complex element is used to map the WSDL operation interfaces to the Smalltalk method implementations.
vast:provider - This extension to the provider element allows for specification of the service implementation class. The prefix 'vast' is associated with the namespace "Smalltalk". The 'vast:provider' extension is only required when describing hosted services. If the extension is not supplied, the service being described is assumed to be a remote service.
operations - This element contains a collection of operation elements that describe how to invoke the WSDL operations for the service.
The name attribute of the operation indicates a selector from the
vast:provider instance.
The qName attribute is the qualified name of a WSDL operation. The prefix for the qualified name must be associated with the namespace that is used to resolve the operation at runtime. For SOAP messages encoded as
rpc, the message namespace is specified in the
soap:body extension of the interface WSDL.
The flow attribute is the qualified name of a Web services handler that is invoked to process the operation.
The <serviceUrls> section of a container deployment descriptor is used to supply a collection of resources that describe services to be deployed into the container. The content of our
serviceUrl tag is a service deployment descriptor resource named
SstWSInsurancePolicyInterface.xml. The service deployment descriptor specifies the implementation mappings and required resources for the insurance example service.
During service deployment, the <service> section of the deployment descriptor is used to construct an
SstWSService proxy object, and the API of the proxy is determined from the mappings defined in the <
operations> collection of the service provider description. For the example above, the constructed
SstWSService proxy understands the message
#getAllPolicies because the operation mapping was specified in the deployment descriptor.
OK, so you should see an open inspector on an OrderedCollection of
SstWSInsurancePolicy objects. How did this magic happen? By creating a mapping file that maps the types listed in the WSDL to the Smalltalk class names that represent those types. The file
VASTInsuranceExample.map lists the types that we want represented as Smalltalk classes. In particular, we can see that
SstInsurancePolicyCollection is mapped to
OrderedCollection, and we also have an attribute mapping that takes all the
policy sub-elements and does an
addAll: to the
OrderedCollection. The location of the map file is specified in the deployment descriptor under the <
mappingSpecUrls> section. When you deploy using a deployment descriptor, all the mappings specified are read in and cached in the serialization manager of the container. Now let's look at some more code. If the owner of policy '85496328' needs to update it because they are adding another dependent, then here is how that could be done using our service:
The getAllPolicies operation demonstrated how a collection of objects can be exchanged using the framework. Another way to represent collections is to use the built in mechanism in SOAP called SOAP arrays. The Smalltalk class
SstSoapArray is used to represent a SOAP array. To illustrate this, we can create a new operation called
getAllPoliciesUsingSoapArrays. Here are the changes required to implement this new operation:
In the file SstWSInsurancePolicyInterface-interface.wsdl, you will notice that in the <
portType> section, there is the following additional operation:
This new type is defined as a restricted type of SOAP array. The restriction is that the array can only contain elements of type
SstWSInsurancePolicy (as specified in the fourth line above).
In the file SstWSInsurancePolicyInterface.xml (the service deployment descriptor), there is another operation specified:
So now we have two operations with the same name, but different qName. This means that the same selector
#getAllPolicies will be executed for both operations, but one will return an
OrderedCollection of policies and the other will return a
SstSoapArray of policies. Similarly, the same addition is made to the client deployment descriptor,
SstWSInsurancePolicyClientInterface.xml.
By default, WSDL specifies that both the getInfoForPolicy and
QueryInfoIn parts are to be passed as part of the SOAP Body. SOAP extensions to the WSDL can be customized to refine the encoding rules for the message.
The soap:body WSDL extension above indicates that only the
getInfoForPolicy part should be included in the SOAP Body.
The soap:header WSDL extension above indicates that the
QueryInfoIn part of the
getInfoForPolicyWithVerificationIn message should be rendered as part of the SOAP header.
To activate the SstWSSampleContainerHeaderOutputHandler in a Web services client, add the handler to the message construction handler chain as shown below.
The SstWSInsurancePolicyInterface.xml deployment descriptor contains the handler definition shown below:
Therefore, the vastContainer element that is passed as a header by our client container is processed by our hosted service using the handler with class named
SstWSSampleContainerHeaderInputHandler. The vastContainer handler was automatically registered during deployment of
SstWSInsurancePolicyInterface.xml.
Copyright 2005, 2018 Instantiations, Inc. All rights reserved.