Deploying a Uniface Web Service
To enable call-in to Uniface web services:
-
Create a Uniface service component, for
example, MY_WS and compile it.
A Uniface web service can be created as a Uniface service (SVC), session service (SSV), entity service (ESV), or a service with a non-Uniface implementation, such as COM or C.
Consider the following when you develop a service to be used as a web service:
Issue Explanation State Web services are stateless. To maintain state, you must specify parameters containing state information to be used by the service to retrieve the correct state. Return value For synchronous implementations, the return value of the SOAP request is mapped to $status and the type is fixed to int
.Character set UTF-8 Callback operations You can implement callback operations to process any SOAP envelope that the user wants, including those with encrypted content. For more information, see SOAP Callback Operations for Web Services Call-In . -
Export the signature of MY_WS using the
/sto /mwr=ws
command line switch. For more information, see Exporting WSDL and Schema Files for Web Services Call-In./sto /mwr=ws MY_WS
A my_wsdlw.wsdl file is generated in the project directory. If there are entities or occurrences as operations parameters, .xsd files are also generated,
-
Deploy the web service.
Note: The following describes deployment into the Tomcat web server provided in the default Uniface installation. If you are using another web server, consult the web server documentation for instructions.
-
Put the generated my_wsdlw.wsdl (and
.xsd, if it is generated) in
UnifaceAPSDir\uniface\webapps\uniface\WEB-INF\wsdl.
If required, register the WSDLs on sites where you want your web services to be exposed.For example, use the Universal Description, Discovery, and Integration (UDDI), an XML-based worldwide business registry. UDDI provides a mechanism for describing a company and the services it offers, similar to the Yellow Pages provides for shoppers. The web services offered by the company can be registered in UDDI so the service can be located and used.
-
Check the servlet SRD specification in the
UnifaceAPSDir\uniface\webapps\uniface\WEB-INF\web.xml file.
Find which UST is used by the Uniface Router. By default, it is
wasv
.<param-name>MIDDLEWARE</param-name> <param-value>UV8:machineName\userver|userver|wasv</param-value>
-
From
UnifaceAPSDir\common\adm\urouter.asn file, find the
definition of this UST.
For example, the following definition indicates that the MY_WS service should be deployed in the directory D:\Uniface.
wasv = "D:\UnifaceAPS\common\bin\userver.exe" -dir="D:\Uniface" -asn=usysadm:wasv.asn
If necessary for your deployment environment, create the UAR file to contain the compiled signature.
- Restart the web server and the Uniface Router to enable the changes to be applied.
-
Put the generated my_wsdlw.wsdl (and
.xsd, if it is generated) in
UnifaceAPSDir\uniface\webapps\uniface\WEB-INF\wsdl.
-
Test the web service.
The simplest way to test it is using Uniface web service call-out functionality. You need to use the SOAP connector U2.0, because the binding style of my_wsdlw.wsdl is Document/Literal Wrapped. For more information, see Calling Web Services from Uniface.